Socket
Socket
Sign inDemoInstall

jschardet

Package Overview
Dependencies
Maintainers
1
Versions
25
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 0.0.1 to 0.0.2

4

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

@@ -10,3 +10,3 @@ "main": "src/init",

"type": "git",
"url": "https://brainafk@github.com/brainafk/jschardet.git"
"url": "https://brainafk@github.com/brainafk/node-jschardet.git"
},

@@ -13,0 +13,0 @@ "directories": { "lib": "./lib", "test": "./test" },

@@ -68,9 +68,12 @@ /*

jschardet.VERSION = "0.1";
jschardet.detect = function(aBuf) {
jschardet.detect = function(buffer) {
var u = new jschardet.UniversalDetector();
u.reset();
if( aBuf instanceof Array ) {
u.feed(String.fromCharCode.apply(String, aBuf));
if( buffer instanceof Buffer ) {
var str = "";
for (var i = 0; i < buffer.length; ++i)
str += String.fromCharCode(buffer[i])
u.feed(str);
} else {
u.feed(aBuf);
u.feed(buffer);
}

@@ -77,0 +80,0 @@ u.close();

@@ -152,3 +152,3 @@ /*

if( jschardet.Constants._debug ) {
log("no data received!\n");
console.log("no data received!\n");
}

@@ -160,2 +160,3 @@ return;

if( this._mInputState == _state.pureAscii ) {
console.log("pure ascii")
this.result = {"encoding": "ascii", "confidence": 1.0};

@@ -188,6 +189,6 @@ return this.result;

if( jschardet.Constants._debug ) {
log("no probers hit minimum threshhold\n");
console.log("no probers hit minimum threshhold\n");
for( var i = 0, prober; prober = this._mCharsetProbers[i]; i++ ) {
if( !prober ) continue;
log(prober.getCharsetName() + " confidence = " +
console.log(prober.getCharsetName() + " confidence = " +
prober.getConfidence() + "\n");

@@ -194,0 +195,0 @@ }

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