aboutsummaryrefslogtreecommitdiffhomepage
path: root/node_modules/socket.io-parser
diff options
context:
space:
mode:
authorYaroslav De La Peña Smirnov <yaros.rus_89@live.com.mx>2017-11-29 11:44:34 +0300
committerYaroslav De La Peña Smirnov <yaros.rus_89@live.com.mx>2017-11-29 11:44:34 +0300
commit67fdec20726e48ba3a934cb25bb30d47ec4a4f29 (patch)
tree37fd9f4f0b0c20103e1646fc83021e4765de3680 /node_modules/socket.io-parser
downloadspanish-checkers-67fdec20726e48ba3a934cb25bb30d47ec4a4f29.tar.gz
spanish-checkers-67fdec20726e48ba3a934cb25bb30d47ec4a4f29.zip
Initial commit, version 0.5.3
Diffstat (limited to 'node_modules/socket.io-parser')
-rw-r--r--node_modules/socket.io-parser/History.md160
-rw-r--r--node_modules/socket.io-parser/LICENSE20
-rw-r--r--node_modules/socket.io-parser/Readme.md73
-rw-r--r--node_modules/socket.io-parser/binary.js141
-rw-r--r--node_modules/socket.io-parser/index.js400
-rw-r--r--node_modules/socket.io-parser/is-buffer.js13
-rw-r--r--node_modules/socket.io-parser/package.json101
7 files changed, 908 insertions, 0 deletions
diff --git a/node_modules/socket.io-parser/History.md b/node_modules/socket.io-parser/History.md
new file mode 100644
index 0000000..17e16a9
--- /dev/null
+++ b/node_modules/socket.io-parser/History.md
@@ -0,0 +1,160 @@
+
+3.1.2 / 2017-04-27
+==================
+
+ * [chore] Bump has-binary2 to version 1.0.2 (#70)
+ * [fix] Fix Blob detection for iOS 8/9 (#69)
+
+3.1.1 / 2017-04-25
+==================
+
+ * [fix] Ensure globals are functions before running `instanceof` (#68)
+
+3.1.0 / 2017-04-24
+==================
+
+ * [chore] Bump debug to version 2.6.4 (#67)
+ * [feat] Move binary detection to the parser (#66)
+
+3.0.0 / 2017-04-04
+==================
+
+ * [chore] Bump isarray to version 2.0.1 (#65)
+ * [chore] Use native JSON and drop support for older nodejs versions (#64)
+
+2.3.2 / 2016-12-30
+==================
+
+ * [perf] Small optimisations (#57)
+ * [chore] Update zuul config to speed up tests in browser (#58)
+ * [refactor] Remove useless variable (#55)
+ * [chore] Bump dependencies (#56)
+ * [refactor] Remove unused var (#53)
+ * [refactor] Use strict equality when possible (#52)
+
+2.3.1 / 2016-10-24
+==================
+
+* [chore] Revert "Remove deprecated isarray dependency" (#50)
+
+2.3.0 / 2016-10-21
+==================
+
+ * [perf] Split try catch into separate function (#40)
+ * [chore] remove browsers setting from .zuul.yml (#34)
+ * [chore] bump zuul (#37)
+ * [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#41)
+ * [chore] Update zuul browser settings following EOL notices (#42)
+ * [chore] Restrict files included in npm package (#45)
+ * [chore] Update zuul browser settings (#44)
+ * [chore] Remove deprecated isarray dependency (#46)
+ * [chore] Make the build status badge point towards master (#47)
+ * [chore] Move benchmark to dev dependencies (#48)
+
+2.2.6 / 2015-11-25
+==================
+
+ * fix the order of exported events [chylli]
+
+2.2.5 / 2015-11-21
+==================
+
+ * package: bump debug
+ * update JSON3 to 3.3.2
+
+2.2.4 / 2015-03-03
+==================
+
+ * index: fix off-by-one bound checks
+
+2.2.3 / 2015-02-03
+==================
+
+ * index: fix potential infinite loop with malicious binary packet
+
+2.2.2 / 2014-09-04
+==================
+
+ * prevent direct `Buffer` reference that breaks browserify
+ * binary: reuse `isBuf` helper
+
+2.2.1 / 2014-06-20
+==================
+
+ * added benchmarking [kevin-roark]
+ * upgrade component-emitter to 1.1.2 [kevin-roark]
+ * update protocol version [kevin-roark]
+ * less indentation and a small optimization [kevin-roark]
+
+2.2.0 / 2014-05-30
+==================
+
+ * added a BINARY_ACK type [kevin-roark]
+
+2.1.5 / 2014-05-24
+==================
+
+ * don't iterate keys of `Date` objects [Rase-]
+
+2.1.4 / 2014-05-17
+==================
+
+ * fix null reconstruction bug [kevin-roark]
+
+2.1.3 / 2014-04-27
+==================
+
+ * bump zuul version
+ * updated protocol version
+
+2.1.2 / 2014-03-06
+==================
+
+ * added support for binary in ACK packets
+
+2.1.1 / 2014-03-04
+==================
+
+ * removed has-binary-data dependency
+ * fixed the object check in binary.removeBlobs
+
+2.1.0 / 2014-03-01
+==================
+
+ * faster and smaller binary parser and protocol [kevin-roark]
+
+2.0.0 / 2014-02-19
+==================
+
+ * binary support [kevin-roark]
+
+1.1.2 / 2014-02-11
+==================
+
+ * package: bump `json3` to fix IE6-7
+
+1.1.1 / 2014-02-10
+==================
+
+ * package: bump debug to fix browserify issues
+
+1.1.0 / 2013-12-25
+==================
+
+ * index: use `json3`
+
+1.0.3 / 2012-12-18
+==================
+
+ * index: added instrumentation through `debug`
+ * index: make sure decoded `id` is a `Number`
+
+1.0.2 / 2012-12-18
+==================
+
+ * index: allow for falsy values in `id` and `data`
+
+1.0.1 / 2012-12-10
+==================
+
+ * Revision 1
diff --git a/node_modules/socket.io-parser/LICENSE b/node_modules/socket.io-parser/LICENSE
new file mode 100644
index 0000000..7e43606
--- /dev/null
+++ b/node_modules/socket.io-parser/LICENSE
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2014 Guillermo Rauch <guillermo@learnboost.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the 'Software'), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/socket.io-parser/Readme.md b/node_modules/socket.io-parser/Readme.md
new file mode 100644
index 0000000..2463bc7
--- /dev/null
+++ b/node_modules/socket.io-parser/Readme.md
@@ -0,0 +1,73 @@
+
+# socket.io-parser
+
+[![Build Status](https://secure.travis-ci.org/socketio/socket.io-parser.svg?branch=master)](http://travis-ci.org/socketio/socket.io-parser)
+[![NPM version](https://badge.fury.io/js/socket.io-parser.svg)](http://badge.fury.io/js/socket.io-parser)
+
+A socket.io encoder and decoder written in JavaScript complying with version `3`
+of [socket.io-protocol](https://github.com/socketio/socket.io-protocol).
+Used by [socket.io](https://github.com/automattic/socket.io) and
+[socket.io-client](https://github.com/automattic/socket.io-client).
+
+## Parser API
+
+ socket.io-parser is the reference implementation of socket.io-protocol. Read
+ the full API here:
+ [socket.io-protocol](https://github.com/learnboost/socket.io-protocol).
+
+## Example Usage
+
+### Encoding and decoding a packet
+
+```js
+var parser = require('socket.io-parser');
+var encoder = new parser.Encoder();
+var packet = {
+ type: parser.EVENT,
+ data: 'test-packet',
+ id: 13
+};
+encoder.encode(packet, function(encodedPackets) {
+ var decoder = new parser.Decoder();
+ decoder.on('decoded', function(decodedPacket) {
+ // decodedPacket.type == parser.EVENT
+ // decodedPacket.data == 'test-packet'
+ // decodedPacket.id == 13
+ });
+
+ for (var i = 0; i < encodedPackets.length; i++) {
+ decoder.add(encodedPackets[i]);
+ }
+});
+```
+
+### Encoding and decoding a packet with binary data
+
+```js
+var parser = require('socket.io-parser');
+var encoder = new parser.Encoder();
+var packet = {
+ type: parser.BINARY_EVENT,
+ data: {i: new Buffer(1234), j: new Blob([new ArrayBuffer(2)])}
+ id: 15
+};
+encoder.encode(packet, function(encodedPackets) {
+ var decoder = new parser.Decoder();
+ decoder.on('decoded', function(decodedPacket) {
+ // decodedPacket.type == parser.BINARY_EVENTEVENT
+ // Buffer.isBuffer(decodedPacket.data.i) == true
+ // Buffer.isBuffer(decodedPacket.data.j) == true
+ // decodedPacket.id == 15
+ });
+
+ for (var i = 0; i < encodedPackets.length; i++) {
+ decoder.add(encodedPackets[i]);
+ }
+});
+```
+See the test suite for more examples of how socket.io-parser is used.
+
+
+## License
+
+MIT
diff --git a/node_modules/socket.io-parser/binary.js b/node_modules/socket.io-parser/binary.js
new file mode 100644
index 0000000..1a530c7
--- /dev/null
+++ b/node_modules/socket.io-parser/binary.js
@@ -0,0 +1,141 @@
+/*global Blob,File*/
+
+/**
+ * Module requirements
+ */
+
+var isArray = require('isarray');
+var isBuf = require('./is-buffer');
+var toString = Object.prototype.toString;
+var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';
+var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';
+
+/**
+ * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
+ * Anything with blobs or files should be fed through removeBlobs before coming
+ * here.
+ *
+ * @param {Object} packet - socket.io event packet
+ * @return {Object} with deconstructed packet and list of buffers
+ * @api public
+ */
+
+exports.deconstructPacket = function(packet) {
+ var buffers = [];
+ var packetData = packet.data;
+ var pack = packet;
+ pack.data = _deconstructPacket(packetData, buffers);
+ pack.attachments = buffers.length; // number of binary 'attachments'
+ return {packet: pack, buffers: buffers};
+};
+
+function _deconstructPacket(data, buffers) {
+ if (!data) return data;
+
+ if (isBuf(data)) {
+ var placeholder = { _placeholder: true, num: buffers.length };
+ buffers.push(data);
+ return placeholder;
+ } else if (isArray(data)) {
+ var newData = new Array(data.length);
+ for (var i = 0; i < data.length; i++) {
+ newData[i] = _deconstructPacket(data[i], buffers);
+ }
+ return newData;
+ } else if (typeof data === 'object' && !(data instanceof Date)) {
+ var newData = {};
+ for (var key in data) {
+ newData[key] = _deconstructPacket(data[key], buffers);
+ }
+ return newData;
+ }
+ return data;
+}
+
+/**
+ * Reconstructs a binary packet from its placeholder packet and buffers
+ *
+ * @param {Object} packet - event packet with placeholders
+ * @param {Array} buffers - binary buffers to put in placeholder positions
+ * @return {Object} reconstructed packet
+ * @api public
+ */
+
+exports.reconstructPacket = function(packet, buffers) {
+ packet.data = _reconstructPacket(packet.data, buffers);
+ packet.attachments = undefined; // no longer useful
+ return packet;
+};
+
+function _reconstructPacket(data, buffers) {
+ if (!data) return data;
+
+ if (data && data._placeholder) {
+ return buffers[data.num]; // appropriate buffer (should be natural order anyway)
+ } else if (isArray(data)) {
+ for (var i = 0; i < data.length; i++) {
+ data[i] = _reconstructPacket(data[i], buffers);
+ }
+ } else if (typeof data === 'object') {
+ for (var key in data) {
+ data[key] = _reconstructPacket(data[key], buffers);
+ }
+ }
+
+ return data;
+}
+
+/**
+ * Asynchronously removes Blobs or Files from data via
+ * FileReader's readAsArrayBuffer method. Used before encoding
+ * data as msgpack. Calls callback with the blobless data.
+ *
+ * @param {Object} data
+ * @param {Function} callback
+ * @api private
+ */
+
+exports.removeBlobs = function(data, callback) {
+ function _removeBlobs(obj, curKey, containingObject) {
+ if (!obj) return obj;
+
+ // convert any blob
+ if ((withNativeBlob && obj instanceof Blob) ||
+ (withNativeFile && obj instanceof File)) {
+ pendingBlobs++;
+
+ // async filereader
+ var fileReader = new FileReader();
+ fileReader.onload = function() { // this.result == arraybuffer
+ if (containingObject) {
+ containingObject[curKey] = this.result;
+ }
+ else {
+ bloblessData = this.result;
+ }
+
+ // if nothing pending its callback time
+ if(! --pendingBlobs) {
+ callback(bloblessData);
+ }
+ };
+
+ fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer
+ } else if (isArray(obj)) { // handle array
+ for (var i = 0; i < obj.length; i++) {
+ _removeBlobs(obj[i], i, obj);
+ }
+ } else if (typeof obj === 'object' && !isBuf(obj)) { // and object
+ for (var key in obj) {
+ _removeBlobs(obj[key], key, obj);
+ }
+ }
+ }
+
+ var pendingBlobs = 0;
+ var bloblessData = data;
+ _removeBlobs(bloblessData);
+ if (!pendingBlobs) {
+ callback(bloblessData);
+ }
+};
diff --git a/node_modules/socket.io-parser/index.js b/node_modules/socket.io-parser/index.js
new file mode 100644
index 0000000..ea206ea
--- /dev/null
+++ b/node_modules/socket.io-parser/index.js
@@ -0,0 +1,400 @@
+
+/**
+ * Module dependencies.
+ */
+
+var debug = require('debug')('socket.io-parser');
+var Emitter = require('component-emitter');
+var hasBin = require('has-binary2');
+var binary = require('./binary');
+var isBuf = require('./is-buffer');
+
+/**
+ * Protocol version.
+ *
+ * @api public
+ */
+
+exports.protocol = 4;
+
+/**
+ * Packet types.
+ *
+ * @api public
+ */
+
+exports.types = [
+ 'CONNECT',
+ 'DISCONNECT',
+ 'EVENT',
+ 'ACK',
+ 'ERROR',
+ 'BINARY_EVENT',
+ 'BINARY_ACK'
+];
+
+/**
+ * Packet type `connect`.
+ *
+ * @api public
+ */
+
+exports.CONNECT = 0;
+
+/**
+ * Packet type `disconnect`.
+ *
+ * @api public
+ */
+
+exports.DISCONNECT = 1;
+
+/**
+ * Packet type `event`.
+ *
+ * @api public
+ */
+
+exports.EVENT = 2;
+
+/**
+ * Packet type `ack`.
+ *
+ * @api public
+ */
+
+exports.ACK = 3;
+
+/**
+ * Packet type `error`.
+ *
+ * @api public
+ */
+
+exports.ERROR = 4;
+
+/**
+ * Packet type 'binary event'
+ *
+ * @api public
+ */
+
+exports.BINARY_EVENT = 5;
+
+/**
+ * Packet type `binary ack`. For acks with binary arguments.
+ *
+ * @api public
+ */
+
+exports.BINARY_ACK = 6;
+
+/**
+ * Encoder constructor.
+ *
+ * @api public
+ */
+
+exports.Encoder = Encoder;
+
+/**
+ * Decoder constructor.
+ *
+ * @api public
+ */
+
+exports.Decoder = Decoder;
+
+/**
+ * A socket.io Encoder instance
+ *
+ * @api public
+ */
+
+function Encoder() {}
+
+/**
+ * Encode a packet as a single string if non-binary, or as a
+ * buffer sequence, depending on packet type.
+ *
+ * @param {Object} obj - packet object
+ * @param {Function} callback - function to handle encodings (likely engine.write)
+ * @return Calls callback with Array of encodings
+ * @api public
+ */
+
+Encoder.prototype.encode = function(obj, callback){
+ if ((obj.type === exports.EVENT || obj.type === exports.ACK) && hasBin(obj.data)) {
+ obj.type = obj.type === exports.EVENT ? exports.BINARY_EVENT : exports.BINARY_ACK;
+ }
+
+ debug('encoding packet %j', obj);
+
+ if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
+ encodeAsBinary(obj, callback);
+ }
+ else {
+ var encoding = encodeAsString(obj);
+ callback([encoding]);
+ }
+};
+
+/**
+ * Encode packet as string.
+ *
+ * @param {Object} packet
+ * @return {String} encoded
+ * @api private
+ */
+
+function encodeAsString(obj) {
+
+ // first is type
+ var str = '' + obj.type;
+
+ // attachments if we have them
+ if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
+ str += obj.attachments + '-';
+ }
+
+ // if we have a namespace other than `/`
+ // we append it followed by a comma `,`
+ if (obj.nsp && '/' !== obj.nsp) {
+ str += obj.nsp + ',';
+ }
+
+ // immediately followed by the id
+ if (null != obj.id) {
+ str += obj.id;
+ }
+
+ // json data
+ if (null != obj.data) {
+ str += JSON.stringify(obj.data);
+ }
+
+ debug('encoded %j as %s', obj, str);
+ return str;
+}
+
+/**
+ * Encode packet as 'buffer sequence' by removing blobs, and
+ * deconstructing packet into object with placeholders and
+ * a list of buffers.
+ *
+ * @param {Object} packet
+ * @return {Buffer} encoded
+ * @api private
+ */
+
+function encodeAsBinary(obj, callback) {
+
+ function writeEncoding(bloblessData) {
+ var deconstruction = binary.deconstructPacket(bloblessData);
+ var pack = encodeAsString(deconstruction.packet);
+ var buffers = deconstruction.buffers;
+
+ buffers.unshift(pack); // add packet info to beginning of data list
+ callback(buffers); // write all the buffers
+ }
+
+ binary.removeBlobs(obj, writeEncoding);
+}
+
+/**
+ * A socket.io Decoder instance
+ *
+ * @return {Object} decoder
+ * @api public
+ */
+
+function Decoder() {
+ this.reconstructor = null;
+}
+
+/**
+ * Mix in `Emitter` with Decoder.
+ */
+
+Emitter(Decoder.prototype);
+
+/**
+ * Decodes an ecoded packet string into packet JSON.
+ *
+ * @param {String} obj - encoded packet
+ * @return {Object} packet
+ * @api public
+ */
+
+Decoder.prototype.add = function(obj) {
+ var packet;
+ if (typeof obj === 'string') {
+ packet = decodeString(obj);
+ if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json
+ this.reconstructor = new BinaryReconstructor(packet);
+
+ // no attachments, labeled binary but no binary data to follow
+ if (this.reconstructor.reconPack.attachments === 0) {
+ this.emit('decoded', packet);
+ }
+ } else { // non-binary full packet
+ this.emit('decoded', packet);
+ }
+ }
+ else if (isBuf(obj) || obj.base64) { // raw binary data
+ if (!this.reconstructor) {
+ throw new Error('got binary data when not reconstructing a packet');
+ } else {
+ packet = this.reconstructor.takeBinaryData(obj);
+ if (packet) { // received final buffer
+ this.reconstructor = null;
+ this.emit('decoded', packet);
+ }
+ }
+ }
+ else {
+ throw new Error('Unknown type: ' + obj);
+ }
+};
+
+/**
+ * Decode a packet String (JSON data)
+ *
+ * @param {String} str
+ * @return {Object} packet
+ * @api private
+ */
+
+function decodeString(str) {
+ var i = 0;
+ // look up type
+ var p = {
+ type: Number(str.charAt(0))
+ };
+
+ if (null == exports.types[p.type]) return error();
+
+ // look up attachments if type binary
+ if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {
+ var buf = '';
+ while (str.charAt(++i) !== '-') {
+ buf += str.charAt(i);
+ if (i == str.length) break;
+ }
+ if (buf != Number(buf) || str.charAt(i) !== '-') {
+ throw new Error('Illegal attachments');
+ }
+ p.attachments = Number(buf);
+ }
+
+ // look up namespace (if any)
+ if ('/' === str.charAt(i + 1)) {
+ p.nsp = '';
+ while (++i) {
+ var c = str.charAt(i);
+ if (',' === c) break;
+ p.nsp += c;
+ if (i === str.length) break;
+ }
+ } else {
+ p.nsp = '/';
+ }
+
+ // look up id
+ var next = str.charAt(i + 1);
+ if ('' !== next && Number(next) == next) {
+ p.id = '';
+ while (++i) {
+ var c = str.charAt(i);
+ if (null == c || Number(c) != c) {
+ --i;
+ break;
+ }
+ p.id += str.charAt(i);
+ if (i === str.length) break;
+ }
+ p.id = Number(p.id);
+ }
+
+ // look up json data
+ if (str.charAt(++i)) {
+ p = tryParse(p, str.substr(i));
+ }
+
+ debug('decoded %s as %j', str, p);
+ return p;
+}
+
+function tryParse(p, str) {
+ try {
+ p.data = JSON.parse(str);
+ } catch(e){
+ return error();
+ }
+ return p;
+}
+
+/**
+ * Deallocates a parser's resources
+ *
+ * @api public
+ */
+
+Decoder.prototype.destroy = function() {
+ if (this.reconstructor) {
+ this.reconstructor.finishedReconstruction();
+ }
+};
+
+/**
+ * A manager of a binary event's 'buffer sequence'. Should
+ * be constructed whenever a packet of type BINARY_EVENT is
+ * decoded.
+ *
+ * @param {Object} packet
+ * @return {BinaryReconstructor} initialized reconstructor
+ * @api private
+ */
+
+function BinaryReconstructor(packet) {
+ this.reconPack = packet;
+ this.buffers = [];
+}
+
+/**
+ * Method to be called when binary data received from connection
+ * after a BINARY_EVENT packet.
+ *
+ * @param {Buffer | ArrayBuffer} binData - the raw binary data received
+ * @return {null | Object} returns null if more binary data is expected or
+ * a reconstructed packet object if all buffers have been received.
+ * @api private
+ */
+
+BinaryReconstructor.prototype.takeBinaryData = function(binData) {
+ this.buffers.push(binData);
+ if (this.buffers.length === this.reconPack.attachments) { // done with buffer list
+ var packet = binary.reconstructPacket(this.reconPack, this.buffers);
+ this.finishedReconstruction();
+ return packet;
+ }
+ return null;
+};
+
+/**
+ * Cleans up binary packet reconstruction variables.
+ *
+ * @api private
+ */
+
+BinaryReconstructor.prototype.finishedReconstruction = function() {
+ this.reconPack = null;
+ this.buffers = [];
+};
+
+function error() {
+ return {
+ type: exports.ERROR,
+ data: 'parser error'
+ };
+}
diff --git a/node_modules/socket.io-parser/is-buffer.js b/node_modules/socket.io-parser/is-buffer.js
new file mode 100644
index 0000000..977df88
--- /dev/null
+++ b/node_modules/socket.io-parser/is-buffer.js
@@ -0,0 +1,13 @@
+
+module.exports = isBuf;
+
+/**
+ * Returns true if obj is a buffer or an arraybuffer.
+ *
+ * @api private
+ */
+
+function isBuf(obj) {
+ return (global.Buffer && global.Buffer.isBuffer(obj)) ||
+ (global.ArrayBuffer && obj instanceof ArrayBuffer);
+}
diff --git a/node_modules/socket.io-parser/package.json b/node_modules/socket.io-parser/package.json
new file mode 100644
index 0000000..8dd76d7
--- /dev/null
+++ b/node_modules/socket.io-parser/package.json
@@ -0,0 +1,101 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "socket.io-parser@~3.1.1",
+ "scope": null,
+ "escapedName": "socket.io-parser",
+ "name": "socket.io-parser",
+ "rawSpec": "~3.1.1",
+ "spec": ">=3.1.1 <3.2.0",
+ "type": "range"
+ },
+ "/mnt/e/Yaroslav/Documents/Webs/nodejs/checkers/node_modules/socket.io"
+ ]
+ ],
+ "_from": "socket.io-parser@>=3.1.1 <3.2.0",
+ "_id": "socket.io-parser@3.1.2",
+ "_inCache": true,
+ "_location": "/socket.io-parser",
+ "_nodeVersion": "6.9.4",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/socket.io-parser-3.1.2.tgz_1493329580053_0.09636084409430623"
+ },
+ "_npmUser": {
+ "name": "darrachequesne",
+ "email": "damien.arrachequesne@gmail.com"
+ },
+ "_npmVersion": "3.10.10",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "socket.io-parser@~3.1.1",
+ "scope": null,
+ "escapedName": "socket.io-parser",
+ "name": "socket.io-parser",
+ "rawSpec": "~3.1.1",
+ "spec": ">=3.1.1 <3.2.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/socket.io",
+ "/socket.io-client"
+ ],
+ "_resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.2.tgz",
+ "_shasum": "dbc2282151fc4faebbe40aeedc0772eba619f7f2",
+ "_shrinkwrap": null,
+ "_spec": "socket.io-parser@~3.1.1",
+ "_where": "/mnt/e/Yaroslav/Documents/Webs/nodejs/checkers/node_modules/socket.io",
+ "bugs": {
+ "url": "https://github.com/Automattic/socket.io-parser/issues"
+ },
+ "dependencies": {
+ "component-emitter": "1.2.1",
+ "debug": "~2.6.4",
+ "has-binary2": "~1.0.2",
+ "isarray": "2.0.1"
+ },
+ "description": "socket.io protocol parser",
+ "devDependencies": {
+ "benchmark": "2.1.2",
+ "expect.js": "0.3.1",
+ "mocha": "3.2.0",
+ "socket.io-browsers": "^1.0.0",
+ "zuul": "3.11.1",
+ "zuul-ngrok": "4.0.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "dbc2282151fc4faebbe40aeedc0772eba619f7f2",
+ "tarball": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.2.tgz"
+ },
+ "files": [
+ "binary.js",
+ "index.js",
+ "is-buffer.js"
+ ],
+ "gitHead": "f9c3549dd17df095b0806086df3f4834ddc98d45",
+ "homepage": "https://github.com/Automattic/socket.io-parser#readme",
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "darrachequesne",
+ "email": "damien.arrachequesne@gmail.com"
+ },
+ {
+ "name": "rauchg",
+ "email": "rauchg@gmail.com"
+ }
+ ],
+ "name": "socket.io-parser",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/Automattic/socket.io-parser.git"
+ },
+ "scripts": {
+ "test": "make test"
+ },
+ "version": "3.1.2"
+}