is-empty
Check whether a value is "empty".
Last updated 4 years ago by ianstormtaylor .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install is-empty 
SYNC missed versions from official npm registry.

is-empty

Check whether a value is empty.

Installation

$ npm install is-empty
$ npm test

Example

var empty = require('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

Current Tags

  • 1.2.0                                ...           latest (4 years ago)

5 Versions

  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.1                                ...           7 years ago
Downloads
Today 25
This Week 615
This Month 3,801
Last Day 216
Last Week 1,049
Last Month 5,370
Dependencies (0)
None
Dev Dependencies (1)
Dependents (139)

Copyright 2014 - 2017 © taobao.org |