Check whether a value is "empty".
Documentation | npm | Issues | Repository
Current package version: 1.0.2
@stackline/is-empty is the Stackline-maintained distribution of is-empty@1.2.0. It is an independent continuation of is-empty; original authors and licenses remain credited below.
| Item | Value |
|---|---|
| Package | @stackline/is-empty@1.0.2 |
| API target | is-empty@1.2.0 |
| Supported Node.js | See supported framework requirements |
| License | MIT |
| Main entry | ./lib/index.js |
| Runtime dependencies | none |
npm install @stackline/is-emptyPreserve existing imports and plugin resolution with an npm alias:
npm install is-empty@npm:@stackline/is-emptyCheck whether a value is empty.
$ npm install @stackline/is-empty
$ npm test
var empty = require('@stackline/is-empty');
empty([]); // true
empty({}); // true
empty(''); // true
empty(0); // true
empty(function(){}); // true
empty(null); // true
empty(undefined); // true
empty(new Map()); // true
empty(new Set()); // true
empty(new Error()); // true
empty(true); // false
empty(false); // false
empty(['a', 'b']); // false
empty({ a: 'b' }); // false
empty('string'); // false
empty(42); // false
empty(function(a,b){}); // false
empty(new Map([['key', 'value']])); // false
empty(new Set([1])); // false
empty(new Error('fail'))// falseCheck whether value is empty.
MIT
- Original project: is-empty.
- Stackline maintenance: Alexandro Paixao Marques and Stackline contributors.
Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.
Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.