Comparing version 1.3.8 to 1.4.0
@@ -1,2 +0,2 @@ | ||
/* cputils.js (C) 2013-2014 SheetJS -- http://sheetjs.com */ | ||
/* cputils.js (C) 2013-present SheetJS -- http://sheetjs.com */ | ||
/*jshint newcap: false */ | ||
@@ -71,3 +71,2 @@ (function(root, factory){ | ||
} | ||
out.length = j; | ||
out = out.slice(0,j); | ||
@@ -110,4 +109,3 @@ } else { | ||
} | ||
mdb.length = 2 * len; | ||
return mdb.toString('ucs2'); | ||
return mdb.slice(0, 2 * len).toString('ucs2'); | ||
}; | ||
@@ -132,3 +130,2 @@ }; | ||
} | ||
out.length = k; | ||
out = out.slice(0,k); | ||
@@ -148,3 +145,2 @@ } else if(Buffer.isBuffer(data)) { | ||
} | ||
out.length = k; | ||
out = out.slice(0,k); | ||
@@ -193,4 +189,3 @@ } else { | ||
} | ||
out.length = k; | ||
return out.toString('ucs2'); | ||
return out.slice(0,k).toString('ucs2'); | ||
}; | ||
@@ -201,3 +196,2 @@ }; | ||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); } | ||
mdb.length = 0; | ||
var i = 0; | ||
@@ -217,4 +211,3 @@ if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3; | ||
} | ||
mdb.length = k; | ||
return mdb.toString('ucs2'); | ||
return mdb.slice(0,k).toString('ucs2'); | ||
}; | ||
@@ -244,6 +237,5 @@ magic_encode[65001] = function utf8_e(data, ofmt) { | ||
} | ||
mdb.length = j; | ||
if(ofmt === undefined || ofmt === 'buf') return mdb; | ||
if(ofmt !== 'arr') return mdb.toString('binary'); | ||
return [].slice.call(mdb); | ||
if(ofmt === undefined || ofmt === 'buf') return mdb.slice(0,j); | ||
if(ofmt !== 'arr') return mdb.slice(0,j).toString('binary'); | ||
return [].slice.call(mdb, 0, j); | ||
}; | ||
@@ -397,3 +389,2 @@ } | ||
else throw new Error("Unrecognized CP: " + cp); | ||
out.length = j; | ||
out = out.slice(0,j); | ||
@@ -462,3 +453,3 @@ if(typeof Buffer === 'undefined') return (ofmt == 'str') ? out.map(sfcc).join("") : out; | ||
i = 0; | ||
if(len >= 4 && data[0] == 0xFF) if(data[1] == 0xFE && data[2] == 0 && data[3] == 0) i = 4; | ||
if(len >= 4 && data[0] == 0xFF) if(data[1] == 0xFE && data[2] === 0 && data[3] === 0) i = 4; | ||
j = 4; | ||
@@ -477,3 +468,3 @@ for(; i < len; i+=j) { | ||
i = 0; | ||
if(len >= 4 && data[3] == 0xFF) if(data[2] == 0xFE && data[1] == 0 && data[0] == 0) i = 4; | ||
if(len >= 4 && data[3] == 0xFF) if(data[2] == 0xFE && data[1] === 0 && data[0] === 0) i = 4; | ||
j = 4; | ||
@@ -529,4 +520,3 @@ for(; i < len; i+=j) { | ||
else throw new Error("Unrecognized CP: " + cp); | ||
out.length = k; | ||
return out.join(""); | ||
return out.slice(0,k).join(""); | ||
}; | ||
@@ -533,0 +523,0 @@ var hascp = function hascp(cp) { return cpt[cp] || magic[cp]; }; |
{ | ||
"name": "codepage", | ||
"version": "1.3.8", | ||
"version": "1.4.0", | ||
"author": "SheetJS", | ||
@@ -22,2 +22,3 @@ "description": "pure-JS library to handle codepages", | ||
"concat-stream":"", | ||
"exit-on-epipe":"", | ||
"commander":"" | ||
@@ -24,0 +25,0 @@ }, |
@@ -290,4 +290,4 @@ # Codepages for JS | ||
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/afa29a5e8495a01059ee5b353f9042cb "githalytics.com")](http://githalytics.com/SheetJS/js-codepage) | ||
[![Build Status](https://travis-ci.org/SheetJS/js-codepage.svg?branch=master)](https://travis-ci.org/SheetJS/js-codepage) | ||
[![Coverage Status](https://coveralls.io/repos/SheetJS/js-codepage/badge.png)](https://coveralls.io/r/SheetJS/js-codepage) | ||
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-codepage?pixel)](https://github.com/SheetJS/js-codepage) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3345116
9
19193
4
4
19
+ Addedexit-on-epipe@
+ Addedexit-on-epipe@1.0.1(transitive)