From de0402bebfb14fa72a10aa5eef8900aeaacecec8 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Thu, 17 Nov 2022 12:23:26 +1100 Subject: [PATCH] fix: simplify logic for isFunction assertion method --- src/js/utils/is.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/utils/is.js b/src/js/utils/is.js index 38317e3f..175ecb96 100644 --- a/src/js/utils/is.js +++ b/src/js/utils/is.js @@ -9,7 +9,7 @@ const isObject = (input) => getConstructor(input) === Object; const isNumber = (input) => getConstructor(input) === Number && !Number.isNaN(input); const isString = (input) => getConstructor(input) === String; const isBoolean = (input) => getConstructor(input) === Boolean; -const isFunction = (input) => getConstructor(input) === Function; +const isFunction = (input) => typeof input === 'function'; const isArray = (input) => Array.isArray(input); const isWeakMap = (input) => instanceOf(input, WeakMap); const isNodeList = (input) => instanceOf(input, NodeList);