main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
703 bytes
|
Line | |
---|
1 | var _curry2 =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./internal/_curry2.js");
|
---|
4 | /**
|
---|
5 | * Creates an object containing a single key:value pair.
|
---|
6 | *
|
---|
7 | * @func
|
---|
8 | * @memberOf R
|
---|
9 | * @since v0.18.0
|
---|
10 | * @category Object
|
---|
11 | * @sig String -> a -> {String:a}
|
---|
12 | * @param {String} key
|
---|
13 | * @param {*} val
|
---|
14 | * @return {Object}
|
---|
15 | * @see R.pair
|
---|
16 | * @example
|
---|
17 | *
|
---|
18 | * const matchPhrases = R.compose(
|
---|
19 | * R.objOf('must'),
|
---|
20 | * R.map(R.objOf('match_phrase'))
|
---|
21 | * );
|
---|
22 | * matchPhrases(['foo', 'bar', 'baz']); //=> {must: [{match_phrase: 'foo'}, {match_phrase: 'bar'}, {match_phrase: 'baz'}]}
|
---|
23 | */
|
---|
24 |
|
---|
25 |
|
---|
26 | var objOf =
|
---|
27 | /*#__PURE__*/
|
---|
28 | _curry2(function objOf(key, val) {
|
---|
29 | var obj = {};
|
---|
30 | obj[key] = val;
|
---|
31 | return obj;
|
---|
32 | });
|
---|
33 |
|
---|
34 | module.exports = objOf; |
---|
Note:
See
TracBrowser
for help on using the repository browser.