@stackline/is-empty
Check whether a value is "empty".
Documentation | npm | Issues | Repository
Current package version: 1.0.2
Why this package?
@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.
Compatibility
| 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 |
Installation
npm install @stackline/is-empty
Preserve existing imports and plugin resolution with an npm alias:
npm install is-empty@npm:@stackline/is-empty
Usage and API reference
is-empty
Check whether a value is empty.
Installation
$ npm install @stackline/is-empty
$ npm test
Example
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'))// false
API
isEmpty(value)
Check whether value is empty.
License
MIT
Credits and original authors
- 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.
Community and Links
Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.