You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the is.array changes to include an additional type check, the is.array function can no longer be used within a is.all. The behavior can also be misleading at first because it works when there is only one element being checked. It may be difficult to debug when used with the spread operator.
and have it work like it used to, with the added benefit of using it with the new type check when needed
is.all(v=>is.array(v,is.string), ...test2)
However, I think the array method could check for if (is.function_(assertion)) instead of just if (assertion), this way it would not try to call the index number as a function (which Array.prototype.every sets as the second argument on its callback).
The text was updated successfully, but these errors were encountered:
GuillaumeRochat
changed the title
is.all(is.array, arr1, arr2) tries to use arr2 as a function
is.all(is.array, arr1, arr2) tries to use index 1 as a function
Aug 18, 2020
With the
is.array
changes to include an additional type check, theis.array
function can no longer be used within ais.all
. The behavior can also be misleading at first because it works when there is only one element being checked. It may be difficult to debug when used with the spread operator.E.g.:
I can easily change the syntax to
and have it work like it used to, with the added benefit of using it with the new type check when needed
However, I think the
array
method could check forif (is.function_(assertion))
instead of justif (assertion)
, this way it would not try to call the index number as a function (which Array.prototype.every sets as the second argument on its callback).The text was updated successfully, but these errors were encountered: