init
This commit is contained in:
31
node_modules/ramda/es/objOf.js
generated
vendored
Normal file
31
node_modules/ramda/es/objOf.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
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 =
|
||||
/*#__PURE__*/
|
||||
_curry2(function objOf(key, val) {
|
||||
var obj = {};
|
||||
obj[key] = val;
|
||||
return obj;
|
||||
});
|
||||
|
||||
export default objOf;
|
Reference in New Issue
Block a user