existential-default

Check for the existential value of a variable. Assign value by default.

MIT 11 个版本
安装
npm install existential-default
yarn add existential-default
pnpm add existential-default
bun add existential-default
README

existential-default

Last version Build Status Dependency status Dev Dependencies Status NPM Status Donate

Check for the existential value of a variable. Assign value by default.

This module have the same behavior than existential-assign where the unique change is the order of the parameters to be more natural and not align with Object.assign interface.

Install

npm install existential-default

If you want to use in the browser (powered by Browserify):

bower install existential-default --save

and later link in your HTML:

<script src="bower_components/existential-default/dist/existential-default.js"></script>

Usage

var existsDefault = require('existential-default');
var hello = null;
hello = existsDefault(hello, 'world');
console.log(hello);
// => 'world'

License

MIT © Kiko Beats

版本列表
1.3.1 2016-04-30
1.3.0 2016-04-30
1.2.1 2016-04-27
1.2.0 2016-04-27
1.1.3 2016-03-06
1.1.2 2016-02-16
1.1.1 2016-02-01
1.1.0 2015-12-25
1.0.2 2015-06-22
1.0.1 2015-05-10
1.0.0 2015-03-17