@aicore/libcommonutils
Advanced tools
Comparing version 1.0.10 to 1.0.11
{ | ||
"name": "@aicore/libcommonutils", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"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,3 +39,3 @@ /* | ||
export {isNumber, isString, isObject, isBoolean} from './utils/common.js'; | ||
export {getMySqlConfigs} from './utils/configs.js'; | ||
export {isNumber, isString, isObject, isBoolean, isObjectEmpty} from './utils/common.js'; | ||
export {getMySqlConfigs} from './utils/configs.js'; |
@@ -61,1 +61,19 @@ // @INCLUDE_IN_API_DOCS | ||
} | ||
/** This is a description of the isObjectEmpty function. | ||
* This function checks if object is Empty or not | ||
* @param {Object} obj - Take any Object | ||
* @throw if not valid object | ||
* @return {boolean} - true if Object is empty false otherwise | ||
* */ | ||
export function isObjectEmpty(obj) { | ||
if (!isObject(obj)) { | ||
throw new Error('Not a valid Object'); | ||
} | ||
//https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object | ||
// noinspection LoopStatementThatDoesntLoopJS | ||
for (let i in obj) { //NOSONAR | ||
return false; | ||
} | ||
return true; | ||
} |
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
49892
127