1.3.0 ā€¢ Published 4 years ago

nvl v1.3.0

Weekly downloads
29
License
MIT
Repository
github
Last release
4 years ago

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