Rename to inRange and reuse the Math module

This commit is contained in:
glhrmv 2017-09-23 16:19:02 +01:00
parent ea63fb743a
commit 20bc7331ad
2 changed files with 3 additions and 3 deletions

View file

@ -148,6 +148,6 @@ const typedArrayTypes = new Set([
]);
is.typedArray = x => typedArrayTypes.has(getObjectType(x));
is.withinRange = (x, [min, max]) => x >= min && x <= max;
is.inRange = (x, arr) => is.array(arr) && (x >= Math.min.apply(Math, arr)) && (x <= Math.max.apply(Math, arr));
module.exports = is;