@wuapi/essential
Version:
Essential definition of WU-API
23 lines (22 loc) • 511 B
JavaScript
/**
* Check if objects are null or undefined
* @param args Objects to check
* @returns true if ALL objects are neither null, nor undefined.
*/
export function notNU(...args) {
for (let i in args) {
if (args[i] == null || args[i] == undefined)
return false;
}
return true;
}
/**
* Convenient function to go through objects.
* @param o The object
* @param cb The callback function
*/
export function forIn(o, cb) {
for (let key in o) {
cb(o[key], key);
}
}