@codewell/is-defined
v3.0.1
Published
Check if values are defined. I mean, why not add more bottom values.
Downloads
34
Readme
@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