@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
29 lines • 562 B
JavaScript
/**
* @module Utilities
*/
/**
* @internal
*/
export function objectSize(object) {
let size = 0;
for (const key in object) {
if (object[key] === undefined) {
continue;
}
size++;
}
return size;
}
/**
* @internal
*/
export function isObjectEmpty(object) {
return objectSize(object) === 0;
}
/**
* @internal
*/
export function removeUndefinedProperties(object) {
return Object.fromEntries(Object.entries(object).filter(([_key, value]) => value !== undefined));
}
//# sourceMappingURL=object.js.map