🆙 `jschardet@3.1.4` (#230197)

pull/230207/head
Benjamin Pasero 2024-10-01 08:19:15 +02:00 committed by GitHub
parent 699bbcc761
commit b591f33513
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 34 additions and 27 deletions

View File

@ -163,7 +163,7 @@ typescript/lib/tsserverlibrary.js
jschardet/index.js
jschardet/src/**
# TODO@esm uncomment when we can use jschardet.min.js again jschardet/dist/jschardet.js
jschardet/dist/jschardet.js
es6-promise/lib/**

View File

@ -14,7 +14,7 @@
jschardet/index.js
jschardet/src/**
# TODO@esm uncomment when we can use jschardet.min.js again jschardet/dist/jschardet.js
jschardet/dist/jschardet.js
vscode-textmate/webpack.config.js

View File

@ -14,7 +14,7 @@
"@vscode/iconv-lite-umd": "0.7.0",
"byline": "^5.0.0",
"file-type": "16.5.4",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"picomatch": "2.3.1",
"vscode-uri": "^2.0.0",
"which": "4.0.0"
@ -268,9 +268,10 @@
}
},
"node_modules/jschardet": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz",
"integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz",
"integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==",
"license": "LGPL-2.1+",
"engines": {
"node": ">=0.1.90"
}
@ -385,6 +386,13 @@
"url": "https://github.com/sponsors/Borewit"
}
},
"node_modules/tslib": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==",
"license": "0BSD",
"peer": true
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",

View File

@ -3384,7 +3384,7 @@
"@vscode/iconv-lite-umd": "0.7.0",
"byline": "^5.0.0",
"file-type": "16.5.4",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"picomatch": "2.3.1",
"vscode-uri": "^2.0.0",
"which": "4.0.0"

9
package-lock.json generated
View File

@ -36,7 +36,7 @@
"@xterm/xterm": "^5.6.0-beta.65",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"kerberos": "2.1.1",
"minimist": "^1.2.6",
"native-is-elevated": "0.7.0",
@ -11030,9 +11030,10 @@
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"node_modules/jschardet": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz",
"integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz",
"integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==",
"license": "LGPL-2.1+",
"engines": {
"node": ">=0.1.90"
}

View File

@ -93,7 +93,7 @@
"@xterm/xterm": "^5.6.0-beta.65",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"kerberos": "2.1.1",
"minimist": "^1.2.6",
"native-is-elevated": "0.7.0",

View File

@ -31,7 +31,7 @@
"cookie": "^0.4.0",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"kerberos": "2.1.1",
"minimist": "^1.2.6",
"native-watchdog": "^1.4.1",
@ -613,9 +613,10 @@
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"node_modules/jschardet": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz",
"integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz",
"integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==",
"license": "LGPL-2.1+",
"engines": {
"node": ">=0.1.90"
}

View File

@ -26,7 +26,7 @@
"cookie": "^0.4.0",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"kerberos": "2.1.1",
"minimist": "^1.2.6",
"native-watchdog": "^1.4.1",

View File

@ -20,7 +20,7 @@
"@xterm/addon-unicode11": "^0.9.0-beta.65",
"@xterm/addon-webgl": "^0.19.0-beta.65",
"@xterm/xterm": "^5.6.0-beta.65",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"tas-client-umd": "0.2.0",
"vscode-oniguruma": "1.7.0",
"vscode-textmate": "9.1.0"
@ -148,9 +148,10 @@
"integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw=="
},
"node_modules/jschardet": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz",
"integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz",
"integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==",
"license": "LGPL-2.1+",
"engines": {
"node": ">=0.1.90"
}

View File

@ -15,7 +15,7 @@
"@xterm/addon-unicode11": "^0.9.0-beta.65",
"@xterm/addon-webgl": "^0.19.0-beta.65",
"@xterm/xterm": "^5.6.0-beta.65",
"jschardet": "3.1.3",
"jschardet": "3.1.4",
"tas-client-umd": "0.2.0",
"vscode-oniguruma": "1.7.0",
"vscode-textmate": "9.1.0"

View File

@ -320,11 +320,7 @@ const IGNORE_ENCODINGS = ['ascii', 'utf-16', 'utf-32'];
* Guesses the encoding from buffer.
*/
async function guessEncodingByBuffer(buffer: VSBuffer, candidateGuessEncodings?: string[]): Promise<string | null> {
// TODO@bpasero TODO@esm: this used to be `dist/jschardet.min.js`, but we are running into an issue that
// https://github.com/aadsm/jschardet/pull/96 mitigates. Long-term we should just add minification
// of dependencies into our build process so that we do not depend on how others are doing it.
const jschardet = await importAMDNodeModule<typeof import('jschardet')>('jschardet', 'dist/jschardet.js');
const jschardet = await importAMDNodeModule<typeof import('jschardet')>('jschardet', 'dist/jschardet.min.js');
// ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53
const limitedBuffer = buffer.slice(0, AUTO_ENCODING_GUESS_MAX_BYTES);