UNPKG

@wuapi/essential

Version:
28 lines (27 loc) 660 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.forIn = exports.notNU = void 0; /** * Check if objects are null or undefined * @param args Objects to check * @returns true if ALL objects are neither null, nor undefined. */ function notNU(...args) { for (let i in args) { if (args[i] == null || args[i] == undefined) return false; } return true; } exports.notNU = notNU; /** * Convenient function to go through objects. * @param o The object * @param cb The callback function */ function forIn(o, cb) { for (let key in o) { cb(o[key], key); } } exports.forIn = forIn;