This repository has been archived on 2025-10-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
vikunja-frontend/src/helpers/objectIsEmpty.ts
2022-10-04 13:45:16 +02:00

6 lines
No EOL
221 B
TypeScript

// https://stackoverflow.com/a/32108184/10924593
export function objectIsEmpty(obj: Record<string, unknown>): boolean {
return obj
&& Object.keys(obj).length === 0
&& Object.getPrototypeOf(obj) === Object.prototype
}