JSPM

is-obj-empty

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q25144F
  • License MIT

Check if an object is empty

Package Exports

  • is-obj-empty

Readme

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