Deep check if an identifier is defined and not null
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
scripts
src
.babelrc
.editorconfig
.eslintrc
.gitignore
.npmignore
CONTRIBUTING.md
LICENSE
README.md
index.js
package.json

README.md

Its Set

Deep check if an identifier is defined and not null

npm install its-set

Examples

import itsSet from 'its-set';

itsSet('im set'); // true
itsSet(false); // true
itsSet(33); // true
itsSet({ foo: { bar: { baz: 'im set' } } }, 'foo.bar.baz'); // true

itsSet(undefined); // false
itsSet(null); // false
itsSet({ foo: { bar: {} } }, 'foo.bar.baz'); // false
itsSet({ foo: { bar: { baz: null } } }, 'foo.bar.baz'); // false

Or...

const { itsSet } = require('its-set');

itsSet('im set'); // true