Remove TextEncoder/TextDecoder polyfills

Also, drop support for Node.js 10.
This commit is contained in:
Daniel Huigens 2021-02-27 00:52:31 +01:00
parent 3a42b45ab7
commit ab419179bc
7 changed files with 3 additions and 19 deletions

View File

@ -1,3 +1,4 @@
dist
test/lib/
test/typescript/definitions.js
docs

View File

@ -328,6 +328,7 @@ module.exports = {
// eslint-plugin-import rules:
"import/extensions": "never",
"import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}],
"import/no-unassigned-import": "error",
// Custom silencers:
"camelcase": 0,

View File

@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:

6
package-lock.json generated
View File

@ -4897,12 +4897,6 @@
}
}
},
"text-encoding-utf-8": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz",
"integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==",
"dev": true
},
"text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",

View File

@ -84,7 +84,6 @@
"rollup-plugin-terser": "^5.3.0",
"seek-bzip": "github:openpgpjs/seek-bzip#4b89457f20c0e1921b4689106a31c99782c29829",
"sinon": "^4.3.0",
"text-encoding-utf-8": "^1.0.2",
"tweetnacl": "github:openpgpjs/tweetnacl-js#3dae25bd3eaa77173f3405676b595721dde92eec",
"typescript": "^4.1.2",
"web-stream-tools": "github:openpgpjs/web-stream-tools#5e6cb1a976d50c421091907615cf7cce77ac4f2a",

View File

@ -21,7 +21,6 @@ import { Message } from './message';
import { CleartextMessage } from './cleartext';
import { generate, reformat } from './key';
import defaultConfig from './config';
import './polyfills';
import util from './util';
let toNativeReadable;

View File

@ -1,10 +0,0 @@
if (typeof TextEncoder === 'undefined') {
const nodeUtil = require('util') || {};
globalThis.TextEncoder = nodeUtil.TextEncoder;
globalThis.TextDecoder = nodeUtil.TextDecoder;
}
if (typeof TextEncoder === 'undefined') {
const textEncoding = require('text-encoding-utf-8');
globalThis.TextEncoder = textEncoding.TextEncoder;
globalThis.TextDecoder = textEncoding.TextDecoder;
}