engine.io-parser
Advanced tools
Comparing version 1.3.0 to 1.3.1
1.3.1 / 2016-10-20 | ||
================== | ||
* [fix] Add safety check for global object (#71) | ||
* [fix] decodePacket now accepts both Buffer and ArrayBuffer as data (#64) | ||
* [fix] Handle undefined case properly when decoding packet (#74) | ||
* [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#70) | ||
* [chore] Update zuul browser settings (#73) | ||
1.3.0 / 2016-09-26 | ||
@@ -3,0 +12,0 @@ ================== |
@@ -12,3 +12,3 @@ /** | ||
var base64encoder; | ||
if (global.ArrayBuffer) { | ||
if (global && global.ArrayBuffer) { | ||
base64encoder = require('base64-arraybuffer'); | ||
@@ -226,4 +226,7 @@ } | ||
exports.decodePacket = function (data, binaryType, utf8decode) { | ||
if (data === undefined) { | ||
return err; | ||
} | ||
// String data | ||
if (typeof data == 'string' || data === undefined) { | ||
if (typeof data == 'string') { | ||
if (data.charAt(0) == 'b') { | ||
@@ -230,0 +233,0 @@ return exports.decodeBase64Packet(data.substr(1), binaryType); |
@@ -121,4 +121,7 @@ /** | ||
exports.decodePacket = function (data, binaryType, utf8decode) { | ||
if (data === undefined) { | ||
return err; | ||
} | ||
// String data | ||
if (typeof data == 'string' || data === undefined) { | ||
if (typeof data == 'string') { | ||
if (data.charAt(0) == 'b') { | ||
@@ -150,9 +153,11 @@ return exports.decodeBase64Packet(data.substr(1), binaryType); | ||
if (binaryType === 'arraybuffer') { | ||
var type = data[0]; | ||
var intArray = new Uint8Array(data.length - 1); | ||
for (var i = 1; i < data.length; i++) { | ||
intArray[i - 1] = data[i]; | ||
} | ||
return { type: packetslist[type], data: intArray.buffer }; | ||
// wrap Buffer/ArrayBuffer data into an Uint8Array | ||
var intArray = new Uint8Array(data); | ||
var type = intArray[0]; | ||
return { type: packetslist[type], data: intArray.buffer.slice(1) }; | ||
} | ||
if (data instanceof ArrayBuffer) { | ||
data = arrayBufferToBuffer(data); | ||
} | ||
var type = data[0]; | ||
@@ -159,0 +164,0 @@ return { type: packetslist[type], data: data.slice(1) }; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"homepage": "https://github.com/socketio/engine.io-parser", | ||
@@ -11,4 +11,4 @@ "devDependencies": { | ||
"mocha": "2.2.5", | ||
"zuul": "3.10.1", | ||
"zuul-ngrok": "3.2.0" | ||
"zuul": "3.11.0", | ||
"zuul-ngrok": "4.0.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "dependencies": { |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37273
914
0