Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jschardet

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jschardet - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

2

package.json
{
"name": "jschardet",
"version": "3.1.2",
"version": "3.1.3",
"description": "Character encoding auto-detection in JavaScript (port of python's chardet)",

@@ -5,0 +5,0 @@ "author": "António Afonso",

@@ -238,11 +238,32 @@ /*

if( this._mInputState == _state.highbyte ) {
for( var i = 0, prober; prober = this._mCharsetProbers[i]; i++ ) {
if( !prober || !prober.getCharsetName() || !canDetectEncoding(prober.getCharsetName()) ) continue;
if (this._mInputState == _state.highbyte) {
let windows_1252_confidence = 0;
let windows_1250_detected = false;
for (var i = 0, prober; prober = this._mCharsetProbers[i]; i++) {
if (!prober) continue;
const charsetName = prober.getCharsetName();
const confidence = prober.getConfidence();
if (prober.getCharsetName() === "windows-1252") {
windows_1252_confidence = confidence;
}
if (!charsetName || !canDetectEncoding(charsetName)) continue;
this.results.push({
"encoding": prober.getCharsetName(),
"confidence": prober.getConfidence()
"confidence": confidence
});
logger.log(prober.getCharsetName() + " confidence " + prober.getConfidence());
if (prober.getCharsetName() === "windows-1250") {
windows_1250_detected = true;
}
logger.log(prober.getCharsetName() + " confidence " + confidence);
}
// HACK: When windows-1252 is detected it's almost sure that it can
// also be windows-1250.
// https://en.wikipedia.org/wiki/Windows-1250 (Central European)
if (windows_1252_confidence && !windows_1250_detected && canDetectEncoding("windows-1250")) {
this.results.push({
"encoding": "windows-1250",
// Report the confidence just a bit under windows-1252's.
"confidence": windows_1252_confidence - Math.pow(5/10, (String(windows_1252_confidence).length - 1)),
});
}
this.results.sort(function(a, b) {

@@ -249,0 +270,0 @@ return b.confidence - a.confidence;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc