is-obj-empty
v2.0.0
Published
Check if an object is empty
Downloads
7
Maintainers
Readme
If I should maintain this repo, please ⭐️
DM me on Twitter if you have questions or suggestions.
Check if an object is empty.
Installation
yarn add is-obj-empty
npm install is-obj-empty
pnpm add is-obj-empty
Usage
import isEmpty from "is-obj-empty";
isEmpty({}); // true
isEmpty({ a: undefined }); // false
isEmpty({ a: true }); // false
isEmpty([]); // true
isEmpty([undefined]); // false
isEmpty([true]); // false
Additionally, there an option is provided to ignore symbol keys:
isEmpty({ [Symbol()]: true }); // false
isEmpty({ [Symbol()]: true }, { ignoreSymbolKeys: true }); // true
- autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.