cond
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitignore
.jshintrc
.travis.yml
CONTRIBUTING.markdown
LICENSE
README.markdown
gulpfile.js
index.es6
index.js
package.json
test.es6
test.js

README.markdown

fj-cond

Build Status npm version

Call the first function whichs condition is true.

Installation

npm install fj-cond --save

Usage

var cond = require('fj-cond');

let eq = (x) => (y) => x === y;

cond([
    [eq(1), assert.fail],
    [eq(2), assert.fail],
    [eq(3), (x) => console.log(x)],
    [T, assert.fail]
])(3));