prc b6c02717e6 Upload complete no-internet building environment. il y a 1 an
..
.idea b6c02717e6 Upload complete no-internet building environment. il y a 1 an
specs b6c02717e6 Upload complete no-internet building environment. il y a 1 an
.npmignore b6c02717e6 Upload complete no-internet building environment. il y a 1 an
LICENSE b6c02717e6 Upload complete no-internet building environment. il y a 1 an
README.md b6c02717e6 Upload complete no-internet building environment. il y a 1 an
index.js b6c02717e6 Upload complete no-internet building environment. il y a 1 an
package.json b6c02717e6 Upload complete no-internet building environment. il y a 1 an

README.md

NPM Version Build Status

coalescy

Simple function that return the first non null or undefined argument passed to it

Install

npm i --save coalescy

Usage

coalescy simply return the first non nully of the passed elements. Null if all the values are null

it works the same as

a || b

but it works on falsie values too

Example

var clsc = require('coalescy');
var obj = clsc(null, []); // obj = [];
obj = clsc(null, {}); // obj = {};
obj = clsc(null, [], {}); // obj = []; // the first non null
obj = clsc(null, undefined, 0, []) // 0