ramda-adjunct 2.36.0 → 3.2.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 +49 -0
- package/README.md +2 -2
- package/dist/RA.node.js +226 -210
- package/dist/RA.node.min.js +1 -1
- package/dist/RA.web.js +226 -210
- package/dist/RA.web.min.js +1 -1
- package/dist/RA.web.standalone.js +5993 -5468
- package/dist/RA.web.standalone.min.js +1 -1
- package/es/flattenPath.js +2 -2
- package/es/included.js +27 -0
- package/es/index.js +9 -12
- package/es/internal/ponyfills/Promise.any.js +3 -3
- package/es/isBlank.js +32 -0
- package/es/isUinteger32.js +29 -0
- 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/trimCharsEnd.js +2 -2
- package/es/trimCharsStart.js +2 -2
- package/lib/flattenPath.js +1 -1
- package/lib/included.js +33 -0
- package/lib/index.js +18 -21
- package/lib/internal/ponyfills/Promise.any.js +3 -3
- package/lib/isBlank.js +41 -0
- package/lib/isUinteger32.js +38 -0
- package/lib/mergePath.js +1 -5
- package/lib/omitIndexes.js +1 -1
- package/lib/pickIndexes.js +1 -1
- package/lib/sortByPaths.js +59 -0
- package/lib/spreadPath.js +1 -1
- package/lib/trimCharsEnd.js +2 -2
- package/lib/trimCharsStart.js +2 -2
- package/package.json +33 -49
- package/src/flattenPath.js +4 -2
- package/src/included.js +28 -0
- package/src/index.js +7 -10
- package/src/isBlank.js +33 -0
- package/src/isUinteger32.js +29 -0
- 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/trimCharsEnd.js +2 -2
- package/src/trimCharsStart.js +2 -2
- package/types/index.d.ts +21 -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/flattenPath.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pathOr, curry,
|
|
1
|
+
import { pathOr, curry, mergeRight } from 'ramda';
|
|
2
2
|
/**
|
|
3
3
|
* Flattens a property path so that its fields are spread out into the provided object.
|
|
4
4
|
* It's like {@link RA.spreadPath|spreadPath}, but preserves object under the property path.
|
|
@@ -22,6 +22,6 @@ import { pathOr, curry, merge } from 'ramda';
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
var flattenPath = curry(function (path, obj) {
|
|
25
|
-
return
|
|
25
|
+
return mergeRight(obj, pathOr({}, path, obj));
|
|
26
26
|
});
|
|
27
27
|
export default flattenPath;
|
package/es/included.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { flip, includes } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the specified value is equal, in R.equals terms,
|
|
4
|
+
* to at least one element of the given list or false otherwise.
|
|
5
|
+
* Given list can be a string.
|
|
6
|
+
*
|
|
7
|
+
* Like {@link http://ramdajs.com/docs/#includes|R.includes} but with argument order reversed.
|
|
8
|
+
*
|
|
9
|
+
* @func included
|
|
10
|
+
* @memberOf RA
|
|
11
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.0.0|v3.0.0}
|
|
12
|
+
* @category List
|
|
13
|
+
* @sig [a] -> a -> Boolean
|
|
14
|
+
* @param {Array|String} list The list to consider
|
|
15
|
+
* @param {*} a The item to compare against
|
|
16
|
+
* @return {boolean} Returns Boolean `true` if an equivalent item is in the list or `false` otherwise
|
|
17
|
+
* @see {@link http://ramdajs.com/docs/#includes|R.includes}
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* RA.included([1, 2, 3], 3); //=> true
|
|
21
|
+
* RA.included([1, 2, 3], 4); //=> false
|
|
22
|
+
* RA.included([{ name: 'Fred' }], { name: 'Fred' }); //=> true
|
|
23
|
+
* RA.included([[42]], [42]); //=> true
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var included = flip(includes);
|
|
27
|
+
export default included;
|
package/es/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export { default as isNotAsyncFunction } from './isNotAsyncFunction';
|
|
|
28
28
|
export { default as isFunction } from './isFunction';
|
|
29
29
|
export { default as isNotFunction } from './isNotFunction';
|
|
30
30
|
export { default as isObj } from './isObj';
|
|
31
|
-
export { default as isObject } from './isObj'; // alias of
|
|
31
|
+
export { default as isObject } from './isObj'; // alias of isObj
|
|
32
32
|
|
|
33
33
|
export { default as isNotObj } from './isNotObj';
|
|
34
34
|
export { default as isNotObject } from './isNotObj'; // alias of isNotObj
|
|
@@ -42,7 +42,7 @@ export { default as isNotObjectLike } from './isNotObjLike'; // alias of isNotOb
|
|
|
42
42
|
export { default as isPlainObj } from './isPlainObj';
|
|
43
43
|
export { default as isPlainObject } from './isPlainObj';
|
|
44
44
|
export { default as isNotPlainObj } from './isNotPlainObj';
|
|
45
|
-
export { default as isNotPlainObject } from './isNotPlainObj'; // alias of
|
|
45
|
+
export { default as isNotPlainObject } from './isNotPlainObj'; // alias of isNotPlainObj
|
|
46
46
|
|
|
47
47
|
export { default as isDate } from './isDate';
|
|
48
48
|
export { default as isNotDate } from './isNotDate';
|
|
@@ -69,6 +69,9 @@ export { default as isInteger } from './isInteger';
|
|
|
69
69
|
export { default as isInteger32 } from './isInteger32';
|
|
70
70
|
export { default as isInt32 } from './isInteger32'; // alias of isInteger32
|
|
71
71
|
|
|
72
|
+
export { default as isUinteger32 } from './isUinteger32';
|
|
73
|
+
export { default as isUint32 } from './isUinteger32'; // alias of isUinteger32
|
|
74
|
+
|
|
72
75
|
export { default as isNotInteger } from './isNotInteger';
|
|
73
76
|
export { default as isBigInt } from './isBigInt';
|
|
74
77
|
export { default as isFloat } from './isFloat';
|
|
@@ -97,7 +100,8 @@ export { default as isError } from './isError';
|
|
|
97
100
|
export { default as isNaturalNumber } from './isNaturalNumber';
|
|
98
101
|
export { default as isPrimitive } from './isPrimitive';
|
|
99
102
|
export { default as isNotPrimitive } from './isNotPrimitive';
|
|
100
|
-
export { default as isSentinelValue } from './isSentinelValue';
|
|
103
|
+
export { default as isSentinelValue } from './isSentinelValue';
|
|
104
|
+
export { default as isBlank } from './isBlank'; // Function
|
|
101
105
|
|
|
102
106
|
export { default as stubUndefined } from './stubUndefined';
|
|
103
107
|
export { default as stubNull } from './stubNull';
|
|
@@ -119,9 +123,6 @@ export { default as noneP } from './noneP';
|
|
|
119
123
|
export { default as resolveP } from './resolveP';
|
|
120
124
|
export { default as rejectP } from './rejectP';
|
|
121
125
|
export { default as delayP } from './delayP';
|
|
122
|
-
export { default as thenP } from './thenP';
|
|
123
|
-
export { default as then } from './thenP'; // eslint-disable-line no-restricted-exports
|
|
124
|
-
|
|
125
126
|
export { default as thenCatchP } from './thenCatchP';
|
|
126
127
|
export { default as allSettledP } from './allSettledP';
|
|
127
128
|
export { default as Y } from './Y';
|
|
@@ -150,8 +151,7 @@ export { default as sliceTo } from './sliceTo';
|
|
|
150
151
|
export { default as omitIndexes } from './omitIndexes';
|
|
151
152
|
export { default as compact } from './compact';
|
|
152
153
|
export { default as appendFlipped } from './appendFlipped';
|
|
153
|
-
export { default as
|
|
154
|
-
export { default as included } from './contained';
|
|
154
|
+
export { default as included } from './included';
|
|
155
155
|
export { default as move } from './move';
|
|
156
156
|
export { default as lengthGt } from './lengthGt';
|
|
157
157
|
export { default as lengthLt } from './lengthLt';
|
|
@@ -169,6 +169,7 @@ export { default as toArray } from './toArray';
|
|
|
169
169
|
export { default as allUnique } from './allUnique';
|
|
170
170
|
export { default as notAllUnique } from './notAllUnique';
|
|
171
171
|
export { default as sortByProps } from './sortByProps';
|
|
172
|
+
export { default as sortByPaths } from './sortByPaths';
|
|
172
173
|
export { default as skipTake } from './skipTake';
|
|
173
174
|
export { default as rangeStep } from './rangeStep';
|
|
174
175
|
export { default as findOr } from './findOr'; // Object
|
|
@@ -180,9 +181,6 @@ export { default as renameKeys } from './renameKeys';
|
|
|
180
181
|
export { default as renameKeysWith } from './renameKeysWith';
|
|
181
182
|
export { default as renameKeyWith } from './renameKeyWith';
|
|
182
183
|
export { default as copyKeys } from './copyKeys';
|
|
183
|
-
export { default as mergeRight } from './mergeRight';
|
|
184
|
-
export { default as mergeLeft } from './mergeRight';
|
|
185
|
-
export { default as resetToDefault } from './mergeRight';
|
|
186
184
|
export { default as mergeProps } from './mergeProps';
|
|
187
185
|
export { default as mergePaths } from './mergePaths';
|
|
188
186
|
export { default as mergeProp } from './mergeProp';
|
|
@@ -190,7 +188,6 @@ export { default as mergePath } from './mergePath';
|
|
|
190
188
|
export { default as omitBy } from './omitBy';
|
|
191
189
|
export { default as pathOrLazy } from './pathOrLazy';
|
|
192
190
|
export { default as viewOr } from './viewOr';
|
|
193
|
-
export { default as hasPath } from './hasPath';
|
|
194
191
|
export { default as spreadProp } from './spreadProp';
|
|
195
192
|
export { default as spreadPath } from './spreadPath';
|
|
196
193
|
export { default as flattenProp } from './flattenProp';
|
|
@@ -28,15 +28,15 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
28
28
|
|
|
29
29
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
30
30
|
|
|
31
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
31
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
32
32
|
|
|
33
33
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
34
|
|
|
35
35
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
36
36
|
|
|
37
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
37
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
38
38
|
|
|
39
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
40
40
|
|
|
41
41
|
import { map } from 'ramda';
|
|
42
42
|
import resolveP from '../../resolveP';
|
package/es/isBlank.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isEmpty, isNil, anyPass, test } from 'ramda';
|
|
2
|
+
import isFalse from './isFalse';
|
|
3
|
+
/**
|
|
4
|
+
* Returns `true` if the given value is its type's empty value, `false`, `undefined`
|
|
5
|
+
* as well as strings containing only whitespace characters; `false` otherwise.
|
|
6
|
+
*
|
|
7
|
+
* @func isBlank
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.1.0|v3.1.0}
|
|
10
|
+
* @category Type
|
|
11
|
+
* @sig * -> Boolean
|
|
12
|
+
* @param {*} val The value to test
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
* @see {@link https://blog.appsignal.com/2018/09/11/differences-between-nil-empty-blank-and-present.html|Differences Between #nil?, #empty?, #blank?, and #present?}
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* RA.isBlank(''); //=> true
|
|
18
|
+
* RA.isBlank(' '); //=> true
|
|
19
|
+
* RA.isBlank('\t\n'); //=> true
|
|
20
|
+
* RA.isBlank({}); //=> true
|
|
21
|
+
* RA.isBlank(null); //=> true
|
|
22
|
+
* RA.isBlank(undefined); //=> true
|
|
23
|
+
* RA.isBlank([]); //=> true
|
|
24
|
+
* RA.isBlank(false); //=> true
|
|
25
|
+
* RA.isBlank('value'); //=> false
|
|
26
|
+
* RA.isBlank({ foo: 'foo' }); //=> false
|
|
27
|
+
* RA.isBlank([1, 2, 3]); //=> false
|
|
28
|
+
* RA.isBlank(true); //=> false
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
var isBlank = anyPass([isFalse, isNil, isEmpty, test(/^\s+$/gm)]);
|
|
32
|
+
export default isBlank;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { curryN } from 'ramda';
|
|
2
|
+
import toUinteger32 from './toUinteger32';
|
|
3
|
+
/**
|
|
4
|
+
* Checks whether the passed value is an unsigned 32 bit integer.
|
|
5
|
+
*
|
|
6
|
+
* @func isUinteger32
|
|
7
|
+
* @aliases isUint32
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.2.0|v3.2.0}
|
|
10
|
+
* @category Type
|
|
11
|
+
* @sig * -> Boolean
|
|
12
|
+
* @param {*} val The value to test
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
* @see {@link RA.toUinteger32|toUinteger32}
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* RA.isUinteger32(0); //=> true
|
|
18
|
+
* RA.isUinteger32(2 ** 32 - 1); //=> true
|
|
19
|
+
*
|
|
20
|
+
* RA.isUinteger32(Infinity); //=> false
|
|
21
|
+
* RA.isUinteger32(NaN); //=> false
|
|
22
|
+
* RA.isUinteger32(-1); //=> false
|
|
23
|
+
* RA.isUinteger32(2 ** 32); //=> false
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var isUinteger32 = curryN(1, function (val) {
|
|
27
|
+
return toUinteger32(val) === val;
|
|
28
|
+
});
|
|
29
|
+
export default isUinteger32;
|
package/es/mergePath.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { curry, over, lensPath } from 'ramda';
|
|
2
|
-
import mergeRight from './mergeRight';
|
|
1
|
+
import { curry, over, lensPath, mergeLeft } from 'ramda';
|
|
3
2
|
/**
|
|
4
3
|
* Create a new object with the own properties of the object under the `path`
|
|
5
4
|
* merged with the own properties of the provided `source`.
|
|
@@ -25,6 +24,6 @@ import mergeRight from './mergeRight';
|
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
26
|
var mergePath = curry(function (path, source, obj) {
|
|
28
|
-
return over(lensPath(path),
|
|
27
|
+
return over(lensPath(path), mergeLeft(source), obj);
|
|
29
28
|
});
|
|
30
29
|
export default mergePath;
|
package/es/omitIndexes.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { includes, curry, addIndex, reject } from 'ramda'; // helpers
|
|
2
2
|
|
|
3
3
|
var rejectIndexed = addIndex(reject);
|
|
4
4
|
var containsIndex = curry(function (indexes, val, index) {
|
|
5
|
-
return
|
|
5
|
+
return includes(index, indexes);
|
|
6
6
|
});
|
|
7
7
|
/**
|
|
8
8
|
* Returns a partial copy of an array omitting the indexes specified.
|
package/es/pickIndexes.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { filter, addIndex, curry,
|
|
1
|
+
import { filter, addIndex, curry, includes } from 'ramda'; // helpers
|
|
2
2
|
|
|
3
3
|
var filterIndexed = addIndex(filter);
|
|
4
4
|
var containsIndex = curry(function (indexes, val, index) {
|
|
5
|
-
return
|
|
5
|
+
return includes(index, indexes);
|
|
6
6
|
});
|
|
7
7
|
/**
|
|
8
8
|
* Picks values from list by indexes.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ascend, identity, map, path, pipe, sortWith, useWith } from 'ramda';
|
|
2
|
+
var pathToAscendSort = pipe(path, ascend);
|
|
3
|
+
var mapPathsToAscendSort = map(pathToAscendSort);
|
|
4
|
+
/**
|
|
5
|
+
* Sort a list of objects by a list of paths (if first path value is equivalent, sort by second, etc).
|
|
6
|
+
*
|
|
7
|
+
* @func sortByPaths
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.1.0|v3.1.0}
|
|
10
|
+
* @category List
|
|
11
|
+
* @sig [[k]] -> [{k: v}] -> [{k: v}]
|
|
12
|
+
* @param {Array.<Array.<string>>} paths A list of paths in the list param to sort by
|
|
13
|
+
* @param {Array.<object>} list A list of objects to be sorted
|
|
14
|
+
* @return {Array.<object>} A new list sorted by the paths in the paths param
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* const alice = {
|
|
18
|
+
* name: 'Alice',
|
|
19
|
+
* address: {
|
|
20
|
+
* street: 31,
|
|
21
|
+
* zipCode: 97777,
|
|
22
|
+
* },
|
|
23
|
+
* };
|
|
24
|
+
* const bob = {
|
|
25
|
+
* name: 'Bob',
|
|
26
|
+
* address: {
|
|
27
|
+
* street: 31,
|
|
28
|
+
* zipCode: 55555,
|
|
29
|
+
* },
|
|
30
|
+
* };
|
|
31
|
+
* const clara = {
|
|
32
|
+
* name: 'Clara',
|
|
33
|
+
* address: {
|
|
34
|
+
* street: 32,
|
|
35
|
+
* zipCode: 90210,
|
|
36
|
+
* },
|
|
37
|
+
* };
|
|
38
|
+
* const people = [clara, bob, alice]
|
|
39
|
+
*
|
|
40
|
+
* RA.sortByPaths([
|
|
41
|
+
* ['address', 'street'],
|
|
42
|
+
* ['address', 'zipCode'],
|
|
43
|
+
* ], people); // => [bob, alice, clara]
|
|
44
|
+
*
|
|
45
|
+
* RA.sortByPaths([
|
|
46
|
+
* ['address', 'zipCode'],
|
|
47
|
+
* ['address', 'street'],
|
|
48
|
+
* ], people); // => [bob, clara, alice]
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
var sortByPaths = useWith(sortWith, [mapPathsToAscendSort, identity]);
|
|
52
|
+
export default sortByPaths;
|
package/es/spreadPath.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { curryN, converge,
|
|
1
|
+
import { curryN, converge, mergeRight, dissocPath, pathOr } from 'ramda';
|
|
2
2
|
/**
|
|
3
3
|
* Spreads object under property path onto provided object.
|
|
4
4
|
* It's like {@link RA.flattenPath|flattenPath}, but removes object under the property path.
|
|
@@ -21,5 +21,5 @@ import { curryN, converge, merge, dissocPath, pathOr } from 'ramda';
|
|
|
21
21
|
* ); // => { a: 1, c: 3, d: 4, b1: {} };
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
var spreadPath = curryN(2, converge(
|
|
24
|
+
var spreadPath = curryN(2, converge(mergeRight, [dissocPath, pathOr({})]));
|
|
25
25
|
export default spreadPath;
|
package/es/trimCharsEnd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { curry, dropLastWhile, join, pipe, split } from 'ramda';
|
|
2
|
-
import
|
|
2
|
+
import included from './included';
|
|
3
3
|
/**
|
|
4
4
|
* Removes specified characters from the end of a string.
|
|
5
5
|
*
|
|
@@ -17,6 +17,6 @@ import contained from './contained';
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
var trimCharsEnd = curry(function (chars, value) {
|
|
20
|
-
return pipe(split(''), dropLastWhile(
|
|
20
|
+
return pipe(split(''), dropLastWhile(included(chars)), join(''))(value);
|
|
21
21
|
});
|
|
22
22
|
export default trimCharsEnd;
|
package/es/trimCharsStart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { curry, dropWhile, join, pipe, split } from 'ramda';
|
|
2
|
-
import
|
|
2
|
+
import included from './included';
|
|
3
3
|
/**
|
|
4
4
|
* Removes specified characters from the beginning of a string.
|
|
5
5
|
*
|
|
@@ -17,6 +17,6 @@ import contained from './contained';
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
var trimCharsStart = curry(function (chars, value) {
|
|
20
|
-
return pipe(split(''), dropWhile(
|
|
20
|
+
return pipe(split(''), dropWhile(included(chars)), join(''))(value);
|
|
21
21
|
});
|
|
22
22
|
export default trimCharsStart;
|
package/lib/flattenPath.js
CHANGED
|
@@ -27,7 +27,7 @@ var _ramda = require("ramda");
|
|
|
27
27
|
* ); // => { a: 1, c: 3, d: 4, b1: { b2: { c: 3, d: 4 } } };
|
|
28
28
|
*/
|
|
29
29
|
var flattenPath = (0, _ramda.curry)(function (path, obj) {
|
|
30
|
-
return (0, _ramda.
|
|
30
|
+
return (0, _ramda.mergeRight)(obj, (0, _ramda.pathOr)({}, path, obj));
|
|
31
31
|
});
|
|
32
32
|
var _default = flattenPath;
|
|
33
33
|
exports["default"] = _default;
|
package/lib/included.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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/#includes|R.includes} but with argument order reversed.
|
|
14
|
+
*
|
|
15
|
+
* @func included
|
|
16
|
+
* @memberOf RA
|
|
17
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.0.0|v3.0.0}
|
|
18
|
+
* @category List
|
|
19
|
+
* @sig [a] -> a -> Boolean
|
|
20
|
+
* @param {Array|String} list The list to consider
|
|
21
|
+
* @param {*} a The item to compare against
|
|
22
|
+
* @return {boolean} Returns Boolean `true` if an equivalent item is in the list or `false` otherwise
|
|
23
|
+
* @see {@link http://ramdajs.com/docs/#includes|R.includes}
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* RA.included([1, 2, 3], 3); //=> true
|
|
27
|
+
* RA.included([1, 2, 3], 4); //=> false
|
|
28
|
+
* RA.included([{ name: 'Fred' }], { name: 'Fred' }); //=> true
|
|
29
|
+
* RA.included([[42]], [42]); //=> true
|
|
30
|
+
*/
|
|
31
|
+
var included = (0, _ramda.flip)(_ramda.includes);
|
|
32
|
+
var _default = included;
|
|
33
|
+
exports["default"] = _default;
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
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.isBigInt = exports.isAsyncFunction = exports.isArrayLike = exports.isArray = exports.invokeArgs = exports.invoke = exports.included = exports.inRange = exports.
|
|
5
|
-
exports.sortByProps = exports.sliceTo = exports.sliceFrom = exports.skipTake = exports.sign = exports.sequencing = exports.seq = exports.round = exports.resolveP = exports.
|
|
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.
|
|
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.spreadPath = exports.sortByProps = 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 = void 0;
|
|
7
7
|
|
|
8
8
|
var _isNotUndefined = _interopRequireDefault(require("./isNotUndefined"));
|
|
9
9
|
|
|
@@ -221,6 +221,11 @@ var _isInteger2 = _interopRequireDefault(require("./isInteger32"));
|
|
|
221
221
|
exports.isInteger32 = _isInteger2["default"];
|
|
222
222
|
exports.isInt32 = _isInteger2["default"];
|
|
223
223
|
|
|
224
|
+
var _isUinteger = _interopRequireDefault(require("./isUinteger32"));
|
|
225
|
+
|
|
226
|
+
exports.isUinteger32 = _isUinteger["default"];
|
|
227
|
+
exports.isUint32 = _isUinteger["default"];
|
|
228
|
+
|
|
224
229
|
var _isNotInteger = _interopRequireDefault(require("./isNotInteger"));
|
|
225
230
|
|
|
226
231
|
exports.isNotInteger = _isNotInteger["default"];
|
|
@@ -337,6 +342,10 @@ var _isSentinelValue = _interopRequireDefault(require("./isSentinelValue"));
|
|
|
337
342
|
|
|
338
343
|
exports.isSentinelValue = _isSentinelValue["default"];
|
|
339
344
|
|
|
345
|
+
var _isBlank = _interopRequireDefault(require("./isBlank"));
|
|
346
|
+
|
|
347
|
+
exports.isBlank = _isBlank["default"];
|
|
348
|
+
|
|
340
349
|
var _stubUndefined = _interopRequireDefault(require("./stubUndefined"));
|
|
341
350
|
|
|
342
351
|
exports.stubUndefined = _stubUndefined["default"];
|
|
@@ -414,11 +423,6 @@ var _delayP = _interopRequireDefault(require("./delayP"));
|
|
|
414
423
|
|
|
415
424
|
exports.delayP = _delayP["default"];
|
|
416
425
|
|
|
417
|
-
var _thenP = _interopRequireDefault(require("./thenP"));
|
|
418
|
-
|
|
419
|
-
exports.thenP = _thenP["default"];
|
|
420
|
-
exports.then = _thenP["default"];
|
|
421
|
-
|
|
422
426
|
var _thenCatchP = _interopRequireDefault(require("./thenCatchP"));
|
|
423
427
|
|
|
424
428
|
exports.thenCatchP = _thenCatchP["default"];
|
|
@@ -517,10 +521,9 @@ var _appendFlipped = _interopRequireDefault(require("./appendFlipped"));
|
|
|
517
521
|
|
|
518
522
|
exports.appendFlipped = _appendFlipped["default"];
|
|
519
523
|
|
|
520
|
-
var
|
|
524
|
+
var _included = _interopRequireDefault(require("./included"));
|
|
521
525
|
|
|
522
|
-
exports.
|
|
523
|
-
exports.included = _contained["default"];
|
|
526
|
+
exports.included = _included["default"];
|
|
524
527
|
|
|
525
528
|
var _move = _interopRequireDefault(require("./move"));
|
|
526
529
|
|
|
@@ -590,6 +593,10 @@ var _sortByProps = _interopRequireDefault(require("./sortByProps"));
|
|
|
590
593
|
|
|
591
594
|
exports.sortByProps = _sortByProps["default"];
|
|
592
595
|
|
|
596
|
+
var _sortByPaths = _interopRequireDefault(require("./sortByPaths"));
|
|
597
|
+
|
|
598
|
+
exports.sortByPaths = _sortByPaths["default"];
|
|
599
|
+
|
|
593
600
|
var _skipTake = _interopRequireDefault(require("./skipTake"));
|
|
594
601
|
|
|
595
602
|
exports.skipTake = _skipTake["default"];
|
|
@@ -630,12 +637,6 @@ var _copyKeys = _interopRequireDefault(require("./copyKeys"));
|
|
|
630
637
|
|
|
631
638
|
exports.copyKeys = _copyKeys["default"];
|
|
632
639
|
|
|
633
|
-
var _mergeRight = _interopRequireDefault(require("./mergeRight"));
|
|
634
|
-
|
|
635
|
-
exports.mergeRight = _mergeRight["default"];
|
|
636
|
-
exports.mergeLeft = _mergeRight["default"];
|
|
637
|
-
exports.resetToDefault = _mergeRight["default"];
|
|
638
|
-
|
|
639
640
|
var _mergeProps = _interopRequireDefault(require("./mergeProps"));
|
|
640
641
|
|
|
641
642
|
exports.mergeProps = _mergeProps["default"];
|
|
@@ -664,10 +665,6 @@ var _viewOr = _interopRequireDefault(require("./viewOr"));
|
|
|
664
665
|
|
|
665
666
|
exports.viewOr = _viewOr["default"];
|
|
666
667
|
|
|
667
|
-
var _hasPath = _interopRequireDefault(require("./hasPath"));
|
|
668
|
-
|
|
669
|
-
exports.hasPath = _hasPath["default"];
|
|
670
|
-
|
|
671
668
|
var _spreadProp = _interopRequireDefault(require("./spreadProp"));
|
|
672
669
|
|
|
673
670
|
exports.spreadProp = _spreadProp["default"];
|
|
@@ -39,15 +39,15 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
39
39
|
|
|
40
40
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
41
41
|
|
|
42
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
42
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
43
43
|
|
|
44
44
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
45
|
|
|
46
46
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
47
47
|
|
|
48
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
48
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
49
|
|
|
50
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
51
|
|
|
52
52
|
var AggregatedError = /*#__PURE__*/function (_Error) {
|
|
53
53
|
_inherits(AggregatedError, _Error);
|
package/lib/isBlank.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _ramda = require("ramda");
|
|
7
|
+
|
|
8
|
+
var _isFalse = _interopRequireDefault(require("./isFalse"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns `true` if the given value is its type's empty value, `false`, `undefined`
|
|
14
|
+
* as well as strings containing only whitespace characters; `false` otherwise.
|
|
15
|
+
*
|
|
16
|
+
* @func isBlank
|
|
17
|
+
* @memberOf RA
|
|
18
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.1.0|v3.1.0}
|
|
19
|
+
* @category Type
|
|
20
|
+
* @sig * -> Boolean
|
|
21
|
+
* @param {*} val The value to test
|
|
22
|
+
* @return {boolean}
|
|
23
|
+
* @see {@link https://blog.appsignal.com/2018/09/11/differences-between-nil-empty-blank-and-present.html|Differences Between #nil?, #empty?, #blank?, and #present?}
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* RA.isBlank(''); //=> true
|
|
27
|
+
* RA.isBlank(' '); //=> true
|
|
28
|
+
* RA.isBlank('\t\n'); //=> true
|
|
29
|
+
* RA.isBlank({}); //=> true
|
|
30
|
+
* RA.isBlank(null); //=> true
|
|
31
|
+
* RA.isBlank(undefined); //=> true
|
|
32
|
+
* RA.isBlank([]); //=> true
|
|
33
|
+
* RA.isBlank(false); //=> true
|
|
34
|
+
* RA.isBlank('value'); //=> false
|
|
35
|
+
* RA.isBlank({ foo: 'foo' }); //=> false
|
|
36
|
+
* RA.isBlank([1, 2, 3]); //=> false
|
|
37
|
+
* RA.isBlank(true); //=> false
|
|
38
|
+
*/
|
|
39
|
+
var isBlank = (0, _ramda.anyPass)([_isFalse["default"], _ramda.isNil, _ramda.isEmpty, (0, _ramda.test)(/^\s+$/gm)]);
|
|
40
|
+
var _default = isBlank;
|
|
41
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
|
|
6
|
+
var _ramda = require("ramda");
|
|
7
|
+
|
|
8
|
+
var _toUinteger = _interopRequireDefault(require("./toUinteger32"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Checks whether the passed value is an unsigned 32 bit integer.
|
|
14
|
+
*
|
|
15
|
+
* @func isUinteger32
|
|
16
|
+
* @aliases isUint32
|
|
17
|
+
* @memberOf RA
|
|
18
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.2.0|v3.2.0}
|
|
19
|
+
* @category Type
|
|
20
|
+
* @sig * -> Boolean
|
|
21
|
+
* @param {*} val The value to test
|
|
22
|
+
* @return {boolean}
|
|
23
|
+
* @see {@link RA.toUinteger32|toUinteger32}
|
|
24
|
+
* @example
|
|
25
|
+
*
|
|
26
|
+
* RA.isUinteger32(0); //=> true
|
|
27
|
+
* RA.isUinteger32(2 ** 32 - 1); //=> true
|
|
28
|
+
*
|
|
29
|
+
* RA.isUinteger32(Infinity); //=> false
|
|
30
|
+
* RA.isUinteger32(NaN); //=> false
|
|
31
|
+
* RA.isUinteger32(-1); //=> false
|
|
32
|
+
* RA.isUinteger32(2 ** 32); //=> false
|
|
33
|
+
*/
|
|
34
|
+
var isUinteger32 = (0, _ramda.curryN)(1, function (val) {
|
|
35
|
+
return (0, _toUinteger["default"])(val) === val;
|
|
36
|
+
});
|
|
37
|
+
var _default = isUinteger32;
|
|
38
|
+
exports["default"] = _default;
|
package/lib/mergePath.js
CHANGED
|
@@ -5,10 +5,6 @@ exports["default"] = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _ramda = require("ramda");
|
|
7
7
|
|
|
8
|
-
var _mergeRight = _interopRequireDefault(require("./mergeRight"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Create a new object with the own properties of the object under the `path`
|
|
14
10
|
* merged with the own properties of the provided `source`.
|
|
@@ -33,7 +29,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
33
29
|
* ); //=> { outer: { inner: { foo: 3, bar: 4 } }
|
|
34
30
|
*/
|
|
35
31
|
var mergePath = (0, _ramda.curry)(function (path, source, obj) {
|
|
36
|
-
return (0, _ramda.over)((0, _ramda.lensPath)(path), (0,
|
|
32
|
+
return (0, _ramda.over)((0, _ramda.lensPath)(path), (0, _ramda.mergeLeft)(source), obj);
|
|
37
33
|
});
|
|
38
34
|
var _default = mergePath;
|
|
39
35
|
exports["default"] = _default;
|