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,65 +1,65 @@
|
|
|
1
|
-
export type callableLater = {
|
|
2
|
-
fn?: Function;
|
|
3
|
-
args?: Array<any>;
|
|
4
|
-
};
|
|
5
|
-
export type queuedItem = {
|
|
6
|
-
item: callableLater | any;
|
|
7
|
-
generator: Generator;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Define the format of a queue.
|
|
11
|
-
* @typedef {Object} IsQueue
|
|
12
|
-
* @memberOf module:arrayHelpers
|
|
13
|
-
* @property {Array|*} innerList - Stores the data for the queue
|
|
14
|
-
* @method dequeue - Pulls the first item from the queue
|
|
15
|
-
* @method empty - Check if the queue is empty
|
|
16
|
-
* @method enqueue - Adds and item to the end of the queue
|
|
17
|
-
* @method peek - Get the next queue item but does not remove it
|
|
18
|
-
* @method size - Get the size of the queue
|
|
19
|
-
*/
|
|
20
|
-
export interface IsQueue<queuedItem> {
|
|
21
|
-
dequeue: () => queuedItem | null;
|
|
22
|
-
empty: () => boolean;
|
|
23
|
-
enqueue: (data: queuedItem) => void;
|
|
24
|
-
peek: () => queuedItem | null;
|
|
25
|
-
size: () => number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Class BasicQueue is a functional example of a queue to be used with queueManager.
|
|
29
|
-
* @memberOf module:arrayHelpers
|
|
30
|
-
*/
|
|
31
|
-
declare class BasicQueue implements IsQueue<queuedItem> {
|
|
32
|
-
private readonly innerList;
|
|
33
|
-
/**
|
|
34
|
-
* @param {Array} [innerList=[]] - Items to pre-populate the queue with, in order.
|
|
35
|
-
*/
|
|
36
|
-
constructor(innerList?: queuedItem[] | any);
|
|
37
|
-
/**
|
|
38
|
-
* Remove and return the next item in the queue
|
|
39
|
-
* @returns {queuedItem|*}
|
|
40
|
-
*/
|
|
41
|
-
dequeue(): queuedItem | any;
|
|
42
|
-
/**
|
|
43
|
-
* Check if the queue is empty
|
|
44
|
-
* @returns {boolean}
|
|
45
|
-
*/
|
|
46
|
-
empty(): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Add an item to the end of the queue
|
|
49
|
-
* @param {queuedItem|*} data
|
|
50
|
-
* @returns {BasicQueue}
|
|
51
|
-
*/
|
|
52
|
-
enqueue(data: queuedItem | any): IsQueue<queuedItem>;
|
|
53
|
-
/**
|
|
54
|
-
* Retrieve the next item from the queue
|
|
55
|
-
* @returns {queuedItem|*}
|
|
56
|
-
*/
|
|
57
|
-
peek(): queuedItem | any;
|
|
58
|
-
/**
|
|
59
|
-
* Get the quantity of items in the queue
|
|
60
|
-
* @returns {number}
|
|
61
|
-
*/
|
|
62
|
-
size(): number;
|
|
63
|
-
}
|
|
64
|
-
export default BasicQueue;
|
|
1
|
+
export type callableLater = {
|
|
2
|
+
fn?: Function;
|
|
3
|
+
args?: Array<any>;
|
|
4
|
+
};
|
|
5
|
+
export type queuedItem = {
|
|
6
|
+
item: callableLater | any;
|
|
7
|
+
generator: Generator;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Define the format of a queue.
|
|
11
|
+
* @typedef {Object} IsQueue
|
|
12
|
+
* @memberOf module:arrayHelpers
|
|
13
|
+
* @property {Array|*} innerList - Stores the data for the queue
|
|
14
|
+
* @method dequeue - Pulls the first item from the queue
|
|
15
|
+
* @method empty - Check if the queue is empty
|
|
16
|
+
* @method enqueue - Adds and item to the end of the queue
|
|
17
|
+
* @method peek - Get the next queue item but does not remove it
|
|
18
|
+
* @method size - Get the size of the queue
|
|
19
|
+
*/
|
|
20
|
+
export interface IsQueue<queuedItem> {
|
|
21
|
+
dequeue: () => queuedItem | null;
|
|
22
|
+
empty: () => boolean;
|
|
23
|
+
enqueue: (data: queuedItem) => void;
|
|
24
|
+
peek: () => queuedItem | null;
|
|
25
|
+
size: () => number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Class BasicQueue is a functional example of a queue to be used with queueManager.
|
|
29
|
+
* @memberOf module:arrayHelpers
|
|
30
|
+
*/
|
|
31
|
+
declare class BasicQueue implements IsQueue<queuedItem> {
|
|
32
|
+
private readonly innerList;
|
|
33
|
+
/**
|
|
34
|
+
* @param {Array} [innerList=[]] - Items to pre-populate the queue with, in order.
|
|
35
|
+
*/
|
|
36
|
+
constructor(innerList?: queuedItem[] | any);
|
|
37
|
+
/**
|
|
38
|
+
* Remove and return the next item in the queue
|
|
39
|
+
* @returns {queuedItem|*}
|
|
40
|
+
*/
|
|
41
|
+
dequeue(): queuedItem | any;
|
|
42
|
+
/**
|
|
43
|
+
* Check if the queue is empty
|
|
44
|
+
* @returns {boolean}
|
|
45
|
+
*/
|
|
46
|
+
empty(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Add an item to the end of the queue
|
|
49
|
+
* @param {queuedItem|*} data
|
|
50
|
+
* @returns {BasicQueue}
|
|
51
|
+
*/
|
|
52
|
+
enqueue(data: queuedItem | any): IsQueue<queuedItem>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve the next item from the queue
|
|
55
|
+
* @returns {queuedItem|*}
|
|
56
|
+
*/
|
|
57
|
+
peek(): queuedItem | any;
|
|
58
|
+
/**
|
|
59
|
+
* Get the quantity of items in the queue
|
|
60
|
+
* @returns {number}
|
|
61
|
+
*/
|
|
62
|
+
size(): number;
|
|
63
|
+
}
|
|
64
|
+
export default BasicQueue;
|
|
65
65
|
//# sourceMappingURL=BasicQueue.d.ts.map
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
/**
|
|
8
|
-
* Class BasicQueue is a functional example of a queue to be used with queueManager.
|
|
9
|
-
* @memberOf module:arrayHelpers
|
|
10
|
-
*/
|
|
11
|
-
class BasicQueue {
|
|
12
|
-
/**
|
|
13
|
-
* @param {Array} [innerList=[]] - Items to pre-populate the queue with, in order.
|
|
14
|
-
*/
|
|
15
|
-
constructor (innerList = []) {
|
|
16
|
-
this.innerList = innerList
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Remove and return the next item in the queue
|
|
21
|
-
* @returns {queuedItem|*}
|
|
22
|
-
*/
|
|
23
|
-
dequeue () {
|
|
24
|
-
return this.innerList.shift()
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Check if the queue is empty
|
|
29
|
-
* @returns {boolean}
|
|
30
|
-
*/
|
|
31
|
-
empty () {
|
|
32
|
-
return !this.size()
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Add an item to the end of the queue
|
|
37
|
-
* @param {queuedItem|*} data
|
|
38
|
-
* @returns {BasicQueue}
|
|
39
|
-
*/
|
|
40
|
-
enqueue (data) {
|
|
41
|
-
this.innerList.push(data)
|
|
42
|
-
return this
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Retrieve the next item from the queue
|
|
47
|
-
* @returns {queuedItem|*}
|
|
48
|
-
*/
|
|
49
|
-
peek () {
|
|
50
|
-
return this.empty() ? null : this.innerList[0]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Get the quantity of items in the queue
|
|
55
|
-
* @returns {number}
|
|
56
|
-
*/
|
|
57
|
-
size () {
|
|
58
|
-
return this.innerList.length
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const _default = exports.default = BasicQueue
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Class BasicQueue is a functional example of a queue to be used with queueManager.
|
|
9
|
+
* @memberOf module:arrayHelpers
|
|
10
|
+
*/
|
|
11
|
+
class BasicQueue {
|
|
12
|
+
/**
|
|
13
|
+
* @param {Array} [innerList=[]] - Items to pre-populate the queue with, in order.
|
|
14
|
+
*/
|
|
15
|
+
constructor (innerList = []) {
|
|
16
|
+
this.innerList = innerList
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Remove and return the next item in the queue
|
|
21
|
+
* @returns {queuedItem|*}
|
|
22
|
+
*/
|
|
23
|
+
dequeue () {
|
|
24
|
+
return this.innerList.shift()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Check if the queue is empty
|
|
29
|
+
* @returns {boolean}
|
|
30
|
+
*/
|
|
31
|
+
empty () {
|
|
32
|
+
return !this.size()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Add an item to the end of the queue
|
|
37
|
+
* @param {queuedItem|*} data
|
|
38
|
+
* @returns {BasicQueue}
|
|
39
|
+
*/
|
|
40
|
+
enqueue (data) {
|
|
41
|
+
this.innerList.push(data)
|
|
42
|
+
return this
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Retrieve the next item from the queue
|
|
47
|
+
* @returns {queuedItem|*}
|
|
48
|
+
*/
|
|
49
|
+
peek () {
|
|
50
|
+
return this.empty() ? null : this.innerList[0]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get the quantity of items in the queue
|
|
55
|
+
* @returns {number}
|
|
56
|
+
*/
|
|
57
|
+
size () {
|
|
58
|
+
return this.innerList.length
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const _default = exports.default = BasicQueue
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Having an array and a potential new array element, check if the element is in the array, if not append to array.
|
|
3
|
-
* @memberOf module:arrayHelpers
|
|
4
|
-
* @param {*} item - An potential array element, possibly a DomItem
|
|
5
|
-
* @param {Array} array - An array where an element may be appended.
|
|
6
|
-
* @returns {Array}
|
|
7
|
-
*/
|
|
8
|
-
declare const addUniqueToArray: (item: any, array: Array<any>) => Array<any>;
|
|
9
|
-
export default addUniqueToArray;
|
|
1
|
+
/**
|
|
2
|
+
* Having an array and a potential new array element, check if the element is in the array, if not append to array.
|
|
3
|
+
* @memberOf module:arrayHelpers
|
|
4
|
+
* @param {*} item - An potential array element, possibly a DomItem
|
|
5
|
+
* @param {Array} array - An array where an element may be appended.
|
|
6
|
+
* @returns {Array}
|
|
7
|
+
*/
|
|
8
|
+
declare const addUniqueToArray: (item: any, array: Array<any>) => Array<any>;
|
|
9
|
+
export default addUniqueToArray;
|
|
10
10
|
//# sourceMappingURL=addUniqueToArray.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/es.array.includes.js')
|
|
8
|
-
/**
|
|
9
|
-
* Having an array and a potential new array element, check if the element is in the array, if not append to array.
|
|
10
|
-
* @memberOf module:arrayHelpers
|
|
11
|
-
* @param {*} item - An potential array element, possibly a DomItem
|
|
12
|
-
* @param {Array} array - An array where an element may be appended.
|
|
13
|
-
* @returns {Array}
|
|
14
|
-
*/
|
|
15
|
-
const addUniqueToArray = (item, array) => !array.includes(item) ? array.concat([item]) : array
|
|
16
|
-
const _default = exports.default = addUniqueToArray
|
|
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
|
+
/**
|
|
9
|
+
* Having an array and a potential new array element, check if the element is in the array, if not append to array.
|
|
10
|
+
* @memberOf module:arrayHelpers
|
|
11
|
+
* @param {*} item - An potential array element, possibly a DomItem
|
|
12
|
+
* @param {Array} array - An array where an element may be appended.
|
|
13
|
+
* @returns {Array}
|
|
14
|
+
*/
|
|
15
|
+
const addUniqueToArray = (item, array) => !array.includes(item) ? array.concat([item]) : array
|
|
16
|
+
const _default = exports.default = addUniqueToArray
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Leverage buildArrayBase to generate an array filled with a copy of the provided item.
|
|
3
|
-
* The length defines how long the array should be.
|
|
4
|
-
* @memberOf module:arrayHelpers
|
|
5
|
-
* @param {*} item - The item to be used for each array element
|
|
6
|
-
* @param {number} length - The desired length of the array
|
|
7
|
-
* @returns {Array.<*>}
|
|
8
|
-
*/
|
|
9
|
-
declare const buildArray: (item: any, length: number) => Array<any>;
|
|
10
|
-
export default buildArray;
|
|
1
|
+
/**
|
|
2
|
+
* Leverage buildArrayBase to generate an array filled with a copy of the provided item.
|
|
3
|
+
* The length defines how long the array should be.
|
|
4
|
+
* @memberOf module:arrayHelpers
|
|
5
|
+
* @param {*} item - The item to be used for each array element
|
|
6
|
+
* @param {number} length - The desired length of the array
|
|
7
|
+
* @returns {Array.<*>}
|
|
8
|
+
*/
|
|
9
|
+
declare const buildArray: (item: any, length: number) => Array<any>;
|
|
10
|
+
export default buildArray;
|
|
11
11
|
//# sourceMappingURL=buildArray.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
|
-
const _cloneObject = _interopRequireDefault(require('../objects/cloneObject'))
|
|
8
|
-
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
9
|
-
/**
|
|
10
|
-
* Leverage buildArrayBase to generate an array filled with a copy of the provided item.
|
|
11
|
-
* The length defines how long the array should be.
|
|
12
|
-
* @memberOf module:arrayHelpers
|
|
13
|
-
* @param {*} item - The item to be used for each array element
|
|
14
|
-
* @param {number} length - The desired length of the array
|
|
15
|
-
* @returns {Array.<*>}
|
|
16
|
-
*/
|
|
17
|
-
const buildArray = (item, length) => {
|
|
18
|
-
const arr = []
|
|
19
|
-
while (arr.length < length) {
|
|
20
|
-
const cloned = (0, _cloneObject.default)(item)
|
|
21
|
-
arr.push(cloned)
|
|
22
|
-
}
|
|
23
|
-
return arr
|
|
24
|
-
}
|
|
25
|
-
const _default = exports.default = buildArray
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
const _cloneObject = _interopRequireDefault(require('../objects/cloneObject'))
|
|
8
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
9
|
+
/**
|
|
10
|
+
* Leverage buildArrayBase to generate an array filled with a copy of the provided item.
|
|
11
|
+
* The length defines how long the array should be.
|
|
12
|
+
* @memberOf module:arrayHelpers
|
|
13
|
+
* @param {*} item - The item to be used for each array element
|
|
14
|
+
* @param {number} length - The desired length of the array
|
|
15
|
+
* @returns {Array.<*>}
|
|
16
|
+
*/
|
|
17
|
+
const buildArray = (item, length) => {
|
|
18
|
+
const arr = []
|
|
19
|
+
while (arr.length < length) {
|
|
20
|
+
const cloned = (0, _cloneObject.default)(item)
|
|
21
|
+
arr.push(cloned)
|
|
22
|
+
}
|
|
23
|
+
return arr
|
|
24
|
+
}
|
|
25
|
+
const _default = exports.default = buildArray
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Leverage buildArrayBase to generate an array filled with references to the provided item.
|
|
3
|
-
* The length defines how long the array should be.
|
|
4
|
-
* @memberOf module:arrayHelpers
|
|
5
|
-
* @param {*} item - The item to be used for each array element
|
|
6
|
-
* @param {number} length - The desired length of the array
|
|
7
|
-
* @returns {Array.<*>}
|
|
8
|
-
*/
|
|
9
|
-
declare const buildArrayOfReferences: (item: any, length: number) => Array<any>;
|
|
10
|
-
export default buildArrayOfReferences;
|
|
1
|
+
/**
|
|
2
|
+
* Leverage buildArrayBase to generate an array filled with references to the provided item.
|
|
3
|
+
* The length defines how long the array should be.
|
|
4
|
+
* @memberOf module:arrayHelpers
|
|
5
|
+
* @param {*} item - The item to be used for each array element
|
|
6
|
+
* @param {number} length - The desired length of the array
|
|
7
|
+
* @returns {Array.<*>}
|
|
8
|
+
*/
|
|
9
|
+
declare const buildArrayOfReferences: (item: any, length: number) => Array<any>;
|
|
10
|
+
export default buildArrayOfReferences;
|
|
11
11
|
//# sourceMappingURL=buildArrayOfReferences.d.ts.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.default = void 0
|
|
7
|
-
/**
|
|
8
|
-
* Leverage buildArrayBase to generate an array filled with references to the provided item.
|
|
9
|
-
* The length defines how long the array should be.
|
|
10
|
-
* @memberOf module:arrayHelpers
|
|
11
|
-
* @param {*} item - The item to be used for each array element
|
|
12
|
-
* @param {number} length - The desired length of the array
|
|
13
|
-
* @returns {Array.<*>}
|
|
14
|
-
*/
|
|
15
|
-
const buildArrayOfReferences = (item, length) => {
|
|
16
|
-
const arr = []
|
|
17
|
-
while (arr.length < length) {
|
|
18
|
-
arr.push(item)
|
|
19
|
-
}
|
|
20
|
-
return arr
|
|
21
|
-
}
|
|
22
|
-
const _default = exports.default = buildArrayOfReferences
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Leverage buildArrayBase to generate an array filled with references to the provided item.
|
|
9
|
+
* The length defines how long the array should be.
|
|
10
|
+
* @memberOf module:arrayHelpers
|
|
11
|
+
* @param {*} item - The item to be used for each array element
|
|
12
|
+
* @param {number} length - The desired length of the array
|
|
13
|
+
* @returns {Array.<*>}
|
|
14
|
+
*/
|
|
15
|
+
const buildArrayOfReferences = (item, length) => {
|
|
16
|
+
const arr = []
|
|
17
|
+
while (arr.length < length) {
|
|
18
|
+
arr.push(item)
|
|
19
|
+
}
|
|
20
|
+
return arr
|
|
21
|
+
}
|
|
22
|
+
const _default = exports.default = buildArrayOfReferences
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store the comparison result for an element that may exist in either of compared arrays.
|
|
3
|
-
* - value stores the element value from the arrays being compared
|
|
4
|
-
* - results has the comparison results where first index (0) is result for first compared array
|
|
5
|
-
* and the second index (1) will be the result for the second compared array
|
|
6
|
-
* @example
|
|
7
|
-
* // example of input and resulting output
|
|
8
|
-
*
|
|
9
|
-
* const arr1 = ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1']
|
|
10
|
-
* const arr2 = ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
11
|
-
*
|
|
12
|
-
* // Taking the first element in both, then the value: 'match1' exists in both arrays
|
|
13
|
-
* // compareArrayResult will be { value: 'match1', result: [0, 0] }
|
|
14
|
-
* // First index of 0 indicates this value in the first array exists in the second array
|
|
15
|
-
* // Second index of 0 indicates this value in the second array exists in the first array
|
|
16
|
-
*
|
|
17
|
-
* // Taking the second element in the first array, then the value: 'firstMismatch1' exists in only the first array
|
|
18
|
-
* // compareArrayResult will be { value: 'firstMismatch1', result: [1, -1] }
|
|
19
|
-
* // First index of 1 indicates this value in the first array might need to be added to the second array
|
|
20
|
-
* // Second index of -1 indicates this value only exists in the first array
|
|
21
|
-
*
|
|
22
|
-
* // Taking the third element in the second array, then the value: 'secondMismatch1' exists in only the second array
|
|
23
|
-
* // compareArrayResult will be { value: 'secondMismatch1', result: [-1, 1] }
|
|
24
|
-
* // First index of -1 indicates this value only exists in the second array
|
|
25
|
-
* // Second index of 1 indicates this value in the second array might need to be added to the first array
|
|
26
|
-
* @typedef {Object.<string, string|Array.<number>>} module:arrayHelpers~compareArrayResult
|
|
27
|
-
* @memberOf module:arrayHelpers
|
|
28
|
-
* @property {string} value - The element value being compared
|
|
29
|
-
* @property {Array.<Array.<string|number>>} keys - Keys in arrays associated with this value
|
|
30
|
-
* @property {Array.<number>} result - The results in the order of the compared arrays
|
|
31
|
-
*/
|
|
32
|
-
export type compareArrayResult = {
|
|
33
|
-
value: string;
|
|
34
|
-
keys: Array<Array<number | string>>;
|
|
35
|
-
result: Array<number>;
|
|
36
|
-
};
|
|
37
|
-
export type compareArrayResultMap = Array<compareArrayResult>;
|
|
38
|
-
/**
|
|
39
|
-
* Compare two Arrays and return the Object where the value for each property is as follows:
|
|
40
|
-
* -1 to indicate val1 is less than val2
|
|
41
|
-
* 0 to indicate both values are the equal
|
|
42
|
-
* 1 to indicate val1 is greater than val2
|
|
43
|
-
* The returned Object uses the element values as the property names
|
|
44
|
-
* This functions works by first creating a concatenated array of all unique values. Then for each unique values,
|
|
45
|
-
* convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
|
|
46
|
-
* Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
|
|
47
|
-
* 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
|
|
48
|
-
* or more.
|
|
49
|
-
* @example
|
|
50
|
-
* // example of input and resulting output
|
|
51
|
-
* compareArrays(
|
|
52
|
-
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
|
|
53
|
-
* ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
54
|
-
* )
|
|
55
|
-
* // unique array
|
|
56
|
-
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
|
|
57
|
-
* // result object
|
|
58
|
-
* [
|
|
59
|
-
* {
|
|
60
|
-
* value: 'match1',
|
|
61
|
-
* keys: [[0], [0]],
|
|
62
|
-
* result: [0, 0]
|
|
63
|
-
* },
|
|
64
|
-
* {
|
|
65
|
-
* value: 'firstMismatch1',
|
|
66
|
-
* keys: [[1], []],
|
|
67
|
-
* result: [1, -1]
|
|
68
|
-
* },
|
|
69
|
-
* {
|
|
70
|
-
* value: 'match2',
|
|
71
|
-
* keys: [[2], [1]],
|
|
72
|
-
* result: [0, 0]
|
|
73
|
-
* },
|
|
74
|
-
* {
|
|
75
|
-
* value: 'firstMismatch2',
|
|
76
|
-
* keys: [[3], []],
|
|
77
|
-
* result: [1, -1]
|
|
78
|
-
* },
|
|
79
|
-
* {
|
|
80
|
-
* value: 'badMatch1',
|
|
81
|
-
* keys: [[4], [3, 4]],
|
|
82
|
-
* result: [0, 0]
|
|
83
|
-
* },
|
|
84
|
-
* {
|
|
85
|
-
* value: 'secondMismatch1',
|
|
86
|
-
* keys: [[], [2]],
|
|
87
|
-
* result: [-1, 1]
|
|
88
|
-
* }
|
|
89
|
-
* ]
|
|
90
|
-
*
|
|
91
|
-
* @memberOf module:arrayHelpers
|
|
92
|
-
* @param {...Array} arrays - The arrays to compare
|
|
93
|
-
* @returns {Array.<module:arrayHelpers~compareArrayResult>}
|
|
94
|
-
*/
|
|
95
|
-
declare const compareArrays: (...arrays: Array<Array<any>>) => compareArrayResultMap;
|
|
96
|
-
export default compareArrays;
|
|
1
|
+
/**
|
|
2
|
+
* Store the comparison result for an element that may exist in either of compared arrays.
|
|
3
|
+
* - value stores the element value from the arrays being compared
|
|
4
|
+
* - results has the comparison results where first index (0) is result for first compared array
|
|
5
|
+
* and the second index (1) will be the result for the second compared array
|
|
6
|
+
* @example
|
|
7
|
+
* // example of input and resulting output
|
|
8
|
+
*
|
|
9
|
+
* const arr1 = ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1']
|
|
10
|
+
* const arr2 = ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
11
|
+
*
|
|
12
|
+
* // Taking the first element in both, then the value: 'match1' exists in both arrays
|
|
13
|
+
* // compareArrayResult will be { value: 'match1', result: [0, 0] }
|
|
14
|
+
* // First index of 0 indicates this value in the first array exists in the second array
|
|
15
|
+
* // Second index of 0 indicates this value in the second array exists in the first array
|
|
16
|
+
*
|
|
17
|
+
* // Taking the second element in the first array, then the value: 'firstMismatch1' exists in only the first array
|
|
18
|
+
* // compareArrayResult will be { value: 'firstMismatch1', result: [1, -1] }
|
|
19
|
+
* // First index of 1 indicates this value in the first array might need to be added to the second array
|
|
20
|
+
* // Second index of -1 indicates this value only exists in the first array
|
|
21
|
+
*
|
|
22
|
+
* // Taking the third element in the second array, then the value: 'secondMismatch1' exists in only the second array
|
|
23
|
+
* // compareArrayResult will be { value: 'secondMismatch1', result: [-1, 1] }
|
|
24
|
+
* // First index of -1 indicates this value only exists in the second array
|
|
25
|
+
* // Second index of 1 indicates this value in the second array might need to be added to the first array
|
|
26
|
+
* @typedef {Object.<string, string|Array.<number>>} module:arrayHelpers~compareArrayResult
|
|
27
|
+
* @memberOf module:arrayHelpers
|
|
28
|
+
* @property {string} value - The element value being compared
|
|
29
|
+
* @property {Array.<Array.<string|number>>} keys - Keys in arrays associated with this value
|
|
30
|
+
* @property {Array.<number>} result - The results in the order of the compared arrays
|
|
31
|
+
*/
|
|
32
|
+
export type compareArrayResult = {
|
|
33
|
+
value: string;
|
|
34
|
+
keys: Array<Array<number | string>>;
|
|
35
|
+
result: Array<number>;
|
|
36
|
+
};
|
|
37
|
+
export type compareArrayResultMap = Array<compareArrayResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Compare two Arrays and return the Object where the value for each property is as follows:
|
|
40
|
+
* -1 to indicate val1 is less than val2
|
|
41
|
+
* 0 to indicate both values are the equal
|
|
42
|
+
* 1 to indicate val1 is greater than val2
|
|
43
|
+
* The returned Object uses the element values as the property names
|
|
44
|
+
* This functions works by first creating a concatenated array of all unique values. Then for each unique values,
|
|
45
|
+
* convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
|
|
46
|
+
* Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
|
|
47
|
+
* 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
|
|
48
|
+
* or more.
|
|
49
|
+
* @example
|
|
50
|
+
* // example of input and resulting output
|
|
51
|
+
* compareArrays(
|
|
52
|
+
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
|
|
53
|
+
* ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
54
|
+
* )
|
|
55
|
+
* // unique array
|
|
56
|
+
* ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
|
|
57
|
+
* // result object
|
|
58
|
+
* [
|
|
59
|
+
* {
|
|
60
|
+
* value: 'match1',
|
|
61
|
+
* keys: [[0], [0]],
|
|
62
|
+
* result: [0, 0]
|
|
63
|
+
* },
|
|
64
|
+
* {
|
|
65
|
+
* value: 'firstMismatch1',
|
|
66
|
+
* keys: [[1], []],
|
|
67
|
+
* result: [1, -1]
|
|
68
|
+
* },
|
|
69
|
+
* {
|
|
70
|
+
* value: 'match2',
|
|
71
|
+
* keys: [[2], [1]],
|
|
72
|
+
* result: [0, 0]
|
|
73
|
+
* },
|
|
74
|
+
* {
|
|
75
|
+
* value: 'firstMismatch2',
|
|
76
|
+
* keys: [[3], []],
|
|
77
|
+
* result: [1, -1]
|
|
78
|
+
* },
|
|
79
|
+
* {
|
|
80
|
+
* value: 'badMatch1',
|
|
81
|
+
* keys: [[4], [3, 4]],
|
|
82
|
+
* result: [0, 0]
|
|
83
|
+
* },
|
|
84
|
+
* {
|
|
85
|
+
* value: 'secondMismatch1',
|
|
86
|
+
* keys: [[], [2]],
|
|
87
|
+
* result: [-1, 1]
|
|
88
|
+
* }
|
|
89
|
+
* ]
|
|
90
|
+
*
|
|
91
|
+
* @memberOf module:arrayHelpers
|
|
92
|
+
* @param {...Array} arrays - The arrays to compare
|
|
93
|
+
* @returns {Array.<module:arrayHelpers~compareArrayResult>}
|
|
94
|
+
*/
|
|
95
|
+
declare const compareArrays: (...arrays: Array<Array<any>>) => compareArrayResultMap;
|
|
96
|
+
export default compareArrays;
|
|
97
97
|
//# sourceMappingURL=compareArrays.d.ts.map
|