This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/helpers/objectIsEmpty.ts
kolaente ff48178051
Some checks failed
continuous-integration/drone/push Build is failing
fix: general user settings empty when loading the settings page
Resolves #2183
2022-07-21 16:11:45 +02:00

6 lines
201 B
TypeScript

// https://stackoverflow.com/a/32108184/10924593
export function objectIsEmpty(obj: any): boolean {
return obj
&& Object.keys(obj).length === 0
&& Object.getPrototypeOf(obj) === Object.prototype
}