Use array destructuring for argument parsing

This commit is contained in:
glhrmv 2017-09-22 23:43:17 +01:00
parent e209990682
commit ea63fb743a

View file

@ -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;