@aicore/libcommonutils
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "@aicore/libcommonutils", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Common util libraries used by various modules. This library is created to prevent code duplication", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -39,2 +39,2 @@ /* | ||
export {isNumber, isString} from './utils/common.js'; | ||
export {isNumber, isString, isObject, isBoolean} from './utils/common.js'; |
@@ -0,1 +1,2 @@ | ||
// @INCLUDE_IN_API_DOCS | ||
/** This is a description of the isString function. | ||
@@ -25,1 +26,36 @@ * This function checks if object is sting or not | ||
} | ||
/** This is a description of the isObject function. | ||
* This function checks if object is valid JS Object or not | ||
* @param {Object} object - Take any Object | ||
* @return {boolean} - true if it is an Object false otherwise | ||
* */ | ||
export function isObject(object) { | ||
if (object == null) { | ||
return false; | ||
} | ||
if (isString(object)) { | ||
return false; | ||
} | ||
if (isBoolean(object)) { | ||
return false; | ||
} | ||
if (isNumber(object)) { | ||
return false; | ||
} | ||
return typeof object === 'object'; | ||
} | ||
/** This is a description of the isBoolean function. | ||
* This function checks if object is valid boolean Object or not | ||
* @param {Object} boolean - Take any Object | ||
* @return {boolean} - true if it is a valid boolean false otherwise | ||
* */ | ||
export function isBoolean(boolean) { | ||
if (boolean == null) { | ||
return false; | ||
} | ||
return (typeof boolean === 'boolean' || boolean instanceof Boolean); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48544
90