Files
automatisch/packages/web/src/helpers/isEmpty.js
2024-02-29 09:38:32 +00:00

13 lines
369 B
JavaScript

import lodashIsEmpty from 'lodash/isEmpty';
export default function isEmpty(value) {
if (value === undefined && value === null) return true;
if (Array.isArray(value) || typeof value === 'string') {
return value.length === 0;
}
if (!Number.isNaN(value)) {
return false;
}
// covers objects and anything else possibly
return lodashIsEmpty(value);
}