ramda-adjunct 5.1.0 → 6.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 (101) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +3 -3
  3. package/dist/RA.node.js +1089 -1153
  4. package/dist/RA.node.min.js +1 -1
  5. package/dist/RA.web.js +1089 -1153
  6. package/dist/RA.web.min.js +1 -1
  7. package/dist/RA.web.standalone.js +2907 -2620
  8. package/dist/RA.web.standalone.min.js +1 -1
  9. package/es/copyKeys.js +2 -3
  10. package/es/index.js +1 -1
  11. package/es/internal/ap.js +1 -1
  12. package/es/internal/ponyfills/Math.trunc.js +0 -2
  13. package/es/internal/ponyfills/Number.isFinite.js +0 -2
  14. package/es/internal/ponyfills/Number.isNaN.js +0 -2
  15. package/es/internal/ponyfills/Promise.any.js +1 -1
  16. package/es/internal/ponyfills/String.padEnd.js +0 -1
  17. package/es/internal/ponyfills/String.padStart.js +0 -1
  18. package/es/internal/ponyfills/String.repeat.js +1 -1
  19. package/es/isArrayLike.js +1 -2
  20. package/es/isCoercible.js +31 -0
  21. package/es/isMap.js +3 -3
  22. package/es/isNotAsyncFunction.js +1 -2
  23. package/es/isNotFunction.js +1 -2
  24. package/es/isNotGeneratorFunction.js +1 -2
  25. package/es/isNotObj.js +1 -2
  26. package/es/isNotObjLike.js +1 -2
  27. package/es/isNotPlainObj.js +1 -2
  28. package/es/isObj.js +1 -2
  29. package/es/isObjLike.js +1 -2
  30. package/es/isPlainObj.js +1 -2
  31. package/es/isSentinelValue.js +1 -1
  32. package/es/isValidDate.js +1 -2
  33. package/es/lensTraverse.js +1 -3
  34. package/es/mergeProp.js +2 -2
  35. package/es/nand.js +1 -2
  36. package/es/neither.js +1 -2
  37. package/es/nor.js +1 -2
  38. package/es/notBoth.js +1 -2
  39. package/es/omitBy.js +1 -2
  40. package/es/pathNotEq.js +1 -2
  41. package/es/reduceP.js +0 -1
  42. package/es/reduceRightP.js +0 -1
  43. package/es/renameKey.js +1 -2
  44. package/es/resolveP.js +1 -2
  45. package/es/seq.js +0 -2
  46. package/es/sortByProps.js +1 -1
  47. package/es/stubUndefined.js +1 -2
  48. package/es/toInteger32.js +1 -1
  49. package/es/toNumber.js +1 -1
  50. package/es/toUinteger32.js +0 -1
  51. package/lib/anyP.js +1 -2
  52. package/lib/copyKeys.js +2 -4
  53. package/lib/fantasy-land/Identity.js +1 -2
  54. package/lib/fantasy-land/traits.js +1 -2
  55. package/lib/index.js +4 -4
  56. package/lib/internal/ap.js +2 -3
  57. package/lib/internal/ponyfills/Math.trunc.js +0 -2
  58. package/lib/internal/ponyfills/Number.isFinite.js +0 -1
  59. package/lib/internal/ponyfills/Number.isNaN.js +0 -1
  60. package/lib/internal/ponyfills/Promise.any.js +1 -1
  61. package/lib/internal/ponyfills/String.padEnd.js +0 -1
  62. package/lib/internal/ponyfills/String.padStart.js +0 -1
  63. package/lib/internal/ponyfills/String.repeat.js +1 -1
  64. package/lib/isArrayLike.js +1 -2
  65. package/lib/isCoercible.js +35 -0
  66. package/lib/isMap.js +3 -3
  67. package/lib/isNotAsyncFunction.js +1 -2
  68. package/lib/isNotFunction.js +1 -2
  69. package/lib/isNotGeneratorFunction.js +1 -2
  70. package/lib/isNotObj.js +1 -2
  71. package/lib/isNotObjLike.js +1 -2
  72. package/lib/isNotPlainObj.js +1 -2
  73. package/lib/isObj.js +1 -2
  74. package/lib/isObjLike.js +1 -2
  75. package/lib/isPlainObj.js +1 -2
  76. package/lib/isSentinelValue.js +1 -1
  77. package/lib/isValidDate.js +1 -2
  78. package/lib/lensTraverse.js +1 -2
  79. package/lib/mergeProp.js +2 -2
  80. package/lib/nand.js +1 -1
  81. package/lib/neither.js +1 -2
  82. package/lib/nor.js +1 -1
  83. package/lib/notBoth.js +1 -2
  84. package/lib/omitBy.js +1 -2
  85. package/lib/pathNotEq.js +1 -2
  86. package/lib/reduceP.js +0 -1
  87. package/lib/reduceRightP.js +0 -1
  88. package/lib/renameKey.js +1 -3
  89. package/lib/resolveP.js +1 -2
  90. package/lib/seq.js +0 -2
  91. package/lib/sortByProps.js +1 -1
  92. package/lib/stubUndefined.js +1 -1
  93. package/lib/toInteger32.js +1 -1
  94. package/lib/toNumber.js +1 -1
  95. package/lib/toUinteger32.js +0 -1
  96. package/package.json +63 -86
  97. package/types/index.d.ts +17 -21
  98. package/es/internal/isCoercible.js +0 -6
  99. package/es/renameKeys.js +0 -39
  100. package/lib/internal/isCoercible.js +0 -11
  101. package/lib/renameKeys.js +0 -44
@@ -1,6 +0,0 @@
1
- import { both, hasIn } from 'ramda';
2
- import isObj from '../isObj.js';
3
- import isSymbol from '../isSymbol.js';
4
- import neither from '../neither.js';
5
- var isCoercible = neither(isSymbol, both(isObj, neither(hasIn('toString'), hasIn('valueOf'))));
6
- export default isCoercible;
package/es/renameKeys.js DELETED
@@ -1,39 +0,0 @@
1
- import { curry, has } from 'ramda';
2
- import renameKeysWith from './renameKeysWith.js';
3
- var valueOrKey = function valueOrKey(keysMap) {
4
- return function (key) {
5
- if (has(key, keysMap)) {
6
- return keysMap[key];
7
- }
8
- return key;
9
- };
10
- };
11
-
12
- /**
13
- * Creates a new object with the own properties of the provided object, but the
14
- * keys renamed according to the keysMap object as `{oldKey: newKey}`.
15
- * When some key is not found in the keysMap, then it's passed as-is.
16
- *
17
- * Keep in mind that in the case of keys conflict is behaviour undefined and
18
- * the result may vary between various JS engines!
19
- *
20
- * @func renameKeys
21
- * @memberOf RA
22
- * @since {@link https://char0n.github.io/ramda-adjunct/1.5.0|v1.5.0}
23
- * @category Object
24
- * @sig {a: b} -> {a: *} -> {b: *}
25
- * @param {!Object} keysMap
26
- * @param {!Object} obj
27
- * @return {!Object} New object with renamed keys
28
- * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#rename-keys-of-an-object|Ramda Cookbook}, {@link RA.renameKeysWith|renameKeysWith}
29
- * @example
30
- *
31
- * const input = { firstName: 'Elisia', age: 22, type: 'human' };
32
- *
33
- * RA.renameKeys({ firstName: 'name', type: 'kind', foo: 'bar' })(input);
34
- * //=> { name: 'Elisia', age: 22, kind: 'human' }
35
- */
36
- var renameKeys = curry(function (keysMap, obj) {
37
- return renameKeysWith(valueOrKey(keysMap), obj);
38
- });
39
- export default renameKeys;
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports["default"] = void 0;
5
- var _ramda = require("ramda");
6
- var _isObj = _interopRequireDefault(require("../isObj.js"));
7
- var _isSymbol = _interopRequireDefault(require("../isSymbol.js"));
8
- var _neither = _interopRequireDefault(require("../neither.js"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
- var isCoercible = (0, _neither["default"])(_isSymbol["default"], (0, _ramda.both)(_isObj["default"], (0, _neither["default"])((0, _ramda.hasIn)('toString'), (0, _ramda.hasIn)('valueOf'))));
11
- var _default = exports["default"] = isCoercible;
package/lib/renameKeys.js DELETED
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports["default"] = void 0;
5
- var _ramda = require("ramda");
6
- var _renameKeysWith = _interopRequireDefault(require("./renameKeysWith.js"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
8
- var valueOrKey = function valueOrKey(keysMap) {
9
- return function (key) {
10
- if ((0, _ramda.has)(key, keysMap)) {
11
- return keysMap[key];
12
- }
13
- return key;
14
- };
15
- };
16
-
17
- /**
18
- * Creates a new object with the own properties of the provided object, but the
19
- * keys renamed according to the keysMap object as `{oldKey: newKey}`.
20
- * When some key is not found in the keysMap, then it's passed as-is.
21
- *
22
- * Keep in mind that in the case of keys conflict is behaviour undefined and
23
- * the result may vary between various JS engines!
24
- *
25
- * @func renameKeys
26
- * @memberOf RA
27
- * @since {@link https://char0n.github.io/ramda-adjunct/1.5.0|v1.5.0}
28
- * @category Object
29
- * @sig {a: b} -> {a: *} -> {b: *}
30
- * @param {!Object} keysMap
31
- * @param {!Object} obj
32
- * @return {!Object} New object with renamed keys
33
- * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#rename-keys-of-an-object|Ramda Cookbook}, {@link RA.renameKeysWith|renameKeysWith}
34
- * @example
35
- *
36
- * const input = { firstName: 'Elisia', age: 22, type: 'human' };
37
- *
38
- * RA.renameKeys({ firstName: 'name', type: 'kind', foo: 'bar' })(input);
39
- * //=> { name: 'Elisia', age: 22, kind: 'human' }
40
- */
41
- var renameKeys = (0, _ramda.curry)(function (keysMap, obj) {
42
- return (0, _renameKeysWith["default"])(valueOrKey(keysMap), obj);
43
- });
44
- var _default = exports["default"] = renameKeys;