Fix Node v4 support for any() and all() methods
This commit is contained in:
parent
23b1e225b4
commit
c523b958dc
1 changed files with 4 additions and 2 deletions
6
index.js
6
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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue