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

engine.io-parser

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

engine.io-parser - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

9

History.md
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 @@ ==================

7

lib/browser.js

@@ -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": {

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