Skip to content

Commit

Permalink
[chore] Revert "Remove deprecated isarray dependency" (#50)
Browse files Browse the repository at this point in the history
The fallback is needed for IE6, IE7 and IE8.
  • Loading branch information
darrachequesne authored Oct 24, 2016
1 parent baf384c commit 0e2dcb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Module requirements
*/

var isArray = require('isarray');
var isBuf = require('./is-buffer');

/**
Expand All @@ -27,7 +28,7 @@ exports.deconstructPacket = function(packet){
var placeholder = { _placeholder: true, num: buffers.length };
buffers.push(data);
return placeholder;
} else if (Array.isArray(data)) {
} else if (isArray(data)) {
var newData = new Array(data.length);
for (var i = 0; i < data.length; i++) {
newData[i] = _deconstructPacket(data[i]);
Expand Down Expand Up @@ -65,7 +66,7 @@ exports.reconstructPacket = function(packet, buffers) {
if (data && data._placeholder) {
var buf = buffers[data.num]; // appropriate buffer (should be natural order anyway)
return buf;
} else if (Array.isArray(data)) {
} else if (isArray(data)) {
for (var i = 0; i < data.length; i++) {
data[i] = _reconstructPacket(data[i]);
}
Expand Down Expand Up @@ -120,7 +121,7 @@ exports.removeBlobs = function(data, callback) {
};

fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer
} else if (Array.isArray(obj)) { // handle array
} else if (isArray(obj)) { // handle array
for (var i = 0; i < obj.length; i++) {
_removeBlobs(obj[i], i, obj);
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"dependencies": {
"debug": "2.2.0",
"json3": "3.3.2",
"component-emitter": "1.1.2"
"component-emitter": "1.1.2",
"isarray": "0.0.1"
},
"devDependencies": {
"benchmark": "1.0.0",
Expand Down

0 comments on commit 0e2dcb7

Please sign in to comment.