swc/crates/swc_bundler/tests/.cache/deno/10c5d90b3aecacee0f0511e8ea317f3174d065ce.ts
2021-11-09 20:42:49 +09:00

33 lines
737 B
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/objOf.js
import _curry2 from './internal/_curry2.js';
/**
* Creates an object containing a single key:value pair.
*
* @func
* @memberOf R
* @since v0.18.0
* @category Object
* @sig String -> a -> {String:a}
* @param {String} key
* @param {*} val
* @return {Object}
* @see R.pair
* @example
*
* const matchPhrases = R.compose(
* R.objOf('must'),
* R.map(R.objOf('match_phrase'))
* );
* matchPhrases(['foo', 'bar', 'baz']); //=> {must: [{match_phrase: 'foo'}, {match_phrase: 'bar'}, {match_phrase: 'baz'}]}
*/
var objOf = _curry2(function objOf(key, val) {
var obj = {};
obj[key] = val;
return obj;
});
export default objOf;