JSPM

deep-null-check

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q35877F
  • License ISC

This library is to check for null and undefined values in JSON objects

Package Exports

  • deep-null-check

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

Readme

Deep null check

npm version

Checking JavaScript objects for null and undefined values for nested structure. It will return boolean values as an result for null/undefined check.

This module was created basically keeping JSON object in mind. The module is light-weight and dependency free.

Prerequisites

No prerequisites needed for this package. It is dependency free npm library

Installation

npm install --save deep-null-check

Usage:

To check null/undefined values on an object:

> var nullCheck = require('deep-null-check');
> var obj = {
...   name: 'value',
...   age: 1,
...   Address: {
...   city : null
...   },
...   isUndefined: undefined
... }
> console.log(nullCheck.deepNullCheck(obj));
Output : false

API

deepNullCheck(obj)

It return boolean value depends on null/undefined values in obj

true : IF no null/undefined exist

false : IF null/undefined exist

Arguments

obj

Object - The object refers to the JSON object.

Requirements

No additional requirements needed for this library

Authors

  • Piyush Salunke - Initial work

Acknowledgments

  • Inspiration
  • Keep learning and keep contributing