ramda-adjunct 3.4.0 → 4.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +984 -0
  2. package/README.md +2 -2
  3. package/dist/RA.node.js +127 -41
  4. package/dist/RA.node.min.js +1 -1
  5. package/dist/RA.web.js +127 -41
  6. package/dist/RA.web.min.js +1 -1
  7. package/dist/RA.web.standalone.js +1224 -528
  8. package/dist/RA.web.standalone.min.js +1 -1
  9. package/es/concatAll.js +2 -1
  10. package/es/dispatch.js +1 -1
  11. package/es/ensureArray.js +1 -1
  12. package/es/flattenDepth.js +1 -1
  13. package/es/flattenProp.js +1 -1
  14. package/es/index.js +1 -0
  15. package/es/internal/ponyfills/Array.from.js +1 -1
  16. package/es/internal/ponyfills/Promise.allSettled.js +1 -1
  17. package/es/internal/ponyfills/Promise.any.js +1 -1
  18. package/es/isFalse.js +2 -2
  19. package/es/isNegativeZero.js +2 -2
  20. package/es/isPositiveZero.js +2 -2
  21. package/es/isTrue.js +2 -2
  22. package/es/lastP.js +1 -1
  23. package/es/lensTraverse.js +12 -3
  24. package/es/mergeProp.js +1 -1
  25. package/es/pathNotEq.js +4 -4
  26. package/es/propNotEq.js +3 -3
  27. package/es/reduceP.js +2 -2
  28. package/es/reduceRightP.js +2 -2
  29. package/es/renameKey.js +35 -0
  30. package/es/sortByProps.js +1 -1
  31. package/es/spreadProp.js +1 -1
  32. package/lib/allEqual.js +0 -1
  33. package/lib/concatAll.js +2 -1
  34. package/lib/dispatch.js +36 -1
  35. package/lib/ensureArray.js +1 -1
  36. package/lib/flattenDepth.js +1 -1
  37. package/lib/flattenProp.js +1 -1
  38. package/lib/index.js +4 -2
  39. package/lib/internal/ponyfills/Array.from.js +1 -1
  40. package/lib/internal/ponyfills/Promise.allSettled.js +1 -1
  41. package/lib/internal/ponyfills/Promise.any.js +1 -1
  42. package/lib/isFalse.js +1 -1
  43. package/lib/isNegativeZero.js +1 -1
  44. package/lib/isPositiveZero.js +1 -1
  45. package/lib/isSentinelValue.js +1 -2
  46. package/lib/isTrue.js +1 -1
  47. package/lib/lastP.js +1 -1
  48. package/lib/lensTraverse.js +11 -3
  49. package/lib/mergeProp.js +1 -1
  50. package/lib/pathNotEq.js +4 -4
  51. package/lib/propNotEq.js +3 -3
  52. package/lib/reduceP.js +2 -2
  53. package/lib/reduceRightP.js +2 -2
  54. package/lib/renameKey.js +40 -0
  55. package/lib/seq.js +0 -1
  56. package/lib/sortByProps.js +1 -1
  57. package/lib/spreadProp.js +1 -1
  58. package/lib/toInteger32.js +1 -2
  59. package/lib/toUinteger32.js +1 -3
  60. package/package.json +38 -39
  61. package/src/concatAll.js +2 -1
  62. package/src/ensureArray.js +1 -1
  63. package/src/flattenProp.js +1 -1
  64. package/src/index.js +1 -0
  65. package/src/isFalse.js +2 -2
  66. package/src/isNegativeZero.js +2 -2
  67. package/src/isPositiveZero.js +2 -2
  68. package/src/isTrue.js +2 -2
  69. package/src/lensTraverse.js +18 -6
  70. package/src/mergeProp.js +1 -1
  71. package/src/pathNotEq.js +4 -4
  72. package/src/propNotEq.js +3 -3
  73. package/src/renameKey.js +33 -0
  74. package/src/spreadProp.js +1 -1
  75. package/types/index.d.ts +28 -0
  76. package/.nvmrc +0 -1
package/es/concatAll.js CHANGED
@@ -24,7 +24,8 @@ var leftIdentitySemigroup = {
24
24
  *
25
25
  * concatAll([[1], [2], [3]]); //=> [1, 2, 3]
26
26
  * concatAll(['1', '2', '3']); //=> '123'
27
- * concatAll([]); //=> undefined;
27
+ * concatAll([]); //=> undefined
28
+ * concatAll(null); //=> undefined
28
29
  */
29
30
  var concatAll = pipe(reduce(concat, leftIdentitySemigroup), when(identical(leftIdentitySemigroup), stubUndefined));
30
31
  export default concatAll;
package/es/dispatch.js CHANGED
@@ -3,7 +3,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  import { sort, comparator, prop, pipe, head, curryN, reduce, reduced, curry, ifElse } from 'ramda';
8
8
 
9
9
  /**
package/es/ensureArray.js CHANGED
@@ -18,5 +18,5 @@ import isNotArray from './isNotArray';
18
18
  * RA.ensureArray(42); //=> [42]
19
19
  * RA.ensureArray([42]); //=> [42]
20
20
  */
21
- var ensureArray = when(isNotArray, of);
21
+ var ensureArray = when(isNotArray, of(Array));
22
22
  export default ensureArray;
@@ -3,7 +3,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  import { curry } from 'ramda';
8
8
  import _makeFlat from './internal/makeFlat';
9
9
  var flatten1 = _makeFlat(false);
package/es/flattenProp.js CHANGED
@@ -23,6 +23,6 @@ import flattenPath from './flattenPath';
23
23
  * ); // => { a: 1, c: 3, d: 4, b: { c: 3, d: 4 } };
24
24
  */
25
25
  var flattenProp = curry(function (prop, obj) {
26
- return flattenPath(of(prop), obj);
26
+ return flattenPath(of(Array, prop), obj);
27
27
  });
28
28
  export default flattenProp;
package/es/index.js CHANGED
@@ -170,6 +170,7 @@ export { default as findOr } from './findOr';
170
170
  export { default as invoke } from './invoke';
171
171
  export { default as invokeArgs } from './invokeArgs';
172
172
  export { default as paths } from './paths';
173
+ export { default as renameKey } from './renameKey';
173
174
  export { default as renameKeys } from './renameKeys';
174
175
  export { default as renameKeysWith } from './renameKeysWith';
175
176
  export { default as renameKeyWith } from './renameKeyWith';
@@ -3,7 +3,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  import { bind } from 'ramda';
8
8
  import isIterable from '../../isIterable';
9
9
  import isNotUndefined from '../../isNotUndefined';
@@ -3,7 +3,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  import { map } from 'ramda';
8
8
  import allP from '../../allP';
9
9
  import resolveP from '../../resolveP';
@@ -4,7 +4,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
4
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
6
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
8
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
10
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
package/es/isFalse.js CHANGED
@@ -1,4 +1,4 @@
1
- import { identical } from 'ramda';
1
+ import { identical, curryN } from 'ramda';
2
2
 
3
3
  /**
4
4
  * Checks if input value is the Boolean primitive `false`. Will return false for all values created
@@ -26,5 +26,5 @@ import { identical } from 'ramda';
26
26
  * RA.isFalse(new Boolean(false)); // => false
27
27
  */
28
28
 
29
- var isFalse = identical(false);
29
+ var isFalse = curryN(1, identical(false));
30
30
  export default isFalse;
@@ -1,4 +1,4 @@
1
- import { identical } from 'ramda';
1
+ import { identical, curryN } from 'ramda';
2
2
 
3
3
  /**
4
4
  * Checks if value is a negative zero (-0).
@@ -18,5 +18,5 @@ import { identical } from 'ramda';
18
18
  * RA.isNegativeZero(0); //=> false
19
19
  * RA.isNegativeZero(null); //=> false
20
20
  */
21
- var isNegativeZero = identical(-0);
21
+ var isNegativeZero = curryN(1, identical(-0));
22
22
  export default isNegativeZero;
@@ -1,4 +1,4 @@
1
- import { identical } from 'ramda';
1
+ import { identical, curryN } from 'ramda';
2
2
 
3
3
  /**
4
4
  * Checks if value is a positive zero (+0).
@@ -18,5 +18,5 @@ import { identical } from 'ramda';
18
18
  * RA.isPositiveZero(-0); //=> false
19
19
  * RA.isPositiveZero(null); //=> false
20
20
  */
21
- var isPositiveZero = identical(+0);
21
+ var isPositiveZero = curryN(1, identical(+0));
22
22
  export default isPositiveZero;
package/es/isTrue.js CHANGED
@@ -1,4 +1,4 @@
1
- import { identical } from 'ramda';
1
+ import { identical, curryN } from 'ramda';
2
2
 
3
3
  /**
4
4
  * Checks if input value is the Boolean primitive `true`. Will return false for Boolean objects
@@ -22,5 +22,5 @@ import { identical } from 'ramda';
22
22
  * RA.isTrue(new Boolean(true)); // => false
23
23
  */
24
24
 
25
- var isTrue = identical(true);
25
+ var isTrue = curryN(1, identical(true));
26
26
  export default isTrue;
package/es/lastP.js CHANGED
@@ -3,7 +3,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
7
  import { bind, last, map, curryN } from 'ramda';
8
8
  import allP from './allP';
9
9
  import lengthEq from './lengthEq';
@@ -17,8 +17,10 @@ import Identity from './fantasy-land/Identity';
17
17
  * @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|2.7.0}
18
18
  * @category Relation
19
19
  * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
20
+ * @sig fantasy-land/of :: TypeRep f => f ~> a → f a
20
21
  * @sig Applicative f => (a -> f a) -> Lens s a
21
- * @param {!function} of The Applicative-returning function
22
+ * @sig Applicative f => TypeRep f -> Lens s a
23
+ * @param {!Object|!Function} TypeRepresentative with an `of` or `fantasy-land/of` method
22
24
  * @return {!function} The Traversable lens
23
25
  * @see {@link http://ramdajs.com/docs/#lens|R.lens}, {@link http://ramdajs.com/docs/#traverse|R.traverse}
24
26
  *
@@ -34,9 +36,16 @@ import Identity from './fantasy-land/Identity';
34
36
  *
35
37
  * R.set(maybeLens, Maybe.Just(1), [Maybe.just(2), Maybe.Just(3)]); // => Maybe.Just([1, 1])
36
38
  */
37
- var lensTraverse = curryN(1, function (of) {
39
+ /* eslint-disable no-nested-ternary */
40
+ var lensTraverse = curryN(1, function (F) {
41
+ var of = typeof F['fantasy-land/of'] === 'function' ? F['fantasy-land/of'] : typeof F.of === 'function' ? F.of : F;
42
+ var TypeRep = {
43
+ 'fantasy-land/of': of
44
+ };
38
45
  return curry(function (toFunctorFn, target) {
39
- return Identity.of(traverse(of, pipe(toFunctorFn, prop('value')), target));
46
+ return Identity.of(traverse(TypeRep, pipe(toFunctorFn, prop('value')), target));
40
47
  });
41
48
  });
49
+ /* eslint-enable */
50
+
42
51
  export default lensTraverse;
package/es/mergeProp.js CHANGED
@@ -25,6 +25,6 @@ import mergePath from './mergePath';
25
25
  * ); //=> { outer: { foo: 3, bar: 4 } };
26
26
  */
27
27
  var mergeProp = curry(function (p, subj, obj) {
28
- return mergePath(of(p), subj, obj);
28
+ return mergePath(of(Array, p), subj, obj);
29
29
  });
30
30
  export default mergeProp;
package/es/pathNotEq.js CHANGED
@@ -9,10 +9,10 @@ import { pathEq, complement } from 'ramda';
9
9
  * @memberOf RA
10
10
  * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
11
11
  * @category Relation
12
- * @sig [Idx] => a => {a} => Boolean
13
- * @sig Idx = String | Int
14
- * @param {Array} path The path of the nested property to use
12
+ * @sig a => [Idx] => {a} => Boolean
13
+ * @sig Idx = String | Int | Symbol
15
14
  * @param {a} val The value to compare the nested property with
15
+ * @param {Array} path The path of the nested property to use
16
16
  * @param {Object} object The object to check the nested property in
17
17
  * @return {boolean} Returns Boolean `false` if the value equals the nested object property, `true` otherwise
18
18
  * @see {@link http://ramdajs.com/docs/#pathEq|R.pathEq}
@@ -22,7 +22,7 @@ import { pathEq, complement } from 'ramda';
22
22
  * const user2 = { address: { zipCode: 55555 } };
23
23
  * const user3 = { name: 'Bob' };
24
24
  * const users = [ user1, user2, user3 ];
25
- * const isFamous = R.pathNotEq(['address', 'zipCode'], 90210);
25
+ * const isFamous = RA.pathNotEq(90210, ['address', 'zipCode']);
26
26
  * R.filter(isFamous, users); //=> [ user2, user3 ]
27
27
  */
28
28
  /* eslint-enable max-len */
package/es/propNotEq.js CHANGED
@@ -8,9 +8,9 @@ import { propEq, complement } from 'ramda';
8
8
  * @memberOf RA
9
9
  * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
10
10
  * @category Relation
11
- * @sig String -> a -> Object -> Boolean
12
- * @param {String} name The property to pick
11
+ * @sig a -> String -> Object -> Boolean
13
12
  * @param {a} val The value to compare to
13
+ * @param {String} name The property to pick
14
14
  * @param {Object} object The object, that presumably contains value under the property
15
15
  * @return {boolean} Comparison result
16
16
  * @see {@link http://ramdajs.com/docs/#propEq|R.propEq}
@@ -21,7 +21,7 @@ import { propEq, complement } from 'ramda';
21
21
  * const rusty = { name: 'Rusty', age: 10, hair: 'brown' };
22
22
  * const alois = { name: 'Alois', age: 15, disposition: 'surly' };
23
23
  * const kids = [abby, fred, rusty, alois];
24
- * const hasNotBrownHair = RA.propNotEq('hair', 'brown');
24
+ * const hasNotBrownHair = RA.propNotEq('brown', 'hair');
25
25
  *
26
26
  * R.filter(hasNotBrownHair, kids); //=> [abby, alois]
27
27
  */
package/es/reduceP.js CHANGED
@@ -1,8 +1,8 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { curryN, reduce, length } from 'ramda';
8
8
  import isUndefined from './isUndefined';
@@ -1,8 +1,8 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { curryN, pipe, equals, reduceRight, length, concat } from 'ramda';
8
8
  import isUndefined from './isUndefined';
@@ -0,0 +1,35 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import { curry } from 'ramda';
6
+ import renameKeys from './renameKeys';
7
+
8
+ /**
9
+ * Creates a new object with the own properties of the provided object, but a
10
+ * single key is renamed from `oldKey` to `newKey`.
11
+ *
12
+ * Keep in mind that in the case of keys conflict is behavior undefined and
13
+ * the result may vary between various JS engines!
14
+ *
15
+ * @func renameKey
16
+ * @memberOf RA
17
+ * @since {@link https://char0n.github.io/ramda-adjunct/4.1.0|v4.1.0}
18
+ * @category Object
19
+ * @sig (String a, String b) => a -> b -> {a: *} -> {b: *}
20
+ * @param {!string} oldKey
21
+ * @param {!string} newKey
22
+ * @param {!Object} obj
23
+ * @return {!Object} New object with renamed key
24
+ * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#rename-key-of-an-object|Ramda Cookbook}, {@link RA.renameKeyWith|renameKeyWith}
25
+ * @example
26
+ *
27
+ * const input = { firstName: 'Elisia', age: 22, type: 'human' };
28
+ *
29
+ * RA.renameKey('firstName', 'name')(input);
30
+ * //=> { name: 'Elisia', age: 22, type: 'human' }
31
+ */
32
+ var renameKey = curry(function (oldKey, newKey, obj) {
33
+ return renameKeys(_defineProperty({}, oldKey, newKey), obj);
34
+ });
35
+ export default renameKey;
package/es/sortByProps.js CHANGED
@@ -1,7 +1,7 @@
1
1
  function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
2
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { comparator, curry, either, lt, map, prop, reduce, sort } from 'ramda';
package/es/spreadProp.js CHANGED
@@ -20,6 +20,6 @@ import spreadPath from './spreadPath';
20
20
  * RA.spreadProp('b', { a: 1, b: { c: 3, d: 4 } }); // => { a: 1, c: 3, d: 4 };
21
21
  */
22
22
  var spreadProp = curry(function (prop, obj) {
23
- return spreadPath(of(prop), obj);
23
+ return spreadPath(of(Array, prop), obj);
24
24
  });
25
25
  export default spreadProp;
package/lib/allEqual.js CHANGED
@@ -7,7 +7,6 @@ var _lengthLte = _interopRequireDefault(require("./lengthLte"));
7
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
8
  // Original idea for this function was conceived by https://github.com/jackmellis
9
9
  // in https://github.com/char0n/ramda-adjunct/pull/513.
10
-
11
10
  /**
12
11
  * Returns true if all items in the list are equivalent using `R.equals` for equality comparisons.
13
12
  *
package/lib/concatAll.js CHANGED
@@ -29,7 +29,8 @@ var leftIdentitySemigroup = {
29
29
  *
30
30
  * concatAll([[1], [2], [3]]); //=> [1, 2, 3]
31
31
  * concatAll(['1', '2', '3']); //=> '123'
32
- * concatAll([]); //=> undefined;
32
+ * concatAll([]); //=> undefined
33
+ * concatAll(null); //=> undefined
33
34
  */
34
35
  var concatAll = (0, _ramda.pipe)((0, _ramda.reduce)(_ramda.concat, leftIdentitySemigroup), (0, _ramda.when)((0, _ramda.identical)(leftIdentitySemigroup), _stubUndefined["default"]));
35
36
  var _default = concatAll;
package/lib/dispatch.js CHANGED
@@ -12,7 +12,42 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
12
12
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
13
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
14
14
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
15
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /**
16
+ * Can be used as a way to compose multiple invokers together to form polymorphic functions,
17
+ * or functions that exhibit different behaviors based on their argument(s).
18
+ * Consumes dispatching functions and keep trying to invoke each in turn, until a non-nil value is returned.
19
+ *
20
+ * Accepts a list of dispatching functions and returns a new function.
21
+ * When invoked, this new function is applied to some arguments,
22
+ * each dispatching function is applied to those same arguments until one of the
23
+ * dispatching functions returns a non-nil value.
24
+ *
25
+ * @func dispatch
26
+ * @memberOf RA
27
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
28
+ * @category Function
29
+ * @sig [((a, b, ...) -> x1), ((a, b, ...) -> x2), ...] -> x1 | x2 | ...
30
+ * @param {!Array} functions A list of functions
31
+ * @return {*|undefined} Returns the first not-nil value, or undefined if either an empty list is provided or none of the dispatching functions returns a non-nil value
32
+ * @see {@link RA.isNotNil}
33
+ * @example
34
+ *
35
+ * // returns first non-nil value
36
+ * const stubNil = () => null;
37
+ * const stubUndefined = () => undefined;
38
+ * const addOne = v => v + 1;
39
+ * const addTwo = v => v + 2;
40
+ *
41
+ * RA.dispatch([stubNil, stubUndefined, addOne, addTwo])(1); //=> 2
42
+ *
43
+ * // acts as a switch
44
+ * const fnSwitch = RA.dispatch([
45
+ * R.ifElse(RA.isString, s => `${s}-join`, RA.stubUndefined),
46
+ * R.ifElse(RA.isNumber, n => n + 1, RA.stubUndefined),
47
+ * R.ifElse(RA.isDate, R.T, RA.stubUndefined),
48
+ * ]);
49
+ * fnSwitch(1); //=> 2
50
+ */
16
51
  var byArity = (0, _ramda.comparator)(function (a, b) {
17
52
  return a.length > b.length;
18
53
  });
@@ -22,6 +22,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
22
22
  * RA.ensureArray(42); //=> [42]
23
23
  * RA.ensureArray([42]); //=> [42]
24
24
  */
25
- var ensureArray = (0, _ramda.when)(_isNotArray["default"], _ramda.of);
25
+ var ensureArray = (0, _ramda.when)(_isNotArray["default"], (0, _ramda.of)(Array));
26
26
  var _default = ensureArray;
27
27
  exports["default"] = _default;
@@ -10,7 +10,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
10
10
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
11
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
12
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  var flatten1 = (0, _makeFlat2["default"])(false);
15
15
 
16
16
  /**
@@ -27,7 +27,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
27
27
  * ); // => { a: 1, c: 3, d: 4, b: { c: 3, d: 4 } };
28
28
  */
29
29
  var flattenProp = (0, _ramda.curry)(function (prop, obj) {
30
- return (0, _flattenPath["default"])((0, _ramda.of)(prop), obj);
30
+ return (0, _flattenPath["default"])((0, _ramda.of)(Array, prop), obj);
31
31
  });
32
32
  var _default = flattenProp;
33
33
  exports["default"] = _default;
package/lib/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.isNotRegExp = exports.isNotPrimitive = exports.isNotPlainObject = exports.isNotPlainObj = exports.isNotPair = exports.isNotObjectLike = exports.isNotObject = exports.isNotObjLike = exports.isNotObj = exports.isNotNumber = exports.isNotNull = exports.isNotNilOrEmpty = exports.isNotNil = exports.isNotNaN = exports.isNotMap = exports.isNotInteger = exports.isNotGeneratorFunction = exports.isNotFunction = exports.isNotFloat = exports.isNotFinite = exports.isNotEmpty = exports.isNotDate = exports.isNotBoolean = exports.isNotAsyncFunction = exports.isNotArrayLike = exports.isNotArray = exports.isNonPositive = exports.isNonNegative = exports.isNonEmptyString = exports.isNonEmptyArray = exports.isNilOrEmpty = exports.isNegativeZero = exports.isNegative = exports.isNaturalNumber = exports.isNaN = exports.isMap = exports.isIterable = exports.isInvalidDate = exports.isInteger32 = exports.isInteger = exports.isInt32 = exports.isIndexed = exports.isGeneratorFunction = exports.isFunction = exports.isFloat = exports.isFinite = exports.isFalsy = exports.isFalse = exports.isEven = exports.isError = exports.isEmptyString = exports.isEmptyArray = exports.isDate = exports.isBoolean = exports.isBlank = exports.isBigInt = exports.isAsyncFunction = exports.isArrayLike = exports.isArray = exports.invokeArgs = exports.invoke = exports.included = exports.inRange = exports.fnull = exports.floor = exports.flattenProp = exports.flattenPath = exports.flattenDepth = exports.firstP = exports.findOr = exports.filterIndexed = exports.escapeRegExp = exports.ensureArray = exports.dropArgs = exports.divideNum = exports.dispatch = exports.delayP = exports.defaultWhen = exports.curryRightN = exports.curryRight = exports.copyKeys = exports.concatRight = exports.concatAll = exports.compact = exports.ceil = exports.catchP = exports.cata = exports.async = exports.argsPass = exports.appendFlipped = exports.anyP = exports.allUnique = exports.allSettledP = exports.allP = exports.allIdenticalTo = exports.allIdentical = exports.allEqualTo = exports.allEqual = exports.Y = exports.Identity = void 0;
5
- exports.sortByProps = exports.sortByProp = exports.sortByPaths = exports.sliceTo = exports.sliceFrom = exports.skipTake = exports.sign = exports.sequencing = exports.seq = exports.round = exports.resolveP = exports.replaceAll = exports.repeatStr = exports.renameKeysWith = exports.renameKeys = exports.renameKeyWith = exports.rejectP = exports.reduceRightP = exports.reduceP = exports.reduceIndexed = exports.rangeStep = exports.propNotEq = exports.pickIndexes = exports.paths = exports.pathOrLazy = exports.pathNotEq = exports.padStart = exports.padEnd = exports.padCharsStart = exports.padCharsEnd = exports.overlaps = exports.omitIndexes = exports.omitBy = exports.notEqual = exports.notBoth = exports.notAllUnique = exports.notAllPass = exports.nor = exports.noop = exports.nonePass = exports.noneP = exports.neither = exports.nand = exports.move = exports.mergeProps = exports.mergeProp = exports.mergePaths = exports.mergePath = exports.mapIndexed = exports.list = exports.liftFN = exports.liftF = exports.lensTraverse = exports.lensSatisfies = exports.lensNotSatisfy = exports.lensNotEq = exports.lensIso = exports.lensEq = exports.lengthNotEq = exports.lengthLte = exports.lengthLt = exports.lengthGte = exports.lengthGt = exports.lengthEq = exports.lastP = exports.isValidNumber = exports.isValidDate = exports.isUndefined = exports.isUinteger32 = exports.isUint32 = exports.isTruthy = exports.isTrue = exports.isThenable = exports.isSymbol = exports.isString = exports.isSparseArray = exports.isSet = exports.isSentinelValue = exports.isSafeInteger = exports.isRegExp = exports.isPrototypeOf = exports.isPromise = exports.isPrimitive = exports.isPositiveZero = exports.isPositive = exports.isPlainObject = exports.isPlainObj = exports.isPair = exports.isOdd = exports.isObjectLike = exports.isObject = exports.isObjLike = exports.isObj = exports.isNumber = exports.isNull = exports.isNotValidNumber = exports.isNotValidDate = exports.isNotUndefined = exports.isNotString = exports.isNotSet = void 0;
6
- exports.zipObjWith = exports.weaveLazy = exports.weave = exports.viewOr = exports.unzipObjWith = exports.trunc = exports.trimStart = exports.trimRight = exports.trimLeft = exports.trimEnd = exports.trimCharsStart = exports.trimCharsEnd = exports.toUinteger32 = exports.toUint32 = exports.toNumber = exports.toInteger32 = exports.toInt32 = exports.toArray = exports.thenCatchP = exports.subtractNum = exports.stubUndefined = exports.stubString = exports.stubObject = exports.stubObj = exports.stubNull = exports.stubArray = exports.spreadProp = exports.spreadPath = void 0;
5
+ exports.sortByProp = exports.sortByPaths = exports.sliceTo = exports.sliceFrom = exports.skipTake = exports.sign = exports.sequencing = exports.seq = exports.round = exports.resolveP = exports.replaceAll = exports.repeatStr = exports.renameKeysWith = exports.renameKeys = exports.renameKeyWith = exports.renameKey = exports.rejectP = exports.reduceRightP = exports.reduceP = exports.reduceIndexed = exports.rangeStep = exports.propNotEq = exports.pickIndexes = exports.paths = exports.pathOrLazy = exports.pathNotEq = exports.padStart = exports.padEnd = exports.padCharsStart = exports.padCharsEnd = exports.overlaps = exports.omitIndexes = exports.omitBy = exports.notEqual = exports.notBoth = exports.notAllUnique = exports.notAllPass = exports.nor = exports.noop = exports.nonePass = exports.noneP = exports.neither = exports.nand = exports.move = exports.mergeProps = exports.mergeProp = exports.mergePaths = exports.mergePath = exports.mapIndexed = exports.list = exports.liftFN = exports.liftF = exports.lensTraverse = exports.lensSatisfies = exports.lensNotSatisfy = exports.lensNotEq = exports.lensIso = exports.lensEq = exports.lengthNotEq = exports.lengthLte = exports.lengthLt = exports.lengthGte = exports.lengthGt = exports.lengthEq = exports.lastP = exports.isValidNumber = exports.isValidDate = exports.isUndefined = exports.isUinteger32 = exports.isUint32 = exports.isTruthy = exports.isTrue = exports.isThenable = exports.isSymbol = exports.isString = exports.isSparseArray = exports.isSet = exports.isSentinelValue = exports.isSafeInteger = exports.isRegExp = exports.isPrototypeOf = exports.isPromise = exports.isPrimitive = exports.isPositiveZero = exports.isPositive = exports.isPlainObject = exports.isPlainObj = exports.isPair = exports.isOdd = exports.isObjectLike = exports.isObject = exports.isObjLike = exports.isObj = exports.isNumber = exports.isNull = exports.isNotValidNumber = exports.isNotValidDate = exports.isNotUndefined = exports.isNotString = exports.isNotSet = void 0;
6
+ exports.zipObjWith = exports.weaveLazy = exports.weave = exports.viewOr = exports.unzipObjWith = exports.trunc = exports.trimStart = exports.trimRight = exports.trimLeft = exports.trimEnd = exports.trimCharsStart = exports.trimCharsEnd = exports.toUinteger32 = exports.toUint32 = exports.toNumber = exports.toInteger32 = exports.toInt32 = exports.toArray = exports.thenCatchP = exports.subtractNum = exports.stubUndefined = exports.stubString = exports.stubObject = exports.stubObj = exports.stubNull = exports.stubArray = exports.spreadProp = exports.spreadPath = exports.sortByProps = void 0;
7
7
  var _isNotUndefined = _interopRequireDefault(require("./isNotUndefined"));
8
8
  exports.isNotUndefined = _isNotUndefined["default"];
9
9
  var _isUndefined = _interopRequireDefault(require("./isUndefined"));
@@ -320,6 +320,8 @@ var _invokeArgs = _interopRequireDefault(require("./invokeArgs"));
320
320
  exports.invokeArgs = _invokeArgs["default"];
321
321
  var _paths = _interopRequireDefault(require("./paths"));
322
322
  exports.paths = _paths["default"];
323
+ var _renameKey = _interopRequireDefault(require("./renameKey"));
324
+ exports.renameKey = _renameKey["default"];
323
325
  var _renameKeys = _interopRequireDefault(require("./renameKeys"));
324
326
  exports.renameKeys = _renameKeys["default"];
325
327
  var _renameKeysWith = _interopRequireDefault(require("./renameKeysWith"));
@@ -13,7 +13,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
13
13
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
14
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
15
15
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
17
17
  var copyArray = function copyArray(items, mapFn, thisArg) {
18
18
  var boundMapFn = (0, _isNotUndefined["default"])(thisArg) ? (0, _ramda.bind)(mapFn, thisArg) : mapFn;
19
19
  return (0, _isNotUndefined["default"])(mapFn) ? _toConsumableArray(items).map(boundMapFn) : _toConsumableArray(items);
@@ -11,7 +11,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
11
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
12
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
13
13
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
15
  var onFulfill = function onFulfill(value) {
16
16
  return {
17
17
  status: 'fulfilled',
@@ -11,7 +11,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
11
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
12
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
13
13
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
15
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
16
16
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
17
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
package/lib/isFalse.js CHANGED
@@ -29,6 +29,6 @@ var _ramda = require("ramda");
29
29
  * RA.isFalse(new Boolean(false)); // => false
30
30
  */
31
31
 
32
- var isFalse = (0, _ramda.identical)(false);
32
+ var isFalse = (0, _ramda.curryN)(1, (0, _ramda.identical)(false));
33
33
  var _default = isFalse;
34
34
  exports["default"] = _default;
@@ -21,6 +21,6 @@ var _ramda = require("ramda");
21
21
  * RA.isNegativeZero(0); //=> false
22
22
  * RA.isNegativeZero(null); //=> false
23
23
  */
24
- var isNegativeZero = (0, _ramda.identical)(-0);
24
+ var isNegativeZero = (0, _ramda.curryN)(1, (0, _ramda.identical)(-0));
25
25
  var _default = isNegativeZero;
26
26
  exports["default"] = _default;
@@ -21,6 +21,6 @@ var _ramda = require("ramda");
21
21
  * RA.isPositiveZero(-0); //=> false
22
22
  * RA.isPositiveZero(null); //=> false
23
23
  */
24
- var isPositiveZero = (0, _ramda.identical)(+0);
24
+ var isPositiveZero = (0, _ramda.curryN)(1, (0, _ramda.identical)(+0));
25
25
  var _default = isPositiveZero;
26
26
  exports["default"] = _default;
@@ -22,8 +22,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
22
22
  * RA.isSentinelValue('-1'); //=> false
23
23
  * RA.isSentinelValue(1); //=> false
24
24
  * RA.isSentinelValue([-1]); //=> false
25
- */
26
- // eslint-disable-next-line no-bitwise
25
+ */ // eslint-disable-next-line no-bitwise
27
26
  var isSentinelValue = (0, _ramda.curryN)(1, function (val) {
28
27
  return (0, _isInteger["default"])(val) && ~val === 0;
29
28
  });
package/lib/isTrue.js CHANGED
@@ -25,6 +25,6 @@ var _ramda = require("ramda");
25
25
  * RA.isTrue(new Boolean(true)); // => false
26
26
  */
27
27
 
28
- var isTrue = (0, _ramda.identical)(true);
28
+ var isTrue = (0, _ramda.curryN)(1, (0, _ramda.identical)(true));
29
29
  var _default = isTrue;
30
30
  exports["default"] = _default;
package/lib/lastP.js CHANGED
@@ -14,7 +14,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
14
14
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
15
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
16
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
18
18
  /**
19
19
  * Returns a promise that is fulfilled by the last given promise to be fulfilled,
20
20
  * or rejected with an array of rejection reasons if all of the given promises are rejected.
@@ -21,8 +21,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
21
21
  * @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|2.7.0}
22
22
  * @category Relation
23
23
  * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
24
+ * @sig fantasy-land/of :: TypeRep f => f ~> a → f a
24
25
  * @sig Applicative f => (a -> f a) -> Lens s a
25
- * @param {!function} of The Applicative-returning function
26
+ * @sig Applicative f => TypeRep f -> Lens s a
27
+ * @param {!Object|!Function} TypeRepresentative with an `of` or `fantasy-land/of` method
26
28
  * @return {!function} The Traversable lens
27
29
  * @see {@link http://ramdajs.com/docs/#lens|R.lens}, {@link http://ramdajs.com/docs/#traverse|R.traverse}
28
30
  *
@@ -38,10 +40,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
38
40
  *
39
41
  * R.set(maybeLens, Maybe.Just(1), [Maybe.just(2), Maybe.Just(3)]); // => Maybe.Just([1, 1])
40
42
  */
41
- var lensTraverse = (0, _ramda.curryN)(1, function (of) {
43
+ /* eslint-disable no-nested-ternary */
44
+ var lensTraverse = (0, _ramda.curryN)(1, function (F) {
45
+ var of = typeof F['fantasy-land/of'] === 'function' ? F['fantasy-land/of'] : typeof F.of === 'function' ? F.of : F;
46
+ var TypeRep = {
47
+ 'fantasy-land/of': of
48
+ };
42
49
  return (0, _ramda.curry)(function (toFunctorFn, target) {
43
- return _Identity["default"].of((0, _ramda.traverse)(of, (0, _ramda.pipe)(toFunctorFn, (0, _ramda.prop)('value')), target));
50
+ return _Identity["default"].of((0, _ramda.traverse)(TypeRep, (0, _ramda.pipe)(toFunctorFn, (0, _ramda.prop)('value')), target));
44
51
  });
45
52
  });
53
+ /* eslint-enable */
46
54
  var _default = lensTraverse;
47
55
  exports["default"] = _default;