nvl
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

NVL

license npm npm TSLint Travis

🚮 Replace a blank value with fallback value.

Installation

npm install nvl
# Or Yarn 
yarn add nvl

Usage

const nvl = require('nvl');
 
let notYet = void 0; // undefined
let nil = null;
 
nvl(notYet, true); // -> true
nvl(nil, 1); // -> 1
nvl([], [1]); // -> []
nvl({}, { a: 1, b: 2}); // -> {}
nvl(false, true); // -> false

Readme

Keywords

Package Sidebar

Install

npm i nvl

Weekly Downloads

66

Version

1.3.0

License

MIT

Unpacked Size

4.01 kB

Total Files

5

Last publish

Collaborators

  • illuminator