@codewell/is-defined

3.0.1 • Public • Published

@codewell/is-defined

Intallation

npm install @codewell/is-defined

Basic usage

import { isDefined } from '@codewell/is-defined';

isDefined(undefined);     // false
isDefined(null);          // false
isDefined(NaN);           // false

isDefined(1);             // true
isDefined("foo");         // true
isDefined(() => {});      // true
isDefined([]);            // true
isDefined({});            // true

isDefined(1, "foo", [])   // => true
isDefined(1, "foo", null) // => false

isDefined()               // Throws error

Readme

Keywords

none

Package Sidebar

Install

npm i @codewell/is-defined

Weekly Downloads

10

Version

3.0.1

License

MIT

Unpacked Size

2.68 kB

Total Files

5

Last publish

Collaborators

  • fippli