Skip to content
5 functions to check if an object is empty or nah
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
README.md
package.json
tsconfig.json
yarn.lock

README.md

is-empty-object-all-methods

5 functions to test if an object is empty or nah

Usage

import isEmpty from "is-empty-object-all-methods"

console.log(isEmpty.useEntries({}))
//=> true

Or, use a named import

import {useEntries} from "is-empty-object-all-methods"

console.log(useEntries({}))
//=> true

API

useEntries()

relies on Object.entries()

useEntriesWOC()

same as useEntries() but doesn't check for Object

useKeys()

relies on Object.keys()

useKeysWOC()

same as useKeys() but doesn't check for Object

useForIn()

relies on for .. in loop

You can’t perform that action at this time.