topkat-utils
Version:
A comprehensive collection of TypeScript/JavaScript utility functions for common programming tasks. Includes validation, object manipulation, date handling, string formatting, and more. Zero dependencies, fully typed, and optimized for performance.
13 lines • 476 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEmpty = void 0;
function isEmpty(objOrArr) {
if (Array.isArray(objOrArr) || typeof objOrArr === 'string')
return objOrArr.length === 0;
else if (typeof objOrArr == 'object' && objOrArr !== null && !(objOrArr instanceof Date))
return Object.keys(objOrArr).length === 0;
else
return false;
}
exports.isEmpty = isEmpty;
//# sourceMappingURL=is-empty.js.map