From 1a27ad22a7377c5b62466ce02b64396e82061842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Sun, 13 Nov 2016 13:47:31 +0100 Subject: [PATCH] Use native Array.isArray when available. --- lib/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 523cde013..8a1c09404 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -204,7 +204,8 @@ module.exports.isFunction = function(value) { * @return {boolean} True if it is an array. */ module.exports.isArray = function(value) { - return Boolean(value && value.constructor === Array); + return Array.isArray ? Array.isArray(value) : + Boolean(value && value.constructor === Array); }; /**