From f7ee647e335860452629566607a9b4391e6fc986 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 12 Sep 2014 11:28:43 +0100 Subject: [PATCH] use is-array --- index.js | 7 +------ package.json | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 158bf8c..aaa2e42 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ var base64 = require('base64-js') var ieee754 = require('ieee754') +var isArray = require('is-array') exports.Buffer = Buffer exports.SlowBuffer = Buffer @@ -971,12 +972,6 @@ function stringtrim (str) { return str.replace(/^\s+|\s+$/g, '') } -function isArray (subject) { - return (Array.isArray || function (subject) { - return Object.prototype.toString.call(subject) === '[object Array]' - })(subject) -} - function isArrayish (subject) { return isArray(subject) || Buffer.isBuffer(subject) || subject && typeof subject === 'object' && diff --git a/package.json b/package.json index 5048707..ffb94ef 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ ], "dependencies": { "base64-js": "0.0.7", - "ieee754": "^1.1.4" + "ieee754": "^1.1.4", + "is-array": "^1.0.1" }, "devDependencies": { "benchmark": "^1.0.0", -- 2.34.1