From c523b958dc43ebb459d1cbbdf46de86e2eced251 Mon Sep 17 00:00:00 2001 From: Kodie Grantham Date: Fri, 6 Oct 2017 14:17:13 -0500 Subject: [PATCH] Fix Node v4 support for any() and all() methods --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6d265b2..9c1c082 100644 --- a/index.js +++ b/index.js @@ -169,8 +169,9 @@ const isEmptyMapOrSet = x => (is.map(x) || is.set(x)) && x.size === 0; is.empty = x => !x || isEmptyStringOrArray(x) || isEmptyObject(x) || isEmptyMapOrSet(x); -is.any = (predicate, ...values) => { +is.any = function (predicate, values) { let ret = false; + values = Array.prototype.slice.call(arguments, 1); values.forEach(value => { if (predicate(value)) { @@ -181,8 +182,9 @@ is.any = (predicate, ...values) => { return ret; }; -is.all = (predicate, ...values) => { +is.all = function (predicate, values) { let ret = true; + values = Array.prototype.slice.call(arguments, 1); values.forEach(value => { if (!predicate(value)) {