UNPKG

crocks

Version:

A collection of well known Algebraic Datatypes for your utter enjoyment.

14 lines (10 loc) 294 B
/** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isFunction = require('./isFunction') function predOrFunc(pred, x) { if(isFunction(pred)) { return pred(x) } return pred.runWith(x) } module.exports = predOrFunc