si-funciona 2.6.1 → 2.6.2
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/README.md +40 -10
- package/browser/siFunciona.js +18 -11
- package/dist/helpers/arrays/BasicQueue.d.ts +64 -64
- package/dist/helpers/arrays/BasicQueue.js +61 -61
- package/dist/helpers/arrays/addUniqueToArray.d.ts +9 -9
- package/dist/helpers/arrays/addUniqueToArray.js +16 -16
- package/dist/helpers/arrays/buildArray.d.ts +10 -10
- package/dist/helpers/arrays/buildArray.js +25 -25
- package/dist/helpers/arrays/buildArrayOfReferences.d.ts +10 -10
- package/dist/helpers/arrays/buildArrayOfReferences.js +22 -22
- package/dist/helpers/arrays/compareArrays.d.ts +96 -96
- package/dist/helpers/arrays/compareArrays.js +96 -96
- package/dist/helpers/arrays/mergeArrays.d.ts +8 -8
- package/dist/helpers/arrays/mergeArrays.js +21 -21
- package/dist/helpers/arrays/uniqueArray.d.ts +8 -8
- package/dist/helpers/arrays/uniqueArray.js +16 -16
- package/dist/helpers/arrays.d.ts +27 -27
- package/dist/helpers/arrays.js +74 -74
- package/dist/helpers/descriptors/assignDescriptor.d.ts +13 -13
- package/dist/helpers/descriptors/assignDescriptor.js +57 -57
- package/dist/helpers/descriptors/assignDescriptorDetail.d.ts +13 -13
- package/dist/helpers/descriptors/assignDescriptorDetail.js +36 -36
- package/dist/helpers/descriptors/checkClearValues.d.ts +11 -11
- package/dist/helpers/descriptors/checkClearValues.js +20 -20
- package/dist/helpers/descriptors/checkDescriptorComplete.d.ts +10 -10
- package/dist/helpers/descriptors/checkDescriptorComplete.js +19 -19
- package/dist/helpers/descriptors/cloneDescriptor.d.ts +9 -9
- package/dist/helpers/descriptors/cloneDescriptor.js +35 -35
- package/dist/helpers/descriptors/cloneDescriptorDetail.d.ts +9 -9
- package/dist/helpers/descriptors/cloneDescriptorDetail.js +26 -26
- package/dist/helpers/descriptors/compareDescriptor.d.ts +12 -12
- package/dist/helpers/descriptors/compareDescriptor.js +32 -32
- package/dist/helpers/descriptors/describeObject.d.ts +14 -14
- package/dist/helpers/descriptors/describeObject.js +52 -52
- package/dist/helpers/descriptors/describeObjectDetail.d.ts +13 -13
- package/dist/helpers/descriptors/describeObjectDetail.js +37 -37
- package/dist/helpers/descriptors/describeObjectMap.d.ts +35 -35
- package/dist/helpers/descriptors/describeObjectMap.js +107 -107
- package/dist/helpers/descriptors/nextReference.d.ts +12 -12
- package/dist/helpers/descriptors/nextReference.js +30 -30
- package/dist/helpers/descriptors/sameDescriptor.d.ts +12 -12
- package/dist/helpers/descriptors/sameDescriptor.js +21 -21
- package/dist/helpers/descriptors/samples/descriptor.d.ts +34 -34
- package/dist/helpers/descriptors/samples/descriptor.js +22 -22
- package/dist/helpers/descriptors/samples/descriptorDetail.d.ts +42 -42
- package/dist/helpers/descriptors/samples/descriptorDetail.js +24 -24
- package/dist/helpers/descriptors/samples/descriptorMap.d.ts +16 -16
- package/dist/helpers/descriptors/samples/descriptorMap.js +14 -14
- package/dist/helpers/descriptors/samples/mappedDescriptorMap.d.ts +10 -10
- package/dist/helpers/descriptors/samples/mappedDescriptorMap.js +287 -287
- package/dist/helpers/descriptors.d.ts +56 -56
- package/dist/helpers/descriptors.js +129 -129
- package/dist/helpers/functions/callWithParams.d.ts +10 -10
- package/dist/helpers/functions/callWithParams.js +16 -16
- package/dist/helpers/functions/curry.d.ts +10 -10
- package/dist/helpers/functions/curry.js +16 -16
- package/dist/helpers/functions/delay.d.ts +20 -20
- package/dist/helpers/functions/delay.js +31 -31
- package/dist/helpers/functions/makeBasicQueue.d.ts +9 -9
- package/dist/helpers/functions/makeBasicQueue.js +18 -18
- package/dist/helpers/functions/onBodyLoad.d.ts +9 -9
- package/dist/helpers/functions/onBodyLoad.js +75 -75
- package/dist/helpers/functions/pipe.d.ts +9 -9
- package/dist/helpers/functions/pipe.js +17 -17
- package/dist/helpers/functions/preloadParams.d.ts +19 -19
- package/dist/helpers/functions/preloadParams.js +20 -20
- package/dist/helpers/functions/queueManager.d.ts +48 -48
- package/dist/helpers/functions/queueManager.js +123 -123
- package/dist/helpers/functions/queueTimeout.d.ts +20 -20
- package/dist/helpers/functions/queueTimeout.js +22 -22
- package/dist/helpers/functions/relevancyFilter.d.ts +34 -34
- package/dist/helpers/functions/relevancyFilter.js +33 -33
- package/dist/helpers/functions/trace.d.ts +13 -13
- package/dist/helpers/functions/trace.js +24 -24
- package/dist/helpers/functions.d.ts +40 -40
- package/dist/helpers/functions.js +105 -105
- package/dist/helpers/numbers/absoluteMax.d.ts +9 -9
- package/dist/helpers/numbers/absoluteMax.js +15 -15
- package/dist/helpers/numbers/absoluteMin.d.ts +9 -9
- package/dist/helpers/numbers/absoluteMin.js +15 -15
- package/dist/helpers/numbers/compare.d.ts +12 -12
- package/dist/helpers/numbers/compare.js +18 -18
- package/dist/helpers/numbers/greatestCommonDivisor.d.ts +9 -9
- package/dist/helpers/numbers/greatestCommonDivisor.js +15 -15
- package/dist/helpers/numbers/leastCommonMultiple.d.ts +9 -9
- package/dist/helpers/numbers/leastCommonMultiple.js +17 -17
- package/dist/helpers/numbers/lowestCommonDenominator.d.ts +9 -9
- package/dist/helpers/numbers/lowestCommonDenominator.js +19 -19
- package/dist/helpers/numbers/randomInteger.d.ts +11 -5
- package/dist/helpers/numbers/randomInteger.js +11 -5
- package/dist/helpers/numbers/randomNumber.d.ts +7 -6
- package/dist/helpers/numbers/randomNumber.js +7 -6
- package/dist/helpers/numbers/simplestRatio.d.ts +8 -8
- package/dist/helpers/numbers/simplestRatio.js +28 -28
- package/dist/helpers/numbers.d.ts +30 -30
- package/dist/helpers/numbers.js +89 -89
- package/dist/helpers/objects/cloneObject.d.ts +19 -19
- package/dist/helpers/objects/cloneObject.js +31 -31
- package/dist/helpers/objects/dotGet.d.ts +11 -11
- package/dist/helpers/objects/dotGet.js +59 -59
- package/dist/helpers/objects/dotNotate.d.ts +27 -27
- package/dist/helpers/objects/dotNotate.js +79 -79
- package/dist/helpers/objects/dotSet.d.ts +11 -11
- package/dist/helpers/objects/dotSet.js +53 -53
- package/dist/helpers/objects/dotUnset.d.ts +10 -10
- package/dist/helpers/objects/dotUnset.js +52 -52
- package/dist/helpers/objects/emptyObject.d.ts +8 -8
- package/dist/helpers/objects/emptyObject.js +17 -17
- package/dist/helpers/objects/filterObject.d.ts +26 -26
- package/dist/helpers/objects/filterObject.js +33 -33
- package/dist/helpers/objects/isCloneable.d.ts +8 -8
- package/dist/helpers/objects/isCloneable.js +16 -16
- package/dist/helpers/objects/isEqual.d.ts +16 -16
- package/dist/helpers/objects/isEqual.js +100 -100
- package/dist/helpers/objects/isInstanceObject.d.ts +8 -8
- package/dist/helpers/objects/isInstanceObject.js +26 -26
- package/dist/helpers/objects/isObject.d.ts +8 -8
- package/dist/helpers/objects/isObject.js +14 -14
- package/dist/helpers/objects/mapObject.d.ts +25 -25
- package/dist/helpers/objects/mapObject.js +25 -25
- package/dist/helpers/objects/mergeObjects.d.ts +12 -12
- package/dist/helpers/objects/mergeObjects.js +19 -19
- package/dist/helpers/objects/mergeObjectsBase.d.ts +35 -35
- package/dist/helpers/objects/mergeObjectsBase.js +91 -91
- package/dist/helpers/objects/mergeObjectsMutable.d.ts +12 -12
- package/dist/helpers/objects/mergeObjectsMutable.js +17 -17
- package/dist/helpers/objects/objectKeys.d.ts +13 -13
- package/dist/helpers/objects/objectKeys.js +39 -39
- package/dist/helpers/objects/objectValues.d.ts +13 -13
- package/dist/helpers/objects/objectValues.js +20 -20
- package/dist/helpers/objects/reduceObject.d.ts +30 -30
- package/dist/helpers/objects/reduceObject.js +25 -25
- package/dist/helpers/objects/setAndReturnValue.d.ts +13 -13
- package/dist/helpers/objects/setAndReturnValue.js +19 -19
- package/dist/helpers/objects/setValue.d.ts +14 -14
- package/dist/helpers/objects/setValue.js +21 -21
- package/dist/helpers/objects.d.ts +121 -121
- package/dist/helpers/objects.js +177 -177
- package/dist/helpers/strings/camelCase.d.ts +8 -8
- package/dist/helpers/strings/camelCase.js +19 -19
- package/dist/helpers/strings/kabobCase.d.ts +8 -8
- package/dist/helpers/strings/kabobCase.js +18 -18
- package/dist/helpers/strings/makeFilepath.d.ts +9 -9
- package/dist/helpers/strings/makeFilepath.js +49 -49
- package/dist/helpers/strings/makeRelativePath.d.ts +9 -9
- package/dist/helpers/strings/makeRelativePath.js +43 -43
- package/dist/helpers/strings/regexEscape.d.ts +8 -8
- package/dist/helpers/strings/regexEscape.js +15 -15
- package/dist/helpers/strings/snakeCase.d.ts +8 -8
- package/dist/helpers/strings/snakeCase.js +18 -18
- package/dist/helpers/strings/strAfter.d.ts +9 -9
- package/dist/helpers/strings/strAfter.js +18 -18
- package/dist/helpers/strings/strAfterLast.d.ts +9 -9
- package/dist/helpers/strings/strAfterLast.js +18 -18
- package/dist/helpers/strings/strBefore.d.ts +9 -9
- package/dist/helpers/strings/strBefore.js +18 -18
- package/dist/helpers/strings/strBeforeLast.d.ts +9 -9
- package/dist/helpers/strings/strBeforeLast.js +18 -18
- package/dist/helpers/strings/titleCase.d.ts +8 -8
- package/dist/helpers/strings/titleCase.js +19 -19
- package/dist/helpers/strings/ucFirst.d.ts +8 -8
- package/dist/helpers/strings/ucFirst.js +14 -14
- package/dist/helpers/strings/words.d.ts +9 -9
- package/dist/helpers/strings/words.js +15 -15
- package/dist/helpers/strings.d.ts +38 -38
- package/dist/helpers/strings.js +121 -121
- package/dist/main.d.ts +15 -15
- package/dist/main.js +103 -103
- package/package.json +4 -4
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
require('core-js/modules/esnext.iterator.constructor.js')
|
|
8
|
-
require('core-js/modules/esnext.iterator.find.js')
|
|
9
|
-
require('core-js/modules/esnext.iterator.map.js')
|
|
10
|
-
require('core-js/modules/esnext.iterator.reduce.js')
|
|
11
|
-
const _isCloneable = _interopRequireDefault(require('./isCloneable'))
|
|
12
|
-
const _reduceObject = _interopRequireDefault(require('./reduceObject'))
|
|
13
|
-
const _relevancyFilter = _interopRequireDefault(require('../functions/relevancyFilter'))
|
|
14
|
-
const _setValue = _interopRequireDefault(require('./setValue'))
|
|
15
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
16
|
-
/**
|
|
17
|
-
* Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
|
|
18
|
-
* Objects having the same attributes will overwrite from last object to first.
|
|
19
|
-
* NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
|
|
20
|
-
* have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
|
|
21
|
-
* @memberOf module:objectHelpers
|
|
22
|
-
* @param {Object} [options={}]
|
|
23
|
-
* @param {number} [options.mapLimit=100] - Size of temporary reference array used in memory before assessing relevancy.
|
|
24
|
-
* @param {number} [options.depthLimit=-1] - Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited.
|
|
25
|
-
* @param {number} [options.relevancyRange=1000] - Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed.
|
|
26
|
-
* @param {Iterable|array} [options.map=[]] - A predetermined list of references gathered (to be passed to itself during recursion).
|
|
27
|
-
* @param {boolean} [options.useClone=false]
|
|
28
|
-
* @returns {module:objectHelpers~mergeObjectsCallback|mergeObjectsCallback}
|
|
29
|
-
*/
|
|
30
|
-
const mergeObjectsBase = ({
|
|
31
|
-
mapLimit = 100,
|
|
32
|
-
depthLimit = -1,
|
|
33
|
-
relevancyRange = 1000,
|
|
34
|
-
map = [],
|
|
35
|
-
useClone = false
|
|
36
|
-
} = {}) => (...objects) => {
|
|
37
|
-
const firstObject = useClone ? Array.isArray(objects[0]) ? [] : {} : objects.shift()
|
|
38
|
-
if (objects.length < 1) {
|
|
39
|
-
return firstObject
|
|
40
|
-
}
|
|
41
|
-
if (depthLimit === 0) {
|
|
42
|
-
return firstObject
|
|
43
|
-
}
|
|
44
|
-
return objects.reduce((newObj, arg) => {
|
|
45
|
-
if (!arg) {
|
|
46
|
-
return newObj
|
|
47
|
-
}
|
|
48
|
-
map.push({
|
|
49
|
-
source: arg,
|
|
50
|
-
object: newObj,
|
|
51
|
-
relevance: map.length
|
|
52
|
-
})
|
|
53
|
-
map = (0, _relevancyFilter.default)(map, {
|
|
54
|
-
mapLimit,
|
|
55
|
-
relevancyRange
|
|
56
|
-
})
|
|
57
|
-
return (0, _reduceObject.default)(arg, (returnObj, value, key) => {
|
|
58
|
-
if ((0, _isCloneable.default)(value)) {
|
|
59
|
-
let objectValue = newObj[key]
|
|
60
|
-
const exists = map.find(existing => existing.source === value)
|
|
61
|
-
if (exists) {
|
|
62
|
-
exists.relevance = map.length + 1
|
|
63
|
-
return (0, _setValue.default)(key, exists.object, returnObj)
|
|
64
|
-
}
|
|
65
|
-
if (!(0, _isCloneable.default)(objectValue) || !objectValue) {
|
|
66
|
-
objectValue = useClone ? Array.isArray(value) ? [] : {} : value
|
|
67
|
-
}
|
|
68
|
-
if ((0, _isCloneable.default)(objectValue)) {
|
|
69
|
-
return (0, _setValue.default)(key, mergeObjectsBase({
|
|
70
|
-
mapLimit,
|
|
71
|
-
depthLimit: depthLimit - 1,
|
|
72
|
-
relevancyRange,
|
|
73
|
-
map,
|
|
74
|
-
useClone
|
|
75
|
-
})(objectValue, value), returnObj)
|
|
76
|
-
}
|
|
77
|
-
map.push({
|
|
78
|
-
source: value,
|
|
79
|
-
object: objectValue,
|
|
80
|
-
relevance: map.length
|
|
81
|
-
})
|
|
82
|
-
map = (0, _relevancyFilter.default)(map, {
|
|
83
|
-
mapLimit,
|
|
84
|
-
relevancyRange
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
return (0, _setValue.default)(key, value, returnObj)
|
|
88
|
-
}, newObj)
|
|
89
|
-
}, firstObject || {})
|
|
90
|
-
}
|
|
91
|
-
const _default = exports.default = mergeObjectsBase
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
8
|
+
require('core-js/modules/esnext.iterator.find.js')
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js')
|
|
10
|
+
require('core-js/modules/esnext.iterator.reduce.js')
|
|
11
|
+
const _isCloneable = _interopRequireDefault(require('./isCloneable'))
|
|
12
|
+
const _reduceObject = _interopRequireDefault(require('./reduceObject'))
|
|
13
|
+
const _relevancyFilter = _interopRequireDefault(require('../functions/relevancyFilter'))
|
|
14
|
+
const _setValue = _interopRequireDefault(require('./setValue'))
|
|
15
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
16
|
+
/**
|
|
17
|
+
* Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
|
|
18
|
+
* Objects having the same attributes will overwrite from last object to first.
|
|
19
|
+
* NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
|
|
20
|
+
* have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
|
|
21
|
+
* @memberOf module:objectHelpers
|
|
22
|
+
* @param {Object} [options={}]
|
|
23
|
+
* @param {number} [options.mapLimit=100] - Size of temporary reference array used in memory before assessing relevancy.
|
|
24
|
+
* @param {number} [options.depthLimit=-1] - Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited.
|
|
25
|
+
* @param {number} [options.relevancyRange=1000] - Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed.
|
|
26
|
+
* @param {Iterable|array} [options.map=[]] - A predetermined list of references gathered (to be passed to itself during recursion).
|
|
27
|
+
* @param {boolean} [options.useClone=false]
|
|
28
|
+
* @returns {module:objectHelpers~mergeObjectsCallback|mergeObjectsCallback}
|
|
29
|
+
*/
|
|
30
|
+
const mergeObjectsBase = ({
|
|
31
|
+
mapLimit = 100,
|
|
32
|
+
depthLimit = -1,
|
|
33
|
+
relevancyRange = 1000,
|
|
34
|
+
map = [],
|
|
35
|
+
useClone = false
|
|
36
|
+
} = {}) => (...objects) => {
|
|
37
|
+
const firstObject = useClone ? Array.isArray(objects[0]) ? [] : {} : objects.shift()
|
|
38
|
+
if (objects.length < 1) {
|
|
39
|
+
return firstObject
|
|
40
|
+
}
|
|
41
|
+
if (depthLimit === 0) {
|
|
42
|
+
return firstObject
|
|
43
|
+
}
|
|
44
|
+
return objects.reduce((newObj, arg) => {
|
|
45
|
+
if (!arg) {
|
|
46
|
+
return newObj
|
|
47
|
+
}
|
|
48
|
+
map.push({
|
|
49
|
+
source: arg,
|
|
50
|
+
object: newObj,
|
|
51
|
+
relevance: map.length
|
|
52
|
+
})
|
|
53
|
+
map = (0, _relevancyFilter.default)(map, {
|
|
54
|
+
mapLimit,
|
|
55
|
+
relevancyRange
|
|
56
|
+
})
|
|
57
|
+
return (0, _reduceObject.default)(arg, (returnObj, value, key) => {
|
|
58
|
+
if ((0, _isCloneable.default)(value)) {
|
|
59
|
+
let objectValue = newObj[key]
|
|
60
|
+
const exists = map.find(existing => existing.source === value)
|
|
61
|
+
if (exists) {
|
|
62
|
+
exists.relevance = map.length + 1
|
|
63
|
+
return (0, _setValue.default)(key, exists.object, returnObj)
|
|
64
|
+
}
|
|
65
|
+
if (!(0, _isCloneable.default)(objectValue) || !objectValue) {
|
|
66
|
+
objectValue = useClone ? Array.isArray(value) ? [] : {} : value
|
|
67
|
+
}
|
|
68
|
+
if ((0, _isCloneable.default)(objectValue)) {
|
|
69
|
+
return (0, _setValue.default)(key, mergeObjectsBase({
|
|
70
|
+
mapLimit,
|
|
71
|
+
depthLimit: depthLimit - 1,
|
|
72
|
+
relevancyRange,
|
|
73
|
+
map,
|
|
74
|
+
useClone
|
|
75
|
+
})(objectValue, value), returnObj)
|
|
76
|
+
}
|
|
77
|
+
map.push({
|
|
78
|
+
source: value,
|
|
79
|
+
object: objectValue,
|
|
80
|
+
relevance: map.length
|
|
81
|
+
})
|
|
82
|
+
map = (0, _relevancyFilter.default)(map, {
|
|
83
|
+
mapLimit,
|
|
84
|
+
relevancyRange
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
return (0, _setValue.default)(key, value, returnObj)
|
|
88
|
+
}, newObj)
|
|
89
|
+
}, firstObject || {})
|
|
90
|
+
}
|
|
91
|
+
const _default = exports.default = mergeObjectsBase
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
|
|
3
|
-
* @memberOf module:objectHelpers
|
|
4
|
-
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
5
|
-
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
6
|
-
* @returns {*}
|
|
7
|
-
*/
|
|
8
|
-
declare const mergeObjectsMutable: (...objects: Array<Object>) => any[] | {
|
|
9
|
-
[k: string]: any;
|
|
10
|
-
[k: number]: any;
|
|
11
|
-
};
|
|
12
|
-
export default mergeObjectsMutable;
|
|
1
|
+
/**
|
|
2
|
+
* Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
|
|
3
|
+
* @memberOf module:objectHelpers
|
|
4
|
+
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
5
|
+
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
6
|
+
* @returns {*}
|
|
7
|
+
*/
|
|
8
|
+
declare const mergeObjectsMutable: (...objects: Array<Object>) => any[] | {
|
|
9
|
+
[k: string]: any;
|
|
10
|
+
[k: number]: any;
|
|
11
|
+
};
|
|
12
|
+
export default mergeObjectsMutable;
|
|
13
13
|
//# sourceMappingURL=mergeObjectsMutable.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
const _mergeObjectsBase = _interopRequireDefault(require('./mergeObjectsBase'))
|
|
8
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
9
|
-
/**
|
|
10
|
-
* Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
|
|
11
|
-
* @memberOf module:objectHelpers
|
|
12
|
-
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
13
|
-
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
14
|
-
* @returns {*}
|
|
15
|
-
*/
|
|
16
|
-
const mergeObjectsMutable = (0, _mergeObjectsBase.default)()
|
|
17
|
-
const _default = exports.default = mergeObjectsMutable
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
const _mergeObjectsBase = _interopRequireDefault(require('./mergeObjectsBase'))
|
|
8
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
9
|
+
/**
|
|
10
|
+
* Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
|
|
11
|
+
* @memberOf module:objectHelpers
|
|
12
|
+
* @see {@link module:objectHelpers~mergeObjectsCallback}
|
|
13
|
+
* @param {...Object} objects - Provide a list of objects which will be merged starting from the end up into the first
|
|
14
|
+
* @returns {*}
|
|
15
|
+
*/
|
|
16
|
+
const mergeObjectsMutable = (0, _mergeObjectsBase.default)()
|
|
17
|
+
const _default = exports.default = mergeObjectsMutable
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
type keyableItem = Array<any> | {
|
|
2
|
-
[k: number | string]: any;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
|
|
6
|
-
* Optional flag will include the inherited keys from prototype chain when set.
|
|
7
|
-
* @memberOf module:objectHelpers
|
|
8
|
-
* @param {Object|Array} object
|
|
9
|
-
* @param {boolean} [includeInherited=false]
|
|
10
|
-
* @returns {Array.<string|number>}
|
|
11
|
-
*/
|
|
12
|
-
declare const objectKeys: (object: keyableItem, includeInherited?: boolean) => Array<any>;
|
|
13
|
-
export default objectKeys;
|
|
1
|
+
type keyableItem = Array<any> | {
|
|
2
|
+
[k: number | string]: any;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
|
|
6
|
+
* Optional flag will include the inherited keys from prototype chain when set.
|
|
7
|
+
* @memberOf module:objectHelpers
|
|
8
|
+
* @param {Object|Array} object
|
|
9
|
+
* @param {boolean} [includeInherited=false]
|
|
10
|
+
* @returns {Array.<string|number>}
|
|
11
|
+
*/
|
|
12
|
+
declare const objectKeys: (object: keyableItem, includeInherited?: boolean) => Array<any>;
|
|
13
|
+
export default objectKeys;
|
|
14
14
|
//# sourceMappingURL=objectKeys.d.ts.map
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
const _isObject = _interopRequireDefault(require('./isObject'))
|
|
8
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
9
|
-
/**
|
|
10
|
-
* Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
|
|
11
|
-
* Optional flag will include the inherited keys from prototype chain when set.
|
|
12
|
-
* @memberOf module:objectHelpers
|
|
13
|
-
* @param {Object|Array} object
|
|
14
|
-
* @param {boolean} [includeInherited=false]
|
|
15
|
-
* @returns {Array.<string|number>}
|
|
16
|
-
*/
|
|
17
|
-
const objectKeys = (object, includeInherited = false) => {
|
|
18
|
-
if (typeof object !== 'function' && !(0, _isObject.default)(object)) {
|
|
19
|
-
return []
|
|
20
|
-
}
|
|
21
|
-
if (includeInherited) {
|
|
22
|
-
const propNames = Object.getOwnPropertyNames(object)
|
|
23
|
-
if (propNames.length) {
|
|
24
|
-
return propNames
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const keys = []
|
|
28
|
-
for (const key in object) {
|
|
29
|
-
if (includeInherited || Object.prototype.hasOwnProperty.call(object, key)) {
|
|
30
|
-
if (Array.isArray(object)) {
|
|
31
|
-
keys.push(parseInt(key))
|
|
32
|
-
continue
|
|
33
|
-
}
|
|
34
|
-
keys.push(key)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return keys
|
|
38
|
-
}
|
|
39
|
-
const _default = exports.default = objectKeys
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
const _isObject = _interopRequireDefault(require('./isObject'))
|
|
8
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
9
|
+
/**
|
|
10
|
+
* Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
|
|
11
|
+
* Optional flag will include the inherited keys from prototype chain when set.
|
|
12
|
+
* @memberOf module:objectHelpers
|
|
13
|
+
* @param {Object|Array} object
|
|
14
|
+
* @param {boolean} [includeInherited=false]
|
|
15
|
+
* @returns {Array.<string|number>}
|
|
16
|
+
*/
|
|
17
|
+
const objectKeys = (object, includeInherited = false) => {
|
|
18
|
+
if (typeof object !== 'function' && !(0, _isObject.default)(object)) {
|
|
19
|
+
return []
|
|
20
|
+
}
|
|
21
|
+
if (includeInherited) {
|
|
22
|
+
const propNames = Object.getOwnPropertyNames(object)
|
|
23
|
+
if (propNames.length) {
|
|
24
|
+
return propNames
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const keys = []
|
|
28
|
+
for (const key in object) {
|
|
29
|
+
if (includeInherited || Object.prototype.hasOwnProperty.call(object, key)) {
|
|
30
|
+
if (Array.isArray(object)) {
|
|
31
|
+
keys.push(parseInt(key))
|
|
32
|
+
continue
|
|
33
|
+
}
|
|
34
|
+
keys.push(key)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return keys
|
|
38
|
+
}
|
|
39
|
+
const _default = exports.default = objectKeys
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
type arrayObjectItem = Array<any> | {
|
|
2
|
-
[k: number | string]: any;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Get an array of values from any object or array. Will return empty array when invalid or there are no values.
|
|
6
|
-
* Optional flag will include the inherited values from prototype chain when set.
|
|
7
|
-
* @memberOf module:objectHelpers
|
|
8
|
-
* @param {Object|Array} object
|
|
9
|
-
* @param {boolean} [includeInherited=false]
|
|
10
|
-
* @returns {Array}
|
|
11
|
-
*/
|
|
12
|
-
declare const objectValues: (object: arrayObjectItem, includeInherited?: boolean) => Array<any>;
|
|
13
|
-
export default objectValues;
|
|
1
|
+
type arrayObjectItem = Array<any> | {
|
|
2
|
+
[k: number | string]: any;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Get an array of values from any object or array. Will return empty array when invalid or there are no values.
|
|
6
|
+
* Optional flag will include the inherited values from prototype chain when set.
|
|
7
|
+
* @memberOf module:objectHelpers
|
|
8
|
+
* @param {Object|Array} object
|
|
9
|
+
* @param {boolean} [includeInherited=false]
|
|
10
|
+
* @returns {Array}
|
|
11
|
+
*/
|
|
12
|
+
declare const objectValues: (object: arrayObjectItem, includeInherited?: boolean) => Array<any>;
|
|
13
|
+
export default objectValues;
|
|
14
14
|
//# sourceMappingURL=objectValues.d.ts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
require('core-js/modules/esnext.iterator.constructor.js')
|
|
8
|
-
require('core-js/modules/esnext.iterator.map.js')
|
|
9
|
-
const _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
10
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
11
|
-
/**
|
|
12
|
-
* Get an array of values from any object or array. Will return empty array when invalid or there are no values.
|
|
13
|
-
* Optional flag will include the inherited values from prototype chain when set.
|
|
14
|
-
* @memberOf module:objectHelpers
|
|
15
|
-
* @param {Object|Array} object
|
|
16
|
-
* @param {boolean} [includeInherited=false]
|
|
17
|
-
* @returns {Array}
|
|
18
|
-
*/
|
|
19
|
-
const objectValues = (object, includeInherited = false) => (0, _objectKeys.default)(object, includeInherited).map(key => object[key])
|
|
20
|
-
const _default = exports.default = objectValues
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.js')
|
|
9
|
+
const _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
10
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
11
|
+
/**
|
|
12
|
+
* Get an array of values from any object or array. Will return empty array when invalid or there are no values.
|
|
13
|
+
* Optional flag will include the inherited values from prototype chain when set.
|
|
14
|
+
* @memberOf module:objectHelpers
|
|
15
|
+
* @param {Object|Array} object
|
|
16
|
+
* @param {boolean} [includeInherited=false]
|
|
17
|
+
* @returns {Array}
|
|
18
|
+
*/
|
|
19
|
+
const objectValues = (object, includeInherited = false) => (0, _objectKeys.default)(object, includeInherited).map(key => object[key])
|
|
20
|
+
const _default = exports.default = objectValues
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
type reduceableItem = Array<any> | {
|
|
2
|
-
[k: number | string]: any;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Function to execute on each property in the object, taking four arguments
|
|
6
|
-
* @callback module:objectHelpers~reduceCallback
|
|
7
|
-
* @memberOf module:objectHelpers
|
|
8
|
-
* @param {*} [accumulator={}] - The accumulator accumulates the callback's return values; it is the accumulated
|
|
9
|
-
* value previously returned in the last invocation of the callback, or initialValue, if supplied (see below).
|
|
10
|
-
* @param {*} [currentProperty={}] - The current property being processed in the object.
|
|
11
|
-
* @param {string} [currentIndex=0] - The index of the current element being processed in the array. Starts at index
|
|
12
|
-
* 0, if an initialValue is provided, and at index 1 otherwise.
|
|
13
|
-
* @param {Object|Array} [object={}] - The object reduce was called upon.
|
|
14
|
-
* @returns {*}
|
|
15
|
-
*/
|
|
16
|
-
type reduceCallback = (accumulator: any, currentProperty: any, currentIndex: keyof reduceableItem, object: reduceableItem) => any;
|
|
17
|
-
/**
|
|
18
|
-
* This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
|
|
19
|
-
* If an array is passed in instead then it will perform standard reduce(). It is recommended to
|
|
20
|
-
* always use the standard reduce() function when it is known that the object is actually an array.
|
|
21
|
-
* @memberOf module:objectHelpers
|
|
22
|
-
* @param {Object|Array} obj - The Object (or Array) to be filtered
|
|
23
|
-
* @param {module:objectHelpers~reduceCallback|Function|reduceCallback} fn - The function to be processed for each filtered property
|
|
24
|
-
* @param {Object|Array} [initialValue] - Optional. Value to use as the first argument to the first call of the
|
|
25
|
-
* callback. If no initial value is supplied, the first element in the array will be used. Calling reduce on an empty
|
|
26
|
-
* array without an initial value is an error.
|
|
27
|
-
* @returns {*}
|
|
28
|
-
*/
|
|
29
|
-
declare const reduceObject: (obj: reduceableItem, fn: reduceCallback, initialValue?: reduceableItem) => any;
|
|
30
|
-
export default reduceObject;
|
|
1
|
+
type reduceableItem = Array<any> | {
|
|
2
|
+
[k: number | string]: any;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Function to execute on each property in the object, taking four arguments
|
|
6
|
+
* @callback module:objectHelpers~reduceCallback
|
|
7
|
+
* @memberOf module:objectHelpers
|
|
8
|
+
* @param {*} [accumulator={}] - The accumulator accumulates the callback's return values; it is the accumulated
|
|
9
|
+
* value previously returned in the last invocation of the callback, or initialValue, if supplied (see below).
|
|
10
|
+
* @param {*} [currentProperty={}] - The current property being processed in the object.
|
|
11
|
+
* @param {string} [currentIndex=0] - The index of the current element being processed in the array. Starts at index
|
|
12
|
+
* 0, if an initialValue is provided, and at index 1 otherwise.
|
|
13
|
+
* @param {Object|Array} [object={}] - The object reduce was called upon.
|
|
14
|
+
* @returns {*}
|
|
15
|
+
*/
|
|
16
|
+
type reduceCallback = (accumulator: any, currentProperty: any, currentIndex: keyof reduceableItem, object: reduceableItem) => any;
|
|
17
|
+
/**
|
|
18
|
+
* This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
|
|
19
|
+
* If an array is passed in instead then it will perform standard reduce(). It is recommended to
|
|
20
|
+
* always use the standard reduce() function when it is known that the object is actually an array.
|
|
21
|
+
* @memberOf module:objectHelpers
|
|
22
|
+
* @param {Object|Array} obj - The Object (or Array) to be filtered
|
|
23
|
+
* @param {module:objectHelpers~reduceCallback|Function|reduceCallback} fn - The function to be processed for each filtered property
|
|
24
|
+
* @param {Object|Array} [initialValue] - Optional. Value to use as the first argument to the first call of the
|
|
25
|
+
* callback. If no initial value is supplied, the first element in the array will be used. Calling reduce on an empty
|
|
26
|
+
* array without an initial value is an error.
|
|
27
|
+
* @returns {*}
|
|
28
|
+
*/
|
|
29
|
+
declare const reduceObject: (obj: reduceableItem, fn: reduceCallback, initialValue?: reduceableItem) => any;
|
|
30
|
+
export default reduceObject;
|
|
31
31
|
//# sourceMappingURL=reduceObject.d.ts.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
require('core-js/modules/esnext.iterator.constructor.js')
|
|
8
|
-
require('core-js/modules/esnext.iterator.reduce.js')
|
|
9
|
-
const _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
|
|
10
|
-
const _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
11
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
12
|
-
/**
|
|
13
|
-
* This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
|
|
14
|
-
* If an array is passed in instead then it will perform standard reduce(). It is recommended to
|
|
15
|
-
* always use the standard reduce() function when it is known that the object is actually an array.
|
|
16
|
-
* @memberOf module:objectHelpers
|
|
17
|
-
* @param {Object|Array} obj - The Object (or Array) to be filtered
|
|
18
|
-
* @param {module:objectHelpers~reduceCallback|Function|reduceCallback} fn - The function to be processed for each filtered property
|
|
19
|
-
* @param {Object|Array} [initialValue] - Optional. Value to use as the first argument to the first call of the
|
|
20
|
-
* callback. If no initial value is supplied, the first element in the array will be used. Calling reduce on an empty
|
|
21
|
-
* array without an initial value is an error.
|
|
22
|
-
* @returns {*}
|
|
23
|
-
*/
|
|
24
|
-
const reduceObject = (obj, fn, initialValue = obj[(0, _objectKeys.default)(obj)[0]] || obj[0]) => Array.isArray(obj) ? obj.reduce(fn, initialValue) : (0, _objectKeys.default)(obj, true).reduce((newObj, curr) => (0, _callWithParams.default)(fn, [newObj, obj[curr], curr, obj], 2), initialValue)
|
|
25
|
-
const _default = exports.default = reduceObject
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
8
|
+
require('core-js/modules/esnext.iterator.reduce.js')
|
|
9
|
+
const _callWithParams = _interopRequireDefault(require('../functions/callWithParams'))
|
|
10
|
+
const _objectKeys = _interopRequireDefault(require('./objectKeys'))
|
|
11
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
12
|
+
/**
|
|
13
|
+
* This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
|
|
14
|
+
* If an array is passed in instead then it will perform standard reduce(). It is recommended to
|
|
15
|
+
* always use the standard reduce() function when it is known that the object is actually an array.
|
|
16
|
+
* @memberOf module:objectHelpers
|
|
17
|
+
* @param {Object|Array} obj - The Object (or Array) to be filtered
|
|
18
|
+
* @param {module:objectHelpers~reduceCallback|Function|reduceCallback} fn - The function to be processed for each filtered property
|
|
19
|
+
* @param {Object|Array} [initialValue] - Optional. Value to use as the first argument to the first call of the
|
|
20
|
+
* callback. If no initial value is supplied, the first element in the array will be used. Calling reduce on an empty
|
|
21
|
+
* array without an initial value is an error.
|
|
22
|
+
* @returns {*}
|
|
23
|
+
*/
|
|
24
|
+
const reduceObject = (obj, fn, initialValue = obj[(0, _objectKeys.default)(obj)[0]] || obj[0]) => Array.isArray(obj) ? obj.reduce(fn, initialValue) : (0, _objectKeys.default)(obj, true).reduce((newObj, curr) => (0, _callWithParams.default)(fn, [newObj, obj[curr], curr, obj], 2), initialValue)
|
|
25
|
+
const _default = exports.default = reduceObject
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
type settableItem = Array<any> | {
|
|
2
|
-
[k: number | string]: any;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Set a value on an item, then return the value
|
|
6
|
-
* @memberOf module:objectHelpers
|
|
7
|
-
* @param {Object|Array} item - An object or array to be updated
|
|
8
|
-
* @param {string|number} key - The key on the item which will have its value set
|
|
9
|
-
* @param {*} value - Any value to be applied to the key
|
|
10
|
-
* @returns {*}
|
|
11
|
-
*/
|
|
12
|
-
declare const setAndReturnValue: (item: settableItem, key: keyof settableItem, value: any) => any;
|
|
13
|
-
export default setAndReturnValue;
|
|
1
|
+
type settableItem = Array<any> | {
|
|
2
|
+
[k: number | string]: any;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Set a value on an item, then return the value
|
|
6
|
+
* @memberOf module:objectHelpers
|
|
7
|
+
* @param {Object|Array} item - An object or array to be updated
|
|
8
|
+
* @param {string|number} key - The key on the item which will have its value set
|
|
9
|
+
* @param {*} value - Any value to be applied to the key
|
|
10
|
+
* @returns {*}
|
|
11
|
+
*/
|
|
12
|
+
declare const setAndReturnValue: (item: settableItem, key: keyof settableItem, value: any) => any;
|
|
13
|
+
export default setAndReturnValue;
|
|
14
14
|
//# sourceMappingURL=setAndReturnValue.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
/**
|
|
8
|
-
* Set a value on an item, then return the value
|
|
9
|
-
* @memberOf module:objectHelpers
|
|
10
|
-
* @param {Object|Array} item - An object or array to be updated
|
|
11
|
-
* @param {string|number} key - The key on the item which will have its value set
|
|
12
|
-
* @param {*} value - Any value to be applied to the key
|
|
13
|
-
* @returns {*}
|
|
14
|
-
*/
|
|
15
|
-
const setAndReturnValue = (item, key, value) => {
|
|
16
|
-
item[key] = value
|
|
17
|
-
return value
|
|
18
|
-
}
|
|
19
|
-
const _default = exports.default = setAndReturnValue
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Set a value on an item, then return the value
|
|
9
|
+
* @memberOf module:objectHelpers
|
|
10
|
+
* @param {Object|Array} item - An object or array to be updated
|
|
11
|
+
* @param {string|number} key - The key on the item which will have its value set
|
|
12
|
+
* @param {*} value - Any value to be applied to the key
|
|
13
|
+
* @returns {*}
|
|
14
|
+
*/
|
|
15
|
+
const setAndReturnValue = (item, key, value) => {
|
|
16
|
+
item[key] = value
|
|
17
|
+
return value
|
|
18
|
+
}
|
|
19
|
+
const _default = exports.default = setAndReturnValue
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
type settableItem = Array<any> | {
|
|
2
|
-
[k: number | string]: any;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Set a value on an item, then return the item.
|
|
6
|
-
* NOTE: Argument order designed for usage with pipe
|
|
7
|
-
* @memberOf module:objectHelpers
|
|
8
|
-
* @param {string|number} key - The key on the item which will have its value set
|
|
9
|
-
* @param {*} value - Any value to be applied to the key
|
|
10
|
-
* @param {Object|Array} item - An object or array to be updated
|
|
11
|
-
* @returns {Object|Array}
|
|
12
|
-
*/
|
|
13
|
-
declare const setValue: (key: number | string, value: any, item: settableItem) => settableItem;
|
|
14
|
-
export default setValue;
|
|
1
|
+
type settableItem = Array<any> | {
|
|
2
|
+
[k: number | string]: any;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Set a value on an item, then return the item.
|
|
6
|
+
* NOTE: Argument order designed for usage with pipe
|
|
7
|
+
* @memberOf module:objectHelpers
|
|
8
|
+
* @param {string|number} key - The key on the item which will have its value set
|
|
9
|
+
* @param {*} value - Any value to be applied to the key
|
|
10
|
+
* @param {Object|Array} item - An object or array to be updated
|
|
11
|
+
* @returns {Object|Array}
|
|
12
|
+
*/
|
|
13
|
+
declare const setValue: (key: number | string, value: any, item: settableItem) => settableItem;
|
|
14
|
+
export default setValue;
|
|
15
15
|
//# sourceMappingURL=setValue.d.ts.map
|