apphouse
Version:
Component library for React that uses observable state management and theme-able components.
20 lines (17 loc) • 371 B
text/typescript
/**
*
* @param value
* @returns
*/
export function isEmpty(value: any) {
if (value === null || value === undefined) {
return true;
}
if (typeof value === 'string' || Array.isArray(value)) {
return value.length === 0;
}
if (typeof value === 'object') {
return Object.keys(value).length === 0;
}
return false;
}