https://github.com/finnfiddle/its-set
Deep check if an identifier is defined and not null
https://github.com/finnfiddle/its-set
Last synced: over 1 year ago
JSON representation
Deep check if an identifier is defined and not null
- Host: GitHub
- URL: https://github.com/finnfiddle/its-set
- Owner: finnfiddle
- License: mit
- Created: 2016-07-19T21:05:20.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-03T11:54:51.000Z (about 9 years ago)
- Last Synced: 2024-10-11T11:16:58.715Z (over 1 year ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Its Set
Deep check if an identifier is defined and not null
```
npm install its-set
```
## Examples
```javascript
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...
```javascript
const { itsSet } = require('its-set');
itsSet('im set'); // true
```