UNPKG

crocks

Version:

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

19 lines (13 loc) 466 B
/** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var curry = require('../core/curry') var isString = require('../core/isString') // objOf : String -> a -> Object function objOf(key, value) { var obj; if(!(key && isString(key))) { throw new TypeError('objOf: Non-empty String required for first argument') } return ( obj = {}, obj[key] = value, obj ) } module.exports = curry(objOf)