Skip to content

Commit

Permalink
Updated distribution files
Browse files Browse the repository at this point in the history
Bundle size changes since v3.1.0:
* dist/jschardet.js -9 (469023 -> 469014)
Bundle size changes since v3.1.0:
* dist/jschardet.min.js +38 (339263 -> 339301)
  • Loading branch information
aadsm committed Mar 23, 2024
1 parent e07679c commit 4cd7fe5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 36 deletions.
16 changes: 7 additions & 9 deletions dist/jschardet.js
Original file line number Diff line number Diff line change
Expand Up @@ -6719,13 +6719,7 @@ function MBCSGroupProber() {
new Big5Prober(),
new EUCTWProber()
];
const supportedCharsetNames = (function() {
const charsetNames = [];
for (const prober of this._mProbers) {
charsetNames.push(prober.getCharsetName())
}
return charsetNames;
});
const supportedCharsetNames = this._mProbers.map(prober => prober.getCharsetName());
this.getSupportedCharsetNames = function() {
return supportedCharsetNames;
}
Expand Down Expand Up @@ -7553,7 +7547,10 @@ const supportedEncodingsDenormalized = (function() {

function UniversalDetector(options) {
if (!options) options = {};
if (!options.minimumThreshold) options.minimumThreshold = 0.20;

if (typeof options.minimumThreshold !== "number") {
options.minimumThreshold = 0.20;
}

if (options.detectEncodings) {
for (const encoding of options.detectEncodings) {
Expand Down Expand Up @@ -7582,7 +7579,8 @@ function UniversalDetector(options) {
if (!options.detectEncodings) {
return true;
}
return options.detectEncodings.includes(encoding.toLowerCase());
lowerDetectedEncodings = options.detectEncodings.map(encoding => encoding.toLowerCase());
return lowerDetectedEncodings.includes(encoding.toLowerCase());
}

this.reset = function() {
Expand Down
Loading

0 comments on commit 4cd7fe5

Please sign in to comment.