is-obj-empty
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

is-obj-empty

NPM TypeScript

Check if an object is empty.

If I should maintain this repo, please ⭐️ GitHub stars

DM me on Twitter if you have questions or suggestions. Twitter


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

Dev Dependencies

  • autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.

License license

MIT

Dependents (1)

Package Sidebar

Install

npm i is-obj-empty

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

4.06 kB

Total Files

8

Last publish

Collaborators

  • bconnorwhite