Files
medusa-store/packages/admin-ui/ui/src/utils/is-nullish-object.ts
2023-03-03 10:09:16 +01:00

15 lines
305 B
TypeScript

/**
* Utility function that checks if every object property is nullish.
*/
const isNullishObject = (obj?: Object | null) => {
if (!obj) {
return true
}
return Object.values(obj).every(
(value) => value === null || value === undefined || value === ""
)
}
export default isNullishObject