Files

9 lines
333 B
TypeScript
Raw Permalink Normal View History

2024-06-21 09:56:34 +07:00
const isEmpty = (value : any) => {
return (
2024-07-01 14:51:57 +07:00
value == null || // From standard.js: Always use === - but obj == null is allowed to check null || undefined
(typeof value === 'object' && Object.keys(value).length === 0) ||
(typeof value === 'string' && value.trim().length === 0)
2024-06-21 09:56:34 +07:00
)
}
export { isEmpty }