Use array destructuring for argument parsing
This commit is contained in:
parent
e209990682
commit
ea63fb743a
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
|
@ -148,6 +148,6 @@ const typedArrayTypes = new Set([
|
|||
]);
|
||||
is.typedArray = x => typedArrayTypes.has(getObjectType(x));
|
||||
|
||||
is.withinRange = (x, arr) => (x > Math.min.apply(Math, arr)) && (x < Math.max.apply(Math, arr));
|
||||
is.withinRange = (x, [min, max]) => x >= min && x <= max;
|
||||
|
||||
module.exports = is;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue