si-funciona 2.6.1 → 2.7.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/README.md +48 -19
- package/browser/siFunciona.js +80 -77
- package/browser/siFunciona.min.js +1 -1
- 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 +18 -12
- package/dist/helpers/numbers/randomInteger.js +24 -18
- package/dist/helpers/numbers/randomNumber.d.ts +13 -12
- package/dist/helpers/numbers/randomNumber.js +19 -18
- 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 +2 -4
- package/dist/helpers/objects/cloneObject.js +2 -4
- 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 +9 -6
- package/dist/helpers/objects/mergeObjectsBase.js +59 -61
- package/dist/helpers/objects/mergeObjectsBase.min.js +1 -1
- 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 +1 -1
- 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,96 +1,96 @@
|
|
|
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.every.js')
|
|
9
|
-
require('core-js/modules/esnext.iterator.map.js')
|
|
10
|
-
require('core-js/modules/esnext.iterator.reduce.js')
|
|
11
|
-
const _isObject = _interopRequireDefault(require('../objects/isObject'))
|
|
12
|
-
const _mergeArrays = _interopRequireDefault(require('./mergeArrays'))
|
|
13
|
-
const _objectKeys = _interopRequireDefault(require('../objects/objectKeys'))
|
|
14
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
15
|
-
/**
|
|
16
|
-
* Compare two Arrays and return the Object where the value for each property is as follows:
|
|
17
|
-
* -1 to indicate val1 is less than val2
|
|
18
|
-
* 0 to indicate both values are the equal
|
|
19
|
-
* 1 to indicate val1 is greater than val2
|
|
20
|
-
* The returned Object uses the element values as the property names
|
|
21
|
-
* This functions works by first creating a concatenated array of all unique values. Then for each unique values,
|
|
22
|
-
* convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
|
|
23
|
-
* Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
|
|
24
|
-
* the first length will be one or more and the second will be zero, if the both have the value then both will be one
|
|
25
|
-
* or more.
|
|
26
|
-
* @example
|
|
27
|
-
* // example of input and resulting output
|
|
28
|
-
* compareArrays(
|
|
29
|
-
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
|
|
30
|
-
* ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
31
|
-
* )
|
|
32
|
-
* // unique array
|
|
33
|
-
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
|
|
34
|
-
* // result object
|
|
35
|
-
* [
|
|
36
|
-
* {
|
|
37
|
-
* value: 'match1',
|
|
38
|
-
* keys: [[0], [0]],
|
|
39
|
-
* result: [0, 0]
|
|
40
|
-
* },
|
|
41
|
-
* {
|
|
42
|
-
* value: 'firstMismatch1',
|
|
43
|
-
* keys: [[1], []],
|
|
44
|
-
* result: [1, -1]
|
|
45
|
-
* },
|
|
46
|
-
* {
|
|
47
|
-
* value: 'match2',
|
|
48
|
-
* keys: [[2], [1]],
|
|
49
|
-
* result: [0, 0]
|
|
50
|
-
* },
|
|
51
|
-
* {
|
|
52
|
-
* value: 'firstMismatch2',
|
|
53
|
-
* keys: [[3], []],
|
|
54
|
-
* result: [1, -1]
|
|
55
|
-
* },
|
|
56
|
-
* {
|
|
57
|
-
* value: 'badMatch1',
|
|
58
|
-
* keys: [[4], [3, 4]],
|
|
59
|
-
* result: [0, 0]
|
|
60
|
-
* },
|
|
61
|
-
* {
|
|
62
|
-
* value: 'secondMismatch1',
|
|
63
|
-
* keys: [[], [2]],
|
|
64
|
-
* result: [-1, 1]
|
|
65
|
-
* }
|
|
66
|
-
* ]
|
|
67
|
-
*
|
|
68
|
-
* @memberOf module:arrayHelpers
|
|
69
|
-
* @param {...Array} arrays - The arrays to compare
|
|
70
|
-
* @returns {Array.<module:arrayHelpers~compareArrayResult>}
|
|
71
|
-
*/
|
|
72
|
-
const compareArrays = (...arrays) => (0, _mergeArrays.default)(...arrays).reduce((results, attr) => {
|
|
73
|
-
const attrType = typeof attr
|
|
74
|
-
const useArray = Array.isArray(attr)
|
|
75
|
-
const keys = arrays.map(array => array.reduce((results, current, key) => {
|
|
76
|
-
const currentType = typeof current
|
|
77
|
-
if (attrType !== currentType) {
|
|
78
|
-
return results
|
|
79
|
-
}
|
|
80
|
-
if (!(0, _isObject.default)(attr)) {
|
|
81
|
-
return current === attr ? [...results, key] : results
|
|
82
|
-
}
|
|
83
|
-
if (useArray !== Array.isArray(current)) {
|
|
84
|
-
return results
|
|
85
|
-
}
|
|
86
|
-
const compareKeys = useArray ? compareArrays(attr, current) : compareArrays((0, _objectKeys.default)(attr), (0, _objectKeys.default)(current))
|
|
87
|
-
return compareKeys.every(compare => compare.result.every(result => result === 0)) ? [...results, key] : results
|
|
88
|
-
}, []))
|
|
89
|
-
const arrayResults = keys.map(array => array.length ? 1 : -1)
|
|
90
|
-
return [...results, {
|
|
91
|
-
value: attr,
|
|
92
|
-
keys,
|
|
93
|
-
result: arrayResults.every(result => result === 1) ? arrayResults.map(result => 0) : arrayResults
|
|
94
|
-
}]
|
|
95
|
-
}, [])
|
|
96
|
-
const _default = exports.default = compareArrays
|
|
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.every.js')
|
|
9
|
+
require('core-js/modules/esnext.iterator.map.js')
|
|
10
|
+
require('core-js/modules/esnext.iterator.reduce.js')
|
|
11
|
+
const _isObject = _interopRequireDefault(require('../objects/isObject'))
|
|
12
|
+
const _mergeArrays = _interopRequireDefault(require('./mergeArrays'))
|
|
13
|
+
const _objectKeys = _interopRequireDefault(require('../objects/objectKeys'))
|
|
14
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
15
|
+
/**
|
|
16
|
+
* Compare two Arrays and return the Object where the value for each property is as follows:
|
|
17
|
+
* -1 to indicate val1 is less than val2
|
|
18
|
+
* 0 to indicate both values are the equal
|
|
19
|
+
* 1 to indicate val1 is greater than val2
|
|
20
|
+
* The returned Object uses the element values as the property names
|
|
21
|
+
* This functions works by first creating a concatenated array of all unique values. Then for each unique values,
|
|
22
|
+
* convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
|
|
23
|
+
* Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
|
|
24
|
+
* the first length will be one or more and the second will be zero, if the both have the value then both will be one
|
|
25
|
+
* or more.
|
|
26
|
+
* @example
|
|
27
|
+
* // example of input and resulting output
|
|
28
|
+
* compareArrays(
|
|
29
|
+
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
|
|
30
|
+
* ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
31
|
+
* )
|
|
32
|
+
* // unique array
|
|
33
|
+
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
|
|
34
|
+
* // result object
|
|
35
|
+
* [
|
|
36
|
+
* {
|
|
37
|
+
* value: 'match1',
|
|
38
|
+
* keys: [[0], [0]],
|
|
39
|
+
* result: [0, 0]
|
|
40
|
+
* },
|
|
41
|
+
* {
|
|
42
|
+
* value: 'firstMismatch1',
|
|
43
|
+
* keys: [[1], []],
|
|
44
|
+
* result: [1, -1]
|
|
45
|
+
* },
|
|
46
|
+
* {
|
|
47
|
+
* value: 'match2',
|
|
48
|
+
* keys: [[2], [1]],
|
|
49
|
+
* result: [0, 0]
|
|
50
|
+
* },
|
|
51
|
+
* {
|
|
52
|
+
* value: 'firstMismatch2',
|
|
53
|
+
* keys: [[3], []],
|
|
54
|
+
* result: [1, -1]
|
|
55
|
+
* },
|
|
56
|
+
* {
|
|
57
|
+
* value: 'badMatch1',
|
|
58
|
+
* keys: [[4], [3, 4]],
|
|
59
|
+
* result: [0, 0]
|
|
60
|
+
* },
|
|
61
|
+
* {
|
|
62
|
+
* value: 'secondMismatch1',
|
|
63
|
+
* keys: [[], [2]],
|
|
64
|
+
* result: [-1, 1]
|
|
65
|
+
* }
|
|
66
|
+
* ]
|
|
67
|
+
*
|
|
68
|
+
* @memberOf module:arrayHelpers
|
|
69
|
+
* @param {...Array} arrays - The arrays to compare
|
|
70
|
+
* @returns {Array.<module:arrayHelpers~compareArrayResult>}
|
|
71
|
+
*/
|
|
72
|
+
const compareArrays = (...arrays) => (0, _mergeArrays.default)(...arrays).reduce((results, attr) => {
|
|
73
|
+
const attrType = typeof attr
|
|
74
|
+
const useArray = Array.isArray(attr)
|
|
75
|
+
const keys = arrays.map(array => array.reduce((results, current, key) => {
|
|
76
|
+
const currentType = typeof current
|
|
77
|
+
if (attrType !== currentType) {
|
|
78
|
+
return results
|
|
79
|
+
}
|
|
80
|
+
if (!(0, _isObject.default)(attr)) {
|
|
81
|
+
return current === attr ? [...results, key] : results
|
|
82
|
+
}
|
|
83
|
+
if (useArray !== Array.isArray(current)) {
|
|
84
|
+
return results
|
|
85
|
+
}
|
|
86
|
+
const compareKeys = useArray ? compareArrays(attr, current) : compareArrays((0, _objectKeys.default)(attr), (0, _objectKeys.default)(current))
|
|
87
|
+
return compareKeys.every(compare => compare.result.every(result => result === 0)) ? [...results, key] : results
|
|
88
|
+
}, []))
|
|
89
|
+
const arrayResults = keys.map(array => array.length ? 1 : -1)
|
|
90
|
+
return [...results, {
|
|
91
|
+
value: attr,
|
|
92
|
+
keys,
|
|
93
|
+
result: arrayResults.every(result => result === 1) ? arrayResults.map(result => 0) : arrayResults
|
|
94
|
+
}]
|
|
95
|
+
}, [])
|
|
96
|
+
const _default = exports.default = compareArrays
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Take multiple arrays and then filter all these into one unique array.
|
|
3
|
-
* @memberOf module:arrayHelpers
|
|
4
|
-
* @param {...Array} arrays - Provide multiple arrays to create one unique array
|
|
5
|
-
* @returns {Array}
|
|
6
|
-
*/
|
|
7
|
-
declare const mergeArrays: (...arrays: Array<Array<any>>) => Array<any>;
|
|
8
|
-
export default mergeArrays;
|
|
1
|
+
/**
|
|
2
|
+
* Take multiple arrays and then filter all these into one unique array.
|
|
3
|
+
* @memberOf module:arrayHelpers
|
|
4
|
+
* @param {...Array} arrays - Provide multiple arrays to create one unique array
|
|
5
|
+
* @returns {Array}
|
|
6
|
+
*/
|
|
7
|
+
declare const mergeArrays: (...arrays: Array<Array<any>>) => Array<any>;
|
|
8
|
+
export default mergeArrays;
|
|
9
9
|
//# sourceMappingURL=mergeArrays.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
require('core-js/modules/es.array.includes.js')
|
|
8
|
-
require('core-js/modules/esnext.iterator.constructor.js')
|
|
9
|
-
require('core-js/modules/esnext.iterator.filter.js')
|
|
10
|
-
require('core-js/modules/esnext.iterator.map.js')
|
|
11
|
-
require('core-js/modules/esnext.iterator.reduce.js')
|
|
12
|
-
const _uniqueArray = _interopRequireDefault(require('./uniqueArray'))
|
|
13
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
14
|
-
/**
|
|
15
|
-
* Take multiple arrays and then filter all these into one unique array.
|
|
16
|
-
* @memberOf module:arrayHelpers
|
|
17
|
-
* @param {...Array} arrays - Provide multiple arrays to create one unique array
|
|
18
|
-
* @returns {Array}
|
|
19
|
-
*/
|
|
20
|
-
const mergeArrays = (...arrays) => arrays.map(_uniqueArray.default).reduce((merged, arr) => [...merged, ...arr.filter(attr => !merged.includes(attr))], [])
|
|
21
|
-
const _default = exports.default = mergeArrays
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
require('core-js/modules/es.array.includes.js')
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js')
|
|
10
|
+
require('core-js/modules/esnext.iterator.map.js')
|
|
11
|
+
require('core-js/modules/esnext.iterator.reduce.js')
|
|
12
|
+
const _uniqueArray = _interopRequireDefault(require('./uniqueArray'))
|
|
13
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
14
|
+
/**
|
|
15
|
+
* Take multiple arrays and then filter all these into one unique array.
|
|
16
|
+
* @memberOf module:arrayHelpers
|
|
17
|
+
* @param {...Array} arrays - Provide multiple arrays to create one unique array
|
|
18
|
+
* @returns {Array}
|
|
19
|
+
*/
|
|
20
|
+
const mergeArrays = (...arrays) => arrays.map(_uniqueArray.default).reduce((merged, arr) => [...merged, ...arr.filter(attr => !merged.includes(attr))], [])
|
|
21
|
+
const _default = exports.default = mergeArrays
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Remove duplicate values from an array. uniqueArray
|
|
3
|
-
* @memberOf module:arrayHelpers
|
|
4
|
-
* @param {Array} array - The array to make unique
|
|
5
|
-
* @returns {Array}
|
|
6
|
-
*/
|
|
7
|
-
declare const uniqueArray: (array: Array<any>) => Array<any>;
|
|
8
|
-
export default uniqueArray;
|
|
1
|
+
/**
|
|
2
|
+
* Remove duplicate values from an array. uniqueArray
|
|
3
|
+
* @memberOf module:arrayHelpers
|
|
4
|
+
* @param {Array} array - The array to make unique
|
|
5
|
+
* @returns {Array}
|
|
6
|
+
*/
|
|
7
|
+
declare const uniqueArray: (array: Array<any>) => Array<any>;
|
|
8
|
+
export default uniqueArray;
|
|
9
9
|
//# sourceMappingURL=uniqueArray.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
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.filter.js')
|
|
9
|
-
/**
|
|
10
|
-
* Remove duplicate values from an array. uniqueArray
|
|
11
|
-
* @memberOf module:arrayHelpers
|
|
12
|
-
* @param {Array} array - The array to make unique
|
|
13
|
-
* @returns {Array}
|
|
14
|
-
*/
|
|
15
|
-
const uniqueArray = array => array.filter((item, index) => array.indexOf(item) === index)
|
|
16
|
-
const _default = exports.default = uniqueArray
|
|
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.filter.js')
|
|
9
|
+
/**
|
|
10
|
+
* Remove duplicate values from an array. uniqueArray
|
|
11
|
+
* @memberOf module:arrayHelpers
|
|
12
|
+
* @param {Array} array - The array to make unique
|
|
13
|
+
* @returns {Array}
|
|
14
|
+
*/
|
|
15
|
+
const uniqueArray = array => array.filter((item, index) => array.indexOf(item) === index)
|
|
16
|
+
const _default = exports.default = uniqueArray
|
package/dist/helpers/arrays.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for building, merging, deduplicating and comparing arrays, plus a basic FIFO queue (BasicQueue) for
|
|
3
|
-
* use with functionHelpers' queueManager/queueTimeout.
|
|
4
|
-
* @file
|
|
5
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
6
|
-
* @version 1.0.0
|
|
7
|
-
* @module arrayHelpers
|
|
8
|
-
* @memberOf module:siFunciona
|
|
9
|
-
*/
|
|
10
|
-
import addUniqueToArray from './arrays/addUniqueToArray';
|
|
11
|
-
import BasicQueue from './arrays/BasicQueue';
|
|
12
|
-
import buildArray from './arrays/buildArray';
|
|
13
|
-
import buildArrayOfReferences from './arrays/buildArrayOfReferences';
|
|
14
|
-
import compareArrays from './arrays/compareArrays';
|
|
15
|
-
import mergeArrays from './arrays/mergeArrays';
|
|
16
|
-
import uniqueArray from './arrays/uniqueArray';
|
|
17
|
-
export { addUniqueToArray, BasicQueue, buildArray, buildArrayOfReferences, compareArrays, mergeArrays, uniqueArray };
|
|
18
|
-
declare const _default: {
|
|
19
|
-
addUniqueToArray: (item: any, array: Array<any>) => Array<any>;
|
|
20
|
-
BasicQueue: typeof BasicQueue;
|
|
21
|
-
buildArray: (item: any, length: number) => Array<any>;
|
|
22
|
-
buildArrayOfReferences: (item: any, length: number) => Array<any>;
|
|
23
|
-
compareArrays: (...arrays: Array<Array<any>>) => import("./arrays/compareArrays").compareArrayResultMap;
|
|
24
|
-
mergeArrays: (...arrays: Array<Array<any>>) => Array<any>;
|
|
25
|
-
uniqueArray: (array: Array<any>) => Array<any>;
|
|
26
|
-
};
|
|
27
|
-
export default _default;
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for building, merging, deduplicating and comparing arrays, plus a basic FIFO queue (BasicQueue) for
|
|
3
|
+
* use with functionHelpers' queueManager/queueTimeout.
|
|
4
|
+
* @file
|
|
5
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
* @module arrayHelpers
|
|
8
|
+
* @memberOf module:siFunciona
|
|
9
|
+
*/
|
|
10
|
+
import addUniqueToArray from './arrays/addUniqueToArray';
|
|
11
|
+
import BasicQueue from './arrays/BasicQueue';
|
|
12
|
+
import buildArray from './arrays/buildArray';
|
|
13
|
+
import buildArrayOfReferences from './arrays/buildArrayOfReferences';
|
|
14
|
+
import compareArrays from './arrays/compareArrays';
|
|
15
|
+
import mergeArrays from './arrays/mergeArrays';
|
|
16
|
+
import uniqueArray from './arrays/uniqueArray';
|
|
17
|
+
export { addUniqueToArray, BasicQueue, buildArray, buildArrayOfReferences, compareArrays, mergeArrays, uniqueArray };
|
|
18
|
+
declare const _default: {
|
|
19
|
+
addUniqueToArray: (item: any, array: Array<any>) => Array<any>;
|
|
20
|
+
BasicQueue: typeof BasicQueue;
|
|
21
|
+
buildArray: (item: any, length: number) => Array<any>;
|
|
22
|
+
buildArrayOfReferences: (item: any, length: number) => Array<any>;
|
|
23
|
+
compareArrays: (...arrays: Array<Array<any>>) => import("./arrays/compareArrays").compareArrayResultMap;
|
|
24
|
+
mergeArrays: (...arrays: Array<Array<any>>) => Array<any>;
|
|
25
|
+
uniqueArray: (array: Array<any>) => Array<any>;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
28
|
//# sourceMappingURL=arrays.d.ts.map
|
package/dist/helpers/arrays.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
Object.defineProperty(exports, 'BasicQueue', {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _BasicQueue.default
|
|
10
|
-
}
|
|
11
|
-
})
|
|
12
|
-
Object.defineProperty(exports, 'addUniqueToArray', {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _addUniqueToArray.default
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
Object.defineProperty(exports, 'buildArray', {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _buildArray.default
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
Object.defineProperty(exports, 'buildArrayOfReferences', {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _buildArrayOfReferences.default
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
Object.defineProperty(exports, 'compareArrays', {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _compareArrays.default
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
exports.default = void 0
|
|
37
|
-
Object.defineProperty(exports, 'mergeArrays', {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return _mergeArrays.default
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
Object.defineProperty(exports, 'uniqueArray', {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _uniqueArray.default
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
var _addUniqueToArray = _interopRequireDefault(require('./arrays/addUniqueToArray'))
|
|
50
|
-
var _BasicQueue = _interopRequireDefault(require('./arrays/BasicQueue'))
|
|
51
|
-
var _buildArray = _interopRequireDefault(require('./arrays/buildArray'))
|
|
52
|
-
var _buildArrayOfReferences = _interopRequireDefault(require('./arrays/buildArrayOfReferences'))
|
|
53
|
-
var _compareArrays = _interopRequireDefault(require('./arrays/compareArrays'))
|
|
54
|
-
var _mergeArrays = _interopRequireDefault(require('./arrays/mergeArrays'))
|
|
55
|
-
var _uniqueArray = _interopRequireDefault(require('./arrays/uniqueArray'))
|
|
56
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
57
|
-
/**
|
|
58
|
-
* Utilities for building, merging, deduplicating and comparing arrays, plus a basic FIFO queue (BasicQueue) for
|
|
59
|
-
* use with functionHelpers' queueManager/queueTimeout.
|
|
60
|
-
* @file
|
|
61
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
62
|
-
* @version 1.0.0
|
|
63
|
-
* @module arrayHelpers
|
|
64
|
-
* @memberOf module:siFunciona
|
|
65
|
-
*/
|
|
66
|
-
const _default = exports.default = {
|
|
67
|
-
addUniqueToArray: _addUniqueToArray.default,
|
|
68
|
-
BasicQueue: _BasicQueue.default,
|
|
69
|
-
buildArray: _buildArray.default,
|
|
70
|
-
buildArrayOfReferences: _buildArrayOfReferences.default,
|
|
71
|
-
compareArrays: _compareArrays.default,
|
|
72
|
-
mergeArrays: _mergeArrays.default,
|
|
73
|
-
uniqueArray: _uniqueArray.default
|
|
74
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
Object.defineProperty(exports, 'BasicQueue', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _BasicQueue.default
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
Object.defineProperty(exports, 'addUniqueToArray', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _addUniqueToArray.default
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
Object.defineProperty(exports, 'buildArray', {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _buildArray.default
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
Object.defineProperty(exports, 'buildArrayOfReferences', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _buildArrayOfReferences.default
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
Object.defineProperty(exports, 'compareArrays', {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _compareArrays.default
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
exports.default = void 0
|
|
37
|
+
Object.defineProperty(exports, 'mergeArrays', {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _mergeArrays.default
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
Object.defineProperty(exports, 'uniqueArray', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _uniqueArray.default
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
var _addUniqueToArray = _interopRequireDefault(require('./arrays/addUniqueToArray'))
|
|
50
|
+
var _BasicQueue = _interopRequireDefault(require('./arrays/BasicQueue'))
|
|
51
|
+
var _buildArray = _interopRequireDefault(require('./arrays/buildArray'))
|
|
52
|
+
var _buildArrayOfReferences = _interopRequireDefault(require('./arrays/buildArrayOfReferences'))
|
|
53
|
+
var _compareArrays = _interopRequireDefault(require('./arrays/compareArrays'))
|
|
54
|
+
var _mergeArrays = _interopRequireDefault(require('./arrays/mergeArrays'))
|
|
55
|
+
var _uniqueArray = _interopRequireDefault(require('./arrays/uniqueArray'))
|
|
56
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
57
|
+
/**
|
|
58
|
+
* Utilities for building, merging, deduplicating and comparing arrays, plus a basic FIFO queue (BasicQueue) for
|
|
59
|
+
* use with functionHelpers' queueManager/queueTimeout.
|
|
60
|
+
* @file
|
|
61
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
62
|
+
* @version 1.0.0
|
|
63
|
+
* @module arrayHelpers
|
|
64
|
+
* @memberOf module:siFunciona
|
|
65
|
+
*/
|
|
66
|
+
const _default = exports.default = {
|
|
67
|
+
addUniqueToArray: _addUniqueToArray.default,
|
|
68
|
+
BasicQueue: _BasicQueue.default,
|
|
69
|
+
buildArray: _buildArray.default,
|
|
70
|
+
buildArrayOfReferences: _buildArrayOfReferences.default,
|
|
71
|
+
compareArrays: _compareArrays.default,
|
|
72
|
+
mergeArrays: _mergeArrays.default,
|
|
73
|
+
uniqueArray: _uniqueArray.default
|
|
74
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { descriptor } from './samples/descriptor';
|
|
2
|
-
/**
|
|
3
|
-
* Apply one or more descriptors to an existing descriptor so that they represent a merged version of the descriptors.
|
|
4
|
-
* Used to widen a descriptor as more differently-shaped objects are described into it (e.g. array elements of
|
|
5
|
-
* different types), rather than replacing it outright.
|
|
6
|
-
* @memberOf module:objectDescriptors
|
|
7
|
-
* @param {module:objectDescriptors~descriptor} originalMap - The base descriptor to merge onto (not mutated - a
|
|
8
|
-
* clone is merged and returned).
|
|
9
|
-
* @param {...module:objectDescriptors~descriptor} descriptors - One or more further descriptors to merge in.
|
|
10
|
-
* @returns {module:objectDescriptors~descriptor} A new descriptor representing the merge of all of the above.
|
|
11
|
-
*/
|
|
12
|
-
declare const assignDescriptor: (originalMap: descriptor, ...descriptors: Array<descriptor>) => descriptor;
|
|
13
|
-
export default assignDescriptor;
|
|
1
|
+
import { descriptor } from './samples/descriptor';
|
|
2
|
+
/**
|
|
3
|
+
* Apply one or more descriptors to an existing descriptor so that they represent a merged version of the descriptors.
|
|
4
|
+
* Used to widen a descriptor as more differently-shaped objects are described into it (e.g. array elements of
|
|
5
|
+
* different types), rather than replacing it outright.
|
|
6
|
+
* @memberOf module:objectDescriptors
|
|
7
|
+
* @param {module:objectDescriptors~descriptor} originalMap - The base descriptor to merge onto (not mutated - a
|
|
8
|
+
* clone is merged and returned).
|
|
9
|
+
* @param {...module:objectDescriptors~descriptor} descriptors - One or more further descriptors to merge in.
|
|
10
|
+
* @returns {module:objectDescriptors~descriptor} A new descriptor representing the merge of all of the above.
|
|
11
|
+
*/
|
|
12
|
+
declare const assignDescriptor: (originalMap: descriptor, ...descriptors: Array<descriptor>) => descriptor;
|
|
13
|
+
export default assignDescriptor;
|
|
14
14
|
//# sourceMappingURL=assignDescriptor.d.ts.map
|