Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/julkwel/is-empty

Javascript library for checking if an array, string or int is empty null or 0
https://github.com/julkwel/is-empty

array is-empty javascript javascript-library object string

Last synced: 15 days ago
JSON representation

Javascript library for checking if an array, string or int is empty null or 0

Awesome Lists containing this project

README

        

# @julkwel/is-empty :madagascar:

Testing an array, string or int if is it empty null or 0

## Installation :
`yarn add @julkwel/is-empty` or `npm install @julkwel/is-empty`

## Usage :
```
const isEmpty = require("@julkwel/is-empty");

console.log(isEmpty("0")); // output : true
console.log(isEmpty(" ")); // output : true
console.log(isEmpty(null)); // output : true
console.log(isEmpty(new Map)); // output : true
console.log(isEmpty(new Set)); // output : true

console.log(isEmpty("10")); // output: false
console.log(isEmpty("a")); // output: false
console.log(isEmpty(new Map([1,2]))); // output : false
console.log(isEmpty(new Set([3,1]))); // output : false
```

## Testing :
`npm test` or `yarn test`

Feel free to reach out to me.