Socket
Book a DemoInstallSign in
Socket

fj-ifelse

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fj-ifelse

Functional ifElse

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
2
Created
Source

fj-ifElse

Build Status npm version

Functional ifElse

Installation

npm install fj-ifelse --save

Usage

var ifElse = require('fj-ifelse');

ifElse(
    (x) => x === true,
    (x) => t.ok(x),
    () => t.fail()
)(true);

var ifTrue = ifElse(() => true);

ifTrue(
    () => t.ok(true),
    () => t.fail()
)();

API

ifElse

Checks if a predicate returns true and calls the associated function.

ifElse(predicate, then, otherwise)

Parameters

NameTypeDescription
predicatefunctionFunction that returns true or false
thenfunctionFunction called if predicate is true
otherwisefunctionFunction called if predicate is false

Returns

TypeDescription
functionReturns a function wich passes the values to the predicate

Keywords

fp-dom

FAQs

Package last updated on 04 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts