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 1.4.0 to 1.4.1

2

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

@@ -5,0 +5,0 @@ "main": "src/init",

@@ -97,3 +97,3 @@ /*

if( jschardet.Constants._debug ) {
log(prober.getCharsetName() + " not active\n");
jschardet.log(prober.getCharsetName() + " not active\n");
}

@@ -104,3 +104,3 @@ continue;

if( jschardet.Constants._debug ) {
log(prober.getCharsetName() + " confidence = " + cf + "\n");
jschardet.log(prober.getCharsetName() + " confidence = " + cf + "\n");
}

@@ -107,0 +107,0 @@ if( bestConf < cf ) {

@@ -59,3 +59,3 @@ /*

if( jschardet.Constants._debug ) {
log(this.getCharsetName() + " prober hit error at byte " + i + "\n");
jschardet.log(this.getCharsetName() + " prober hit error at byte " + i + "\n");
}

@@ -62,0 +62,0 @@ this._mState = jschardet.Constants.notMe;

@@ -18,3 +18,3 @@ /*

* version 2.1 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,

@@ -24,3 +24,3 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of

* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public

@@ -88,1 +88,4 @@ * License along with this library; if not, write to the Free Software

}
jschardet.log = function() {
console.log.apply(console, arguments);
}

@@ -65,3 +65,3 @@ /*

if( jschardet.Constants._debug ) {
log(this.getCharsetName() + " prober hit error at byte " + i + "\n");
jschardet.log(this.getCharsetName() + " prober hit error at byte " + i + "\n");
}

@@ -68,0 +68,0 @@ this._mState = jschardet.Constants.notMe;

@@ -105,7 +105,7 @@ /*

if( jschardet.Constants._debug ) {
log(this._mModel.charsetName + " confidence = " + cf + ", we have a winner\n");
jschardet.log(this._mModel.charsetName + " confidence = " + cf + ", we have a winner\n");
}
} else if( cf < NEGATIVE_SHORTCUT_THRESHOLD ) {
if( jschardet.Constants._debug ) {
log(this._mModel.charsetName + " confidence = " + cf + ", below negative shortcut threshhold " + NEGATIVE_SHORTCUT_THRESHOLD + "\n");
jschardet.log(this._mModel.charsetName + " confidence = " + cf + ", below negative shortcut threshhold " + NEGATIVE_SHORTCUT_THRESHOLD + "\n");
}

@@ -123,5 +123,5 @@ this._mState = jschardet.Constants.notMe;

if( this._mTotalSeqs > 0 ) {
//log(this._mSeqCounters[POSITIVE_CAT] + " " + this._mTotalSeqs + " " + this._mModel.mTypicalPositiveRatio);
//jschardet.log(this._mSeqCounters[POSITIVE_CAT] + " " + this._mTotalSeqs + " " + this._mModel.mTypicalPositiveRatio);
r = (1.0 * this._mSeqCounters[POSITIVE_CAT]) / this._mTotalSeqs / this._mModel.mTypicalPositiveRatio;
//log(r + " " + this._mFreqChar + " " + this._mTotalChar);
//jschardet.log(r + " " + this._mFreqChar + " " + this._mTotalChar);
r *= this._mFreqChar / this._mTotalChar;

@@ -128,0 +128,0 @@ if( r >= 1.0 ) {

@@ -59,3 +59,3 @@ /*

if( jschardet.Constants._debug ) {
log(this.getCharsetName() + " prober hit error at byte " + i + "\n");
jschardet.log(this.getCharsetName() + " prober hit error at byte " + i + "\n");
}

@@ -62,0 +62,0 @@ this._mState = jschardet.Constants.notMe;

@@ -159,3 +159,3 @@ /*

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

@@ -168,3 +168,3 @@ return;

if( jschardet.Constants._debug ) {
console.log("pure ascii")
jschardet.log("pure ascii")
}

@@ -187,3 +187,3 @@ this.result = {"encoding": "ascii", "confidence": 1.0};

if( jschardet.Constants._debug ) {
console.log(prober.getCharsetName() + " confidence " + prober.getConfidence());
jschardet.log(prober.getCharsetName() + " confidence " + prober.getConfidence());
}

@@ -201,6 +201,6 @@ }

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

@@ -207,0 +207,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