From cf3f40c956c2024d3976787dc8fa30970ccf9a9d Mon Sep 17 00:00:00 2001 From: Lucas Vallenet Date: Thu, 2 Jun 2022 16:45:31 +0200 Subject: [PATCH] Update functions comments --- assets/scripts/utils/is.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/assets/scripts/utils/is.js b/assets/scripts/utils/is.js index 1c85102..154d6a6 100644 --- a/assets/scripts/utils/is.js +++ b/assets/scripts/utils/is.js @@ -1,16 +1,19 @@ /** - * Check if argument is an object - * @param {?object} x - elemet to check - * @return {boolean} true if element is an object + * Determines if the argument is object-like. + * + * A value is object-like if it's not `null` and has a `typeof` result of "object". + * + * @param {*} x - The value to be checked. + * @return {boolean} */ const isObject = x => (x && typeof x === 'object') - /** - * Check if argument is function - * @param {?function} x - element to check - * @return {boolean} true if element is a function + * Determines if the argument is a function. + * + * @param {*} x - The value to be checked. + * @return {boolean} */ const isFunction = x => x instanceof Function