From ea63fb743a01b7d9e20b276a38f108d0a43ad6cc Mon Sep 17 00:00:00 2001 From: glhrmv Date: Fri, 22 Sep 2017 23:43:17 +0100 Subject: [PATCH] Use array destructuring for argument parsing --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8aa82f2..ee3d6a8 100644 --- a/index.js +++ b/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;