UNPKG

crocks

Version:

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

13 lines (9 loc) 325 B
/** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = require('../core/curry') var isNil = require('../core/isNil') // defaultTo : a -> b -> (a | b) function defaultTo(def, val) { return isNil(val) ? def : val } module.exports = curry(defaultTo)