JSPM

isnullorempty

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 84
  • Score
    100M100P100Q63764F
  • License WTFPL

Check if a given object is null or empty

Package Exports

  • isnullorempty

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 (isnullorempty) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

isnullorempty

npm-version

A simple module that lets you check if a given object is null or empty

Usage

Firstly, you have to install the module

npm i isnullorempty --save

And then you can import the module and start working

const isNullOrEmpty = require("isnullorempty");

if(isNullOrEmpty(null)) {
    //...
}

Or you can work with some more specific functions

const inoe = require("isnullorempty");

if(inoe.isNull(value)) {
    // Returns true for null
}

if(inoe.isEmpty(value)) {
    // BUGGED: Returns true for null, undefined, [], {} or ""
}

if(inoe.isUndefined(value)) {
    // Returns true for undefined
}

if(inoe.isNullOrEmpty(value)) {
    // Same as the "basic" one
    // Returns true for null, undefined, [], {} or ""
}

if(inoe.isNullOrUndefined(value)) {
    // Returns true for null or undefined
}

License

WTFPL