JSPM

jsmicro-is-empty

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q31445F
  • License MIT

Check does the given Javascript Object is empty.

Package Exports

  • jsmicro-is-empty

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsmicro-is-empty) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

JSMicro - Is Empty

isEmpty(object)

Check does the given Javascript Object (array, object, string, etc) is empty.

isNotEmpty(object)

Check does the given Javascript Empty (array, object, string, etc) is not empty.

Browser Usage

bower install --save jsmicro-is-empty
<script type="text/javascript" src="bower_components/jsmicro-is-empty/index.js">
<script type="text/javascript">
    var obj = {};
    var nbr = [1];

    // Available in the window object.
    isEmpty(obj);      // true
    isEmpty(nbr);      // false
    isNotEmpty(nbr);   // true
</script>

NodeJS Usage

npm install --save jsmicro-is-empty
const obj = require('jsmicro-is-empty');

// Available in the global object.
isEmpty([]); // true
isEmpty({a: 1}); // false
isNotEmpty('a'); // true

// Also available in the export object.
obj.isEmpty([]); // true
obj.isEmpty('a'); // false
obj.isNotEmpty([1]); // true

Changelogs

v1.0.1 - May 21, 2016

  • Added .npmignore

v1.0.0 - May 21, 2016

  • Initial release.

The MIT License (MIT)