UNPKG

crocks

Version:

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

18 lines (13 loc) 500 B
/** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = require('../core/curry') var isObject = require('../core/isObject') var object = require('../core/object') // defaultProps : Object -> Object -> Object function defaultProps(x, m) { if(!isObject(x) || !isObject(m)) { throw new TypeError('defaultProps: Objects required for both arguments') } return object.assign(m, x) } module.exports = curry(defaultProps)