ramda-adjunct 2.35.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +2 -4
- package/dist/RA.node.js +275 -239
- package/dist/RA.node.min.js +1 -1
- package/dist/RA.web.js +275 -239
- package/dist/RA.web.min.js +1 -1
- package/dist/RA.web.standalone.js +6072 -5528
- package/dist/RA.web.standalone.min.js +1 -1
- package/es/copyKeys.js +2 -2
- package/es/fantasy-land/Identity.js +1 -1
- package/es/flattenPath.js +2 -2
- package/es/included.js +27 -0
- package/es/index.js +8 -12
- package/es/internal/isCoercible.js +6 -0
- package/es/internal/isOfTypeObject.js +1 -1
- package/es/internal/ponyfills/Promise.any.js +8 -4
- package/es/isArrayLike.js +1 -1
- package/es/isBlank.js +32 -0
- package/es/isNotNilOrEmpty.js +1 -1
- package/es/isSymbol.js +1 -1
- package/es/mergePath.js +2 -3
- package/es/omitIndexes.js +2 -2
- package/es/pickIndexes.js +2 -2
- package/es/sortByPaths.js +52 -0
- package/es/spreadPath.js +2 -2
- package/es/toNumber.js +22 -0
- package/es/trimCharsEnd.js +2 -2
- package/es/trimCharsStart.js +2 -2
- package/lib/anyP.js +1 -1
- package/lib/copyKeys.js +2 -2
- package/lib/fantasy-land/Identity.js +2 -2
- package/lib/fantasy-land/mapping.js +1 -1
- package/lib/fantasy-land/traits.js +2 -2
- package/lib/fantasy-land/util.js +1 -1
- package/lib/flattenPath.js +1 -1
- package/lib/included.js +33 -0
- package/lib/index.js +17 -21
- package/lib/internal/ap.js +1 -1
- package/lib/internal/isCoercible.js +18 -0
- package/lib/internal/isOfTypeObject.js +1 -1
- package/lib/internal/ponyfills/Promise.any.js +8 -4
- package/lib/isArrayLike.js +1 -1
- package/lib/isBlank.js +41 -0
- package/lib/isFinite.js +1 -1
- package/lib/isInteger.js +1 -1
- package/lib/isNaN.js +1 -1
- package/lib/isNotNilOrEmpty.js +1 -1
- package/lib/isSafeInteger.js +1 -1
- package/lib/isSymbol.js +1 -1
- package/lib/mergePath.js +1 -5
- package/lib/omitIndexes.js +1 -1
- package/lib/padCharsEnd.js +1 -1
- package/lib/padCharsStart.js +1 -1
- package/lib/pickIndexes.js +1 -1
- package/lib/repeatStr.js +1 -1
- package/lib/replaceAll.js +1 -1
- package/lib/sign.js +1 -1
- package/lib/sortByPaths.js +59 -0
- package/lib/spreadPath.js +1 -1
- package/lib/thenCatchP.js +1 -1
- package/lib/toArray.js +1 -1
- package/lib/toNumber.js +31 -0
- package/lib/trimCharsEnd.js +2 -2
- package/lib/trimCharsStart.js +2 -2
- package/lib/trimEnd.js +1 -1
- package/lib/trimStart.js +1 -1
- package/lib/trunc.js +1 -1
- package/package.json +35 -50
- package/src/flattenPath.js +4 -2
- package/src/included.js +28 -0
- package/src/index.js +6 -10
- package/src/internal/isCoercible.js +12 -0
- package/src/internal/ponyfills/Promise.any.js +1 -1
- package/src/isBlank.js +33 -0
- package/src/isNotNilOrEmpty.js +1 -1
- package/src/mergePath.js +2 -4
- package/src/omitIndexes.js +2 -2
- package/src/pickIndexes.js +2 -2
- package/src/sortByPaths.js +55 -0
- package/src/spreadPath.js +2 -2
- package/src/toNumber.js +24 -0
- package/src/trimCharsEnd.js +2 -2
- package/src/trimCharsStart.js +2 -2
- package/types/index.d.ts +20 -34
- package/es/contained.js +0 -29
- package/es/hasPath.js +0 -38
- package/es/mergeRight.js +0 -26
- package/es/thenP.js +0 -28
- package/lib/contained.js +0 -35
- package/lib/hasPath.js +0 -47
- package/lib/mergeRight.js +0 -32
- package/lib/thenP.js +0 -34
- package/src/contained.js +0 -30
- package/src/hasPath.js +0 -40
- package/src/mergeRight.js +0 -27
- package/src/thenP.js +0 -29
package/es/hasPath.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { length, has, path, head, tail, curryN } from 'ramda';
|
|
2
|
-
import isObj from './isObj';
|
|
3
|
-
/**
|
|
4
|
-
* Returns whether or not an object has an own property with the specified name at a given path.
|
|
5
|
-
*
|
|
6
|
-
* @func hasPath
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.14.0|v1.14.0}
|
|
9
|
-
* @deprecated since v2.12.0; ramda@0.26.0 contains hasPath
|
|
10
|
-
* @category Object
|
|
11
|
-
* @typedef Idx = String | Int
|
|
12
|
-
* @sig [Idx] -> {a} -> Boolean
|
|
13
|
-
* @param {Array.<string|number>} path The path of the nested property
|
|
14
|
-
* @param {Object} obj The object to test
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @see {@link http://ramdajs.com/docs/#has|R.has}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.hasPath(['a', 'b'], { a: { b: 1 } }); //=> true
|
|
20
|
-
* RA.hasPath(['a', 'b', 'c'], { a: { b: 1 } }); //=> false
|
|
21
|
-
* RA.hasPath(['a', 'b'], { a: { } }); //=> false
|
|
22
|
-
* RA.hasPath([0], [1, 2]); //=> true
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
var hasPath = curryN(2, function (objPath, obj) {
|
|
26
|
-
var prop = head(objPath); // termination conditions
|
|
27
|
-
|
|
28
|
-
if (length(objPath) === 0 || !isObj(obj)) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (length(objPath) === 1) {
|
|
33
|
-
return has(prop, obj);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return hasPath(tail(objPath), path([prop], obj)); // base case
|
|
37
|
-
});
|
|
38
|
-
export default hasPath;
|
package/es/mergeRight.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { merge, flip } from 'ramda';
|
|
2
|
-
/**
|
|
3
|
-
* Create a new object with the own properties of the second object merged with
|
|
4
|
-
* the own properties of the first object. If a key exists in both objects,
|
|
5
|
-
* the value from the first object will be used. *
|
|
6
|
-
* Putting it simply: it sets properties only if they don't exist.
|
|
7
|
-
*
|
|
8
|
-
* @func mergeRight
|
|
9
|
-
* @deprecated since v2.12.0; available in ramda@0.26.0 as R.mergeLeft
|
|
10
|
-
* @aliases mergeLeft, resetToDefault
|
|
11
|
-
* @memberOf RA
|
|
12
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.6.0|v1.6.0}
|
|
13
|
-
* @category Object
|
|
14
|
-
* @sig {k: v} -> {k: v} -> {k: v}
|
|
15
|
-
* @param {Object} r Destination
|
|
16
|
-
* @param {Object} l Source
|
|
17
|
-
* @return {Object}
|
|
18
|
-
* @see {@link http://ramdajs.com/docs/#merge|R.merge}, {@link https://github.com/ramda/ramda/wiki/Cookbook#set-properties-only-if-they-dont-exist|Ramda Cookbook}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.mergeRight({ 'age': 40 }, { 'name': 'fred', 'age': 10 });
|
|
22
|
-
* //=> { 'name': 'fred', 'age': 40 }
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
var mergeRight = flip(merge);
|
|
26
|
-
export default mergeRight;
|
package/es/thenP.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { invoker } from 'ramda';
|
|
2
|
-
/**
|
|
3
|
-
* Composable shortcut for `Promise.then`.
|
|
4
|
-
* The thenP function returns a Promise. It takes two arguments: a callback function for the success of the Promise
|
|
5
|
-
* and the promise instance itself.
|
|
6
|
-
*
|
|
7
|
-
* @func thenP
|
|
8
|
-
* @memberOf RA
|
|
9
|
-
* @aliases then
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
|
|
11
|
-
* @deprecated since v2.12.0; available in ramda@0.26.0 as R.then
|
|
12
|
-
* @category Function
|
|
13
|
-
* @sig (a -> Promise b | b) -> Promise b
|
|
14
|
-
* @param {Function} onFulfilled A Function called if the Promise is fulfilled. This function has one argument, the fulfillment value
|
|
15
|
-
* @param {Promise} promise Any Promise or Thenable object
|
|
16
|
-
* @return {Promise} A Promise in the pending status
|
|
17
|
-
|
|
18
|
-
* @see {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}, {@link RA.allP|allP}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* const promise = Promise.resolve(1);
|
|
22
|
-
* const add1 = v => v + 1;
|
|
23
|
-
*
|
|
24
|
-
* RA.thenP(add1, promise); // => Promise(2)
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
var thenP = invoker(1, 'then');
|
|
28
|
-
export default thenP;
|
package/lib/contained.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = void 0;
|
|
5
|
-
|
|
6
|
-
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Returns true if the specified value is equal, in R.equals terms,
|
|
10
|
-
* to at least one element of the given list or false otherwise.
|
|
11
|
-
* Given list can be a string.
|
|
12
|
-
*
|
|
13
|
-
* Like {@link http://ramdajs.com/docs/#contains|R.contains} but with argument order reversed.
|
|
14
|
-
*
|
|
15
|
-
* @func contained
|
|
16
|
-
* @aliases included
|
|
17
|
-
* @memberOf RA
|
|
18
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
|
|
19
|
-
* @deprecated since v2.12.0; please use RA.included alias
|
|
20
|
-
* @category List
|
|
21
|
-
* @sig [a] -> a -> Boolean
|
|
22
|
-
* @param {Array|String} list The list to consider
|
|
23
|
-
* @param {*} a The item to compare against
|
|
24
|
-
* @return {boolean} Returns Boolean `true` if an equivalent item is in the list or `false` otherwise
|
|
25
|
-
* @see {@link http://ramdajs.com/docs/#contains|R.contains}
|
|
26
|
-
* @example
|
|
27
|
-
*
|
|
28
|
-
* RA.contained([1, 2, 3], 3); //=> true
|
|
29
|
-
* RA.contained([1, 2, 3], 4); //=> false
|
|
30
|
-
* RA.contained([{ name: 'Fred' }], { name: 'Fred' }); //=> true
|
|
31
|
-
* RA.contained([[42]], [42]); //=> true
|
|
32
|
-
*/
|
|
33
|
-
var contained = (0, _ramda.flip)(_ramda.contains);
|
|
34
|
-
var _default = contained;
|
|
35
|
-
exports["default"] = _default;
|
package/lib/hasPath.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = void 0;
|
|
5
|
-
|
|
6
|
-
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
|
-
var _isObj = _interopRequireDefault(require("./isObj"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Returns whether or not an object has an own property with the specified name at a given path.
|
|
14
|
-
*
|
|
15
|
-
* @func hasPath
|
|
16
|
-
* @memberOf RA
|
|
17
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.14.0|v1.14.0}
|
|
18
|
-
* @deprecated since v2.12.0; ramda@0.26.0 contains hasPath
|
|
19
|
-
* @category Object
|
|
20
|
-
* @typedef Idx = String | Int
|
|
21
|
-
* @sig [Idx] -> {a} -> Boolean
|
|
22
|
-
* @param {Array.<string|number>} path The path of the nested property
|
|
23
|
-
* @param {Object} obj The object to test
|
|
24
|
-
* @return {boolean}
|
|
25
|
-
* @see {@link http://ramdajs.com/docs/#has|R.has}
|
|
26
|
-
* @example
|
|
27
|
-
*
|
|
28
|
-
* RA.hasPath(['a', 'b'], { a: { b: 1 } }); //=> true
|
|
29
|
-
* RA.hasPath(['a', 'b', 'c'], { a: { b: 1 } }); //=> false
|
|
30
|
-
* RA.hasPath(['a', 'b'], { a: { } }); //=> false
|
|
31
|
-
* RA.hasPath([0], [1, 2]); //=> true
|
|
32
|
-
*/
|
|
33
|
-
var hasPath = (0, _ramda.curryN)(2, function (objPath, obj) {
|
|
34
|
-
var prop = (0, _ramda.head)(objPath); // termination conditions
|
|
35
|
-
|
|
36
|
-
if ((0, _ramda.length)(objPath) === 0 || !(0, _isObj["default"])(obj)) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if ((0, _ramda.length)(objPath) === 1) {
|
|
41
|
-
return (0, _ramda.has)(prop, obj);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return hasPath((0, _ramda.tail)(objPath), (0, _ramda.path)([prop], obj)); // base case
|
|
45
|
-
});
|
|
46
|
-
var _default = hasPath;
|
|
47
|
-
exports["default"] = _default;
|
package/lib/mergeRight.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = void 0;
|
|
5
|
-
|
|
6
|
-
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Create a new object with the own properties of the second object merged with
|
|
10
|
-
* the own properties of the first object. If a key exists in both objects,
|
|
11
|
-
* the value from the first object will be used. *
|
|
12
|
-
* Putting it simply: it sets properties only if they don't exist.
|
|
13
|
-
*
|
|
14
|
-
* @func mergeRight
|
|
15
|
-
* @deprecated since v2.12.0; available in ramda@0.26.0 as R.mergeLeft
|
|
16
|
-
* @aliases mergeLeft, resetToDefault
|
|
17
|
-
* @memberOf RA
|
|
18
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.6.0|v1.6.0}
|
|
19
|
-
* @category Object
|
|
20
|
-
* @sig {k: v} -> {k: v} -> {k: v}
|
|
21
|
-
* @param {Object} r Destination
|
|
22
|
-
* @param {Object} l Source
|
|
23
|
-
* @return {Object}
|
|
24
|
-
* @see {@link http://ramdajs.com/docs/#merge|R.merge}, {@link https://github.com/ramda/ramda/wiki/Cookbook#set-properties-only-if-they-dont-exist|Ramda Cookbook}
|
|
25
|
-
* @example
|
|
26
|
-
*
|
|
27
|
-
* RA.mergeRight({ 'age': 40 }, { 'name': 'fred', 'age': 10 });
|
|
28
|
-
* //=> { 'name': 'fred', 'age': 40 }
|
|
29
|
-
*/
|
|
30
|
-
var mergeRight = (0, _ramda.flip)(_ramda.merge);
|
|
31
|
-
var _default = mergeRight;
|
|
32
|
-
exports["default"] = _default;
|
package/lib/thenP.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports["default"] = void 0;
|
|
5
|
-
|
|
6
|
-
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Composable shortcut for `Promise.then`.
|
|
10
|
-
* The thenP function returns a Promise. It takes two arguments: a callback function for the success of the Promise
|
|
11
|
-
* and the promise instance itself.
|
|
12
|
-
*
|
|
13
|
-
* @func thenP
|
|
14
|
-
* @memberOf RA
|
|
15
|
-
* @aliases then
|
|
16
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
|
|
17
|
-
* @deprecated since v2.12.0; available in ramda@0.26.0 as R.then
|
|
18
|
-
* @category Function
|
|
19
|
-
* @sig (a -> Promise b | b) -> Promise b
|
|
20
|
-
* @param {Function} onFulfilled A Function called if the Promise is fulfilled. This function has one argument, the fulfillment value
|
|
21
|
-
* @param {Promise} promise Any Promise or Thenable object
|
|
22
|
-
* @return {Promise} A Promise in the pending status
|
|
23
|
-
|
|
24
|
-
* @see {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}, {@link RA.allP|allP}
|
|
25
|
-
* @example
|
|
26
|
-
*
|
|
27
|
-
* const promise = Promise.resolve(1);
|
|
28
|
-
* const add1 = v => v + 1;
|
|
29
|
-
*
|
|
30
|
-
* RA.thenP(add1, promise); // => Promise(2)
|
|
31
|
-
*/
|
|
32
|
-
var thenP = (0, _ramda.invoker)(1, 'then');
|
|
33
|
-
var _default = thenP;
|
|
34
|
-
exports["default"] = _default;
|
package/src/contained.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { flip, contains } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns true if the specified value is equal, in R.equals terms,
|
|
5
|
-
* to at least one element of the given list or false otherwise.
|
|
6
|
-
* Given list can be a string.
|
|
7
|
-
*
|
|
8
|
-
* Like {@link http://ramdajs.com/docs/#contains|R.contains} but with argument order reversed.
|
|
9
|
-
*
|
|
10
|
-
* @func contained
|
|
11
|
-
* @aliases included
|
|
12
|
-
* @memberOf RA
|
|
13
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
|
|
14
|
-
* @deprecated since v2.12.0; please use RA.included alias
|
|
15
|
-
* @category List
|
|
16
|
-
* @sig [a] -> a -> Boolean
|
|
17
|
-
* @param {Array|String} list The list to consider
|
|
18
|
-
* @param {*} a The item to compare against
|
|
19
|
-
* @return {boolean} Returns Boolean `true` if an equivalent item is in the list or `false` otherwise
|
|
20
|
-
* @see {@link http://ramdajs.com/docs/#contains|R.contains}
|
|
21
|
-
* @example
|
|
22
|
-
*
|
|
23
|
-
* RA.contained([1, 2, 3], 3); //=> true
|
|
24
|
-
* RA.contained([1, 2, 3], 4); //=> false
|
|
25
|
-
* RA.contained([{ name: 'Fred' }], { name: 'Fred' }); //=> true
|
|
26
|
-
* RA.contained([[42]], [42]); //=> true
|
|
27
|
-
*/
|
|
28
|
-
const contained = flip(contains);
|
|
29
|
-
|
|
30
|
-
export default contained;
|
package/src/hasPath.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { length, has, path, head, tail, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isObj from './isObj';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Returns whether or not an object has an own property with the specified name at a given path.
|
|
7
|
-
*
|
|
8
|
-
* @func hasPath
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.14.0|v1.14.0}
|
|
11
|
-
* @deprecated since v2.12.0; ramda@0.26.0 contains hasPath
|
|
12
|
-
* @category Object
|
|
13
|
-
* @typedef Idx = String | Int
|
|
14
|
-
* @sig [Idx] -> {a} -> Boolean
|
|
15
|
-
* @param {Array.<string|number>} path The path of the nested property
|
|
16
|
-
* @param {Object} obj The object to test
|
|
17
|
-
* @return {boolean}
|
|
18
|
-
* @see {@link http://ramdajs.com/docs/#has|R.has}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.hasPath(['a', 'b'], { a: { b: 1 } }); //=> true
|
|
22
|
-
* RA.hasPath(['a', 'b', 'c'], { a: { b: 1 } }); //=> false
|
|
23
|
-
* RA.hasPath(['a', 'b'], { a: { } }); //=> false
|
|
24
|
-
* RA.hasPath([0], [1, 2]); //=> true
|
|
25
|
-
*/
|
|
26
|
-
const hasPath = curryN(2, (objPath, obj) => {
|
|
27
|
-
const prop = head(objPath);
|
|
28
|
-
|
|
29
|
-
// termination conditions
|
|
30
|
-
if (length(objPath) === 0 || !isObj(obj)) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (length(objPath) === 1) {
|
|
34
|
-
return has(prop, obj);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return hasPath(tail(objPath), path([prop], obj)); // base case
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
export default hasPath;
|
package/src/mergeRight.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { merge, flip } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Create a new object with the own properties of the second object merged with
|
|
5
|
-
* the own properties of the first object. If a key exists in both objects,
|
|
6
|
-
* the value from the first object will be used. *
|
|
7
|
-
* Putting it simply: it sets properties only if they don't exist.
|
|
8
|
-
*
|
|
9
|
-
* @func mergeRight
|
|
10
|
-
* @deprecated since v2.12.0; available in ramda@0.26.0 as R.mergeLeft
|
|
11
|
-
* @aliases mergeLeft, resetToDefault
|
|
12
|
-
* @memberOf RA
|
|
13
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.6.0|v1.6.0}
|
|
14
|
-
* @category Object
|
|
15
|
-
* @sig {k: v} -> {k: v} -> {k: v}
|
|
16
|
-
* @param {Object} r Destination
|
|
17
|
-
* @param {Object} l Source
|
|
18
|
-
* @return {Object}
|
|
19
|
-
* @see {@link http://ramdajs.com/docs/#merge|R.merge}, {@link https://github.com/ramda/ramda/wiki/Cookbook#set-properties-only-if-they-dont-exist|Ramda Cookbook}
|
|
20
|
-
* @example
|
|
21
|
-
*
|
|
22
|
-
* RA.mergeRight({ 'age': 40 }, { 'name': 'fred', 'age': 10 });
|
|
23
|
-
* //=> { 'name': 'fred', 'age': 40 }
|
|
24
|
-
*/
|
|
25
|
-
const mergeRight = flip(merge);
|
|
26
|
-
|
|
27
|
-
export default mergeRight;
|
package/src/thenP.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { invoker } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Composable shortcut for `Promise.then`.
|
|
5
|
-
* The thenP function returns a Promise. It takes two arguments: a callback function for the success of the Promise
|
|
6
|
-
* and the promise instance itself.
|
|
7
|
-
*
|
|
8
|
-
* @func thenP
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @aliases then
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
|
|
12
|
-
* @deprecated since v2.12.0; available in ramda@0.26.0 as R.then
|
|
13
|
-
* @category Function
|
|
14
|
-
* @sig (a -> Promise b | b) -> Promise b
|
|
15
|
-
* @param {Function} onFulfilled A Function called if the Promise is fulfilled. This function has one argument, the fulfillment value
|
|
16
|
-
* @param {Promise} promise Any Promise or Thenable object
|
|
17
|
-
* @return {Promise} A Promise in the pending status
|
|
18
|
-
|
|
19
|
-
* @see {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}, {@link RA.allP|allP}
|
|
20
|
-
* @example
|
|
21
|
-
*
|
|
22
|
-
* const promise = Promise.resolve(1);
|
|
23
|
-
* const add1 = v => v + 1;
|
|
24
|
-
*
|
|
25
|
-
* RA.thenP(add1, promise); // => Promise(2)
|
|
26
|
-
*/
|
|
27
|
-
const thenP = invoker(1, 'then');
|
|
28
|
-
|
|
29
|
-
export default thenP;
|