si-funciona 2.3.3 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +1337 -1244
  2. package/browser/siFunciona.js +24205 -24146
  3. package/dist/helpers/arrays/BasicQueue.d.ts +65 -61
  4. package/dist/helpers/arrays/BasicQueue.js +62 -59
  5. package/dist/helpers/arrays/addUniqueToArray.d.ts +10 -10
  6. package/dist/helpers/arrays/addUniqueToArray.js +17 -17
  7. package/dist/helpers/arrays/buildArray.d.ts +11 -11
  8. package/dist/helpers/arrays/buildArray.js +26 -26
  9. package/dist/helpers/arrays/buildArrayOfReferences.d.ts +11 -11
  10. package/dist/helpers/arrays/buildArrayOfReferences.js +23 -23
  11. package/dist/helpers/arrays/compareArrays.d.ts +97 -97
  12. package/dist/helpers/arrays/compareArrays.js +97 -97
  13. package/dist/helpers/arrays/mergeArrays.d.ts +9 -9
  14. package/dist/helpers/arrays/mergeArrays.js +22 -22
  15. package/dist/helpers/arrays/uniqueArray.d.ts +9 -9
  16. package/dist/helpers/arrays/uniqueArray.js +17 -17
  17. package/dist/helpers/arrays.d.ts +21 -20
  18. package/dist/helpers/arrays.js +33 -32
  19. package/dist/helpers/descriptors/assignDescriptor.d.ts +14 -11
  20. package/dist/helpers/descriptors/assignDescriptor.js +58 -55
  21. package/dist/helpers/descriptors/assignDescriptorDetail.d.ts +14 -11
  22. package/dist/helpers/descriptors/assignDescriptorDetail.js +37 -34
  23. package/dist/helpers/descriptors/checkClearValues.d.ts +12 -11
  24. package/dist/helpers/descriptors/checkClearValues.js +21 -20
  25. package/dist/helpers/descriptors/checkDescriptorComplete.d.ts +11 -10
  26. package/dist/helpers/descriptors/checkDescriptorComplete.js +20 -19
  27. package/dist/helpers/descriptors/cloneDescriptor.d.ts +10 -10
  28. package/dist/helpers/descriptors/cloneDescriptor.js +36 -36
  29. package/dist/helpers/descriptors/cloneDescriptorDetail.d.ts +10 -10
  30. package/dist/helpers/descriptors/cloneDescriptorDetail.js +27 -27
  31. package/dist/helpers/descriptors/compareDescriptor.d.ts +13 -11
  32. package/dist/helpers/descriptors/compareDescriptor.js +33 -31
  33. package/dist/helpers/descriptors/describeObject.d.ts +15 -13
  34. package/dist/helpers/descriptors/describeObject.js +53 -51
  35. package/dist/helpers/descriptors/describeObjectDetail.d.ts +14 -12
  36. package/dist/helpers/descriptors/describeObjectDetail.js +38 -36
  37. package/dist/helpers/descriptors/describeObjectMap.d.ts +36 -20
  38. package/dist/helpers/descriptors/describeObjectMap.js +108 -92
  39. package/dist/helpers/descriptors/nextReference.d.ts +13 -11
  40. package/dist/helpers/descriptors/nextReference.js +31 -29
  41. package/dist/helpers/descriptors/sameDescriptor.d.ts +13 -11
  42. package/dist/helpers/descriptors/sameDescriptor.js +22 -20
  43. package/dist/helpers/descriptors/samples/descriptor.d.ts +34 -27
  44. package/dist/helpers/descriptors/samples/descriptor.js +22 -22
  45. package/dist/helpers/descriptors/samples/descriptorDetail.d.ts +42 -34
  46. package/dist/helpers/descriptors/samples/descriptorDetail.js +24 -24
  47. package/dist/helpers/descriptors/samples/descriptorMap.d.ts +16 -12
  48. package/dist/helpers/descriptors/samples/descriptorMap.js +14 -14
  49. package/dist/helpers/descriptors/samples/mappedDescriptorMap.d.ts +10 -7
  50. package/dist/helpers/descriptors/samples/mappedDescriptorMap.js +287 -284
  51. package/dist/helpers/descriptors.d.ts +44 -28
  52. package/dist/helpers/descriptors.js +58 -42
  53. package/dist/helpers/functions/callWithParams.d.ts +11 -11
  54. package/dist/helpers/functions/callWithParams.js +17 -17
  55. package/dist/helpers/functions/curry.d.ts +11 -11
  56. package/dist/helpers/functions/curry.js +17 -17
  57. package/dist/helpers/functions/delay.d.ts +21 -21
  58. package/dist/helpers/functions/delay.js +32 -32
  59. package/dist/helpers/functions/makeBasicQueue.d.ts +10 -10
  60. package/dist/helpers/functions/makeBasicQueue.js +19 -19
  61. package/dist/helpers/functions/onBodyLoad.d.ts +10 -10
  62. package/dist/helpers/functions/onBodyLoad.js +74 -74
  63. package/dist/helpers/functions/pipe.d.ts +10 -10
  64. package/dist/helpers/functions/pipe.js +18 -18
  65. package/dist/helpers/functions/preloadParams.d.ts +20 -20
  66. package/dist/helpers/functions/preloadParams.js +21 -21
  67. package/dist/helpers/functions/queueManager.d.ts +49 -47
  68. package/dist/helpers/functions/queueManager.js +124 -122
  69. package/dist/helpers/functions/queueTimeout.d.ts +21 -21
  70. package/dist/helpers/functions/queueTimeout.js +23 -23
  71. package/dist/helpers/functions/relevancyFilter.d.ts +35 -35
  72. package/dist/helpers/functions/relevancyFilter.js +34 -34
  73. package/dist/helpers/functions/trace.d.ts +14 -12
  74. package/dist/helpers/functions/trace.js +25 -23
  75. package/dist/helpers/functions.d.ts +29 -29
  76. package/dist/helpers/functions.js +40 -40
  77. package/dist/helpers/numbers/absoluteMax.d.ts +10 -10
  78. package/dist/helpers/numbers/absoluteMax.js +16 -16
  79. package/dist/helpers/numbers/absoluteMin.d.ts +10 -10
  80. package/dist/helpers/numbers/absoluteMin.js +16 -16
  81. package/dist/helpers/numbers/compare.d.ts +13 -13
  82. package/dist/helpers/numbers/compare.js +19 -19
  83. package/dist/helpers/numbers/greatestCommonDivisor.d.ts +10 -10
  84. package/dist/helpers/numbers/greatestCommonDivisor.js +16 -16
  85. package/dist/helpers/numbers/leastCommonMultiple.d.ts +10 -10
  86. package/dist/helpers/numbers/leastCommonMultiple.js +18 -18
  87. package/dist/helpers/numbers/lowestCommonDenominator.d.ts +10 -10
  88. package/dist/helpers/numbers/lowestCommonDenominator.js +20 -20
  89. package/dist/helpers/numbers/randomInteger.d.ts +13 -13
  90. package/dist/helpers/numbers/randomInteger.js +19 -19
  91. package/dist/helpers/numbers/randomNumber.d.ts +13 -13
  92. package/dist/helpers/numbers/randomNumber.js +19 -19
  93. package/dist/helpers/numbers/simplestRatio.d.ts +9 -9
  94. package/dist/helpers/numbers/simplestRatio.js +29 -29
  95. package/dist/helpers/numbers.d.ts +21 -21
  96. package/dist/helpers/numbers.js +36 -36
  97. package/dist/helpers/objects/cloneObject.d.ts +20 -20
  98. package/dist/helpers/objects/cloneObject.js +32 -32
  99. package/dist/helpers/objects/dotGet.d.ts +12 -12
  100. package/dist/helpers/objects/dotGet.js +60 -60
  101. package/dist/helpers/objects/dotNotate.d.ts +28 -28
  102. package/dist/helpers/objects/dotNotate.js +80 -80
  103. package/dist/helpers/objects/dotSet.d.ts +12 -12
  104. package/dist/helpers/objects/dotSet.js +54 -54
  105. package/dist/helpers/objects/dotUnset.d.ts +11 -11
  106. package/dist/helpers/objects/dotUnset.js +53 -53
  107. package/dist/helpers/objects/emptyObject.d.ts +9 -9
  108. package/dist/helpers/objects/emptyObject.js +18 -18
  109. package/dist/helpers/objects/filterObject.d.ts +27 -27
  110. package/dist/helpers/objects/filterObject.js +32 -32
  111. package/dist/helpers/objects/isCloneable.d.ts +9 -9
  112. package/dist/helpers/objects/isCloneable.js +17 -17
  113. package/dist/helpers/objects/isInstanceObject.d.ts +9 -9
  114. package/dist/helpers/objects/isInstanceObject.js +27 -27
  115. package/dist/helpers/objects/isObject.d.ts +9 -9
  116. package/dist/helpers/objects/isObject.js +15 -15
  117. package/dist/helpers/objects/mapObject.d.ts +26 -26
  118. package/dist/helpers/objects/mapObject.js +26 -26
  119. package/dist/helpers/objects/mergeObjects.d.ts +13 -13
  120. package/dist/helpers/objects/mergeObjects.js +20 -20
  121. package/dist/helpers/objects/mergeObjectsBase.d.ts +36 -36
  122. package/dist/helpers/objects/mergeObjectsBase.js +92 -92
  123. package/dist/helpers/objects/mergeObjectsMutable.d.ts +13 -13
  124. package/dist/helpers/objects/mergeObjectsMutable.js +18 -18
  125. package/dist/helpers/objects/objectKeys.d.ts +14 -14
  126. package/dist/helpers/objects/objectKeys.js +40 -40
  127. package/dist/helpers/objects/objectValues.d.ts +14 -14
  128. package/dist/helpers/objects/objectValues.js +21 -21
  129. package/dist/helpers/objects/reduceObject.d.ts +31 -31
  130. package/dist/helpers/objects/reduceObject.js +26 -26
  131. package/dist/helpers/objects/setAndReturnValue.d.ts +14 -14
  132. package/dist/helpers/objects/setAndReturnValue.js +20 -20
  133. package/dist/helpers/objects/setValue.d.ts +15 -15
  134. package/dist/helpers/objects/setValue.js +22 -22
  135. package/dist/helpers/objects.d.ts +100 -100
  136. package/dist/helpers/objects.js +56 -56
  137. package/dist/helpers/strings/camelCase.d.ts +9 -9
  138. package/dist/helpers/strings/camelCase.js +20 -20
  139. package/dist/helpers/strings/kabobCase.d.ts +9 -9
  140. package/dist/helpers/strings/kabobCase.js +19 -19
  141. package/dist/helpers/strings/makeFilepath.d.ts +9 -9
  142. package/dist/helpers/strings/makeFilepath.js +49 -49
  143. package/dist/helpers/strings/makeRelativePath.d.ts +9 -9
  144. package/dist/helpers/strings/makeRelativePath.js +43 -43
  145. package/dist/helpers/strings/regexEscape.d.ts +8 -8
  146. package/dist/helpers/strings/regexEscape.js +15 -15
  147. package/dist/helpers/strings/snakeCase.d.ts +9 -9
  148. package/dist/helpers/strings/snakeCase.js +19 -19
  149. package/dist/helpers/strings/strAfter.d.ts +10 -10
  150. package/dist/helpers/strings/strAfter.js +19 -19
  151. package/dist/helpers/strings/strAfterLast.d.ts +10 -10
  152. package/dist/helpers/strings/strAfterLast.js +19 -19
  153. package/dist/helpers/strings/strBefore.d.ts +10 -10
  154. package/dist/helpers/strings/strBefore.js +19 -19
  155. package/dist/helpers/strings/strBeforeLast.d.ts +10 -10
  156. package/dist/helpers/strings/strBeforeLast.js +19 -19
  157. package/dist/helpers/strings/titleCase.d.ts +9 -9
  158. package/dist/helpers/strings/titleCase.js +20 -20
  159. package/dist/helpers/strings/ucFirst.d.ts +9 -9
  160. package/dist/helpers/strings/ucFirst.js +15 -15
  161. package/dist/helpers/strings/words.d.ts +10 -9
  162. package/dist/helpers/strings/words.js +16 -15
  163. package/dist/helpers/strings.d.ts +25 -25
  164. package/dist/helpers/strings.js +44 -44
  165. package/dist/main.d.ts +9 -9
  166. package/dist/main.js +30 -30
  167. package/package.json +2 -5
@@ -1,62 +1,66 @@
1
- import 'core-js/stable';
2
- export type callableLater = {
3
- fn?: Function;
4
- args?: Array<any>;
5
- };
6
- export type queuedItem = {
7
- item: callableLater | any;
8
- generator: Generator;
9
- };
10
- /**
11
- * Define the format of a queue
12
- * @typdef {Object} IsQueue
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
- constructor(innerList?: queuedItem[] | any);
34
- /**
35
- * Remove and return the next item in the queue
36
- * @returns {queuedItem|*}
37
- */
38
- dequeue(): queuedItem | any;
39
- /**
40
- * Check if the queue is empty
41
- * @returns {boolean}
42
- */
43
- empty(): boolean;
44
- /**
45
- * Add an item to the end of the queue
46
- * @param {queuedItem|*} data
47
- * @returns {BasicQueue}
48
- */
49
- enqueue(data: queuedItem | any): IsQueue<queuedItem>;
50
- /**
51
- * Retrieve the next item from the queue
52
- * @returns {queuedItem|*}
53
- */
54
- peek(): queuedItem | any;
55
- /**
56
- * Get the quantity of items in the queue
57
- * @returns {number}
58
- */
59
- size(): number;
60
- }
61
- export default BasicQueue;
1
+ import 'core-js/stable';
2
+ export type callableLater = {
3
+ fn?: Function;
4
+ args?: Array<any>;
5
+ };
6
+ export type queuedItem = {
7
+ item: callableLater | any;
8
+ generator: Generator;
9
+ };
10
+ /**
11
+ * Define the format of a queue.
12
+ * @typedef {Object} IsQueue
13
+ * @memberOf module:arrayHelpers
14
+ * @property {Array|*} innerList - Stores the data for the queue
15
+ * @method dequeue - Pulls the first item from the queue
16
+ * @method empty - Check if the queue is empty
17
+ * @method enqueue - Adds and item to the end of the queue
18
+ * @method peek - Get the next queue item but does not remove it
19
+ * @method size - Get the size of the queue
20
+ */
21
+ export interface IsQueue<queuedItem> {
22
+ dequeue: () => queuedItem | null;
23
+ empty: () => boolean;
24
+ enqueue: (data: queuedItem) => void;
25
+ peek: () => queuedItem | null;
26
+ size: () => number;
27
+ }
28
+ /**
29
+ * Class BasicQueue is a functional example of a queue to be used with queueManager.
30
+ * @memberOf module:arrayHelpers
31
+ */
32
+ declare class BasicQueue implements IsQueue<queuedItem> {
33
+ private readonly innerList;
34
+ /**
35
+ * @param {Array} [innerList=[]] - Items to pre-populate the queue with, in order.
36
+ */
37
+ constructor(innerList?: queuedItem[] | any);
38
+ /**
39
+ * Remove and return the next item in the queue
40
+ * @returns {queuedItem|*}
41
+ */
42
+ dequeue(): queuedItem | any;
43
+ /**
44
+ * Check if the queue is empty
45
+ * @returns {boolean}
46
+ */
47
+ empty(): boolean;
48
+ /**
49
+ * Add an item to the end of the queue
50
+ * @param {queuedItem|*} data
51
+ * @returns {BasicQueue}
52
+ */
53
+ enqueue(data: queuedItem | any): IsQueue<queuedItem>;
54
+ /**
55
+ * Retrieve the next item from the queue
56
+ * @returns {queuedItem|*}
57
+ */
58
+ peek(): queuedItem | any;
59
+ /**
60
+ * Get the quantity of items in the queue
61
+ * @returns {number}
62
+ */
63
+ size(): number;
64
+ }
65
+ export default BasicQueue;
62
66
  //# sourceMappingURL=BasicQueue.d.ts.map
@@ -1,59 +1,62 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- require('core-js/stable')
8
- /**
9
- * Class BasicQueue is a functional example of a queue to be used with queueManager.
10
- * @memberOf module:arrayHelpers
11
- */
12
- class BasicQueue {
13
- constructor (innerList = []) {
14
- this.innerList = innerList
15
- }
16
-
17
- /**
18
- * Remove and return the next item in the queue
19
- * @returns {queuedItem|*}
20
- */
21
- dequeue () {
22
- return this.innerList.shift()
23
- }
24
-
25
- /**
26
- * Check if the queue is empty
27
- * @returns {boolean}
28
- */
29
- empty () {
30
- return !this.size()
31
- }
32
-
33
- /**
34
- * Add an item to the end of the queue
35
- * @param {queuedItem|*} data
36
- * @returns {BasicQueue}
37
- */
38
- enqueue (data) {
39
- this.innerList.push(data)
40
- return this
41
- }
42
-
43
- /**
44
- * Retrieve the next item from the queue
45
- * @returns {queuedItem|*}
46
- */
47
- peek () {
48
- return this.empty() ? null : this.innerList[0]
49
- }
50
-
51
- /**
52
- * Get the quantity of items in the queue
53
- * @returns {number}
54
- */
55
- size () {
56
- return this.innerList.length
57
- }
58
- }
59
- var _default = exports.default = BasicQueue
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ require('core-js/stable')
8
+ /**
9
+ * Class BasicQueue is a functional example of a queue to be used with queueManager.
10
+ * @memberOf module:arrayHelpers
11
+ */
12
+ class BasicQueue {
13
+ /**
14
+ * @param {Array} [innerList=[]] - Items to pre-populate the queue with, in order.
15
+ */
16
+ constructor (innerList = []) {
17
+ this.innerList = innerList
18
+ }
19
+
20
+ /**
21
+ * Remove and return the next item in the queue
22
+ * @returns {queuedItem|*}
23
+ */
24
+ dequeue () {
25
+ return this.innerList.shift()
26
+ }
27
+
28
+ /**
29
+ * Check if the queue is empty
30
+ * @returns {boolean}
31
+ */
32
+ empty () {
33
+ return !this.size()
34
+ }
35
+
36
+ /**
37
+ * Add an item to the end of the queue
38
+ * @param {queuedItem|*} data
39
+ * @returns {BasicQueue}
40
+ */
41
+ enqueue (data) {
42
+ this.innerList.push(data)
43
+ return this
44
+ }
45
+
46
+ /**
47
+ * Retrieve the next item from the queue
48
+ * @returns {queuedItem|*}
49
+ */
50
+ peek () {
51
+ return this.empty() ? null : this.innerList[0]
52
+ }
53
+
54
+ /**
55
+ * Get the quantity of items in the queue
56
+ * @returns {number}
57
+ */
58
+ size () {
59
+ return this.innerList.length
60
+ }
61
+ }
62
+ var _default = exports.default = BasicQueue
@@ -1,11 +1,11 @@
1
- import 'core-js/stable';
2
- /**
3
- * Having an array and a potential new array element, check if the element is in the array, if not append to array.
4
- * @memberOf module:arrayHelpers
5
- * @param {*} item - An potential array element, possibly a DomItem
6
- * @param {Array} array - An array where an element may be appended.
7
- * @returns {Array}
8
- */
9
- declare const addUniqueToArray: (item: any, array: Array<any>) => Array<any>;
10
- export default addUniqueToArray;
1
+ import 'core-js/stable';
2
+ /**
3
+ * Having an array and a potential new array element, check if the element is in the array, if not append to array.
4
+ * @memberOf module:arrayHelpers
5
+ * @param {*} item - An potential array element, possibly a DomItem
6
+ * @param {Array} array - An array where an element may be appended.
7
+ * @returns {Array}
8
+ */
9
+ declare const addUniqueToArray: (item: any, array: Array<any>) => Array<any>;
10
+ export default addUniqueToArray;
11
11
  //# sourceMappingURL=addUniqueToArray.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
- require('core-js/modules/es.array.includes.js')
8
- require('core-js/stable')
9
- /**
10
- * Having an array and a potential new array element, check if the element is in the array, if not append to array.
11
- * @memberOf module:arrayHelpers
12
- * @param {*} item - An potential array element, possibly a DomItem
13
- * @param {Array} array - An array where an element may be appended.
14
- * @returns {Array}
15
- */
16
- const addUniqueToArray = (item, array) => !array.includes(item) ? array.concat([item]) : array
17
- var _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
+ require('core-js/stable')
9
+ /**
10
+ * Having an array and a potential new array element, check if the element is in the array, if not append to array.
11
+ * @memberOf module:arrayHelpers
12
+ * @param {*} item - An potential array element, possibly a DomItem
13
+ * @param {Array} array - An array where an element may be appended.
14
+ * @returns {Array}
15
+ */
16
+ const addUniqueToArray = (item, array) => !array.includes(item) ? array.concat([item]) : array
17
+ var _default = exports.default = addUniqueToArray
@@ -1,12 +1,12 @@
1
- import 'core-js/stable';
2
- /**
3
- * Leverage buildArrayBase to generate an array filled with a copy of the provided item.
4
- * The length defines how long the array should be.
5
- * @memberOf module:arrayHelpers
6
- * @param {*} item - The item to be used for each array element
7
- * @param {number} length - The desired length of the array
8
- * @returns {Array.<*>}
9
- */
10
- declare const buildArray: (item: any, length: number) => Array<any>;
11
- export default buildArray;
1
+ import 'core-js/stable';
2
+ /**
3
+ * Leverage buildArrayBase to generate an array filled with a copy of the provided item.
4
+ * The length defines how long the array should be.
5
+ * @memberOf module:arrayHelpers
6
+ * @param {*} item - The item to be used for each array element
7
+ * @param {number} length - The desired length of the array
8
+ * @returns {Array.<*>}
9
+ */
10
+ declare const buildArray: (item: any, length: number) => Array<any>;
11
+ export default buildArray;
12
12
  //# sourceMappingURL=buildArray.d.ts.map
@@ -1,26 +1,26 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- require('core-js/stable')
8
- var _cloneObject = _interopRequireDefault(require('../objects/cloneObject'))
9
- function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
10
- /**
11
- * Leverage buildArrayBase to generate an array filled with a copy of the provided item.
12
- * The length defines how long the array should be.
13
- * @memberOf module:arrayHelpers
14
- * @param {*} item - The item to be used for each array element
15
- * @param {number} length - The desired length of the array
16
- * @returns {Array.<*>}
17
- */
18
- const buildArray = (item, length) => {
19
- const arr = []
20
- while (arr.length < length) {
21
- const cloned = (0, _cloneObject.default)(item)
22
- arr.push(cloned)
23
- }
24
- return arr
25
- }
26
- var _default = exports.default = buildArray
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ require('core-js/stable')
8
+ var _cloneObject = _interopRequireDefault(require('../objects/cloneObject'))
9
+ function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
10
+ /**
11
+ * Leverage buildArrayBase to generate an array filled with a copy of the provided item.
12
+ * The length defines how long the array should be.
13
+ * @memberOf module:arrayHelpers
14
+ * @param {*} item - The item to be used for each array element
15
+ * @param {number} length - The desired length of the array
16
+ * @returns {Array.<*>}
17
+ */
18
+ const buildArray = (item, length) => {
19
+ const arr = []
20
+ while (arr.length < length) {
21
+ const cloned = (0, _cloneObject.default)(item)
22
+ arr.push(cloned)
23
+ }
24
+ return arr
25
+ }
26
+ var _default = exports.default = buildArray
@@ -1,12 +1,12 @@
1
- import 'core-js/stable';
2
- /**
3
- * Leverage buildArrayBase to generate an array filled with references to the provided item.
4
- * The length defines how long the array should be.
5
- * @memberOf module:arrayHelpers
6
- * @param {*} item - The item to be used for each array element
7
- * @param {number} length - The desired length of the array
8
- * @returns {Array.<*>}
9
- */
10
- declare const buildArrayOfReferences: (item: any, length: number) => Array<any>;
11
- export default buildArrayOfReferences;
1
+ import 'core-js/stable';
2
+ /**
3
+ * Leverage buildArrayBase to generate an array filled with references to the provided item.
4
+ * The length defines how long the array should be.
5
+ * @memberOf module:arrayHelpers
6
+ * @param {*} item - The item to be used for each array element
7
+ * @param {number} length - The desired length of the array
8
+ * @returns {Array.<*>}
9
+ */
10
+ declare const buildArrayOfReferences: (item: any, length: number) => Array<any>;
11
+ export default buildArrayOfReferences;
12
12
  //# sourceMappingURL=buildArrayOfReferences.d.ts.map
@@ -1,23 +1,23 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.default = void 0
7
- require('core-js/stable')
8
- /**
9
- * Leverage buildArrayBase to generate an array filled with references to the provided item.
10
- * The length defines how long the array should be.
11
- * @memberOf module:arrayHelpers
12
- * @param {*} item - The item to be used for each array element
13
- * @param {number} length - The desired length of the array
14
- * @returns {Array.<*>}
15
- */
16
- const buildArrayOfReferences = (item, length) => {
17
- const arr = []
18
- while (arr.length < length) {
19
- arr.push(item)
20
- }
21
- return arr
22
- }
23
- var _default = exports.default = buildArrayOfReferences
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.default = void 0
7
+ require('core-js/stable')
8
+ /**
9
+ * Leverage buildArrayBase to generate an array filled with references to the provided item.
10
+ * The length defines how long the array should be.
11
+ * @memberOf module:arrayHelpers
12
+ * @param {*} item - The item to be used for each array element
13
+ * @param {number} length - The desired length of the array
14
+ * @returns {Array.<*>}
15
+ */
16
+ const buildArrayOfReferences = (item, length) => {
17
+ const arr = []
18
+ while (arr.length < length) {
19
+ arr.push(item)
20
+ }
21
+ return arr
22
+ }
23
+ var _default = exports.default = buildArrayOfReferences
@@ -1,98 +1,98 @@
1
- import 'core-js/stable';
2
- /**
3
- * Store the comparison result for an element that may exist in either of compared arrays.
4
- * - value stores the element value from the arrays being compared
5
- * - results has the comparison results where first index (0) is result for first compared array
6
- * and the second index (1) will be the result for the second compared array
7
- * @example
8
- * // example of input and resulting output
9
- *
10
- * const arr1 = ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1']
11
- * const arr2 = ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
12
- *
13
- * // Taking the first element in both, then the value: 'match1' exists in both arrays
14
- * // compareArrayResult will be { value: 'match1', result: [0, 0] }
15
- * // First index of 0 indicates this value in the first array exists in the second array
16
- * // Second index of 0 indicates this value in the second array exists in the first array
17
- *
18
- * // Taking the second element in the first array, then the value: 'firstMismatch1' exists in only the first array
19
- * // compareArrayResult will be { value: 'firstMismatch1', result: [1, -1] }
20
- * // First index of 1 indicates this value in the first array might need to be added to the second array
21
- * // Second index of -1 indicates this value only exists in the first array
22
- *
23
- * // Taking the third element in the second array, then the value: 'secondMismatch1' exists in only the second array
24
- * // compareArrayResult will be { value: 'secondMismatch1', result: [-1, 1] }
25
- * // First index of -1 indicates this value only exists in the second array
26
- * // Second index of 1 indicates this value in the second array might need to be added to the first array
27
- * @typedef {Object.<string, string|Array.<number>>} module:arrayHelpers~compareArrayResult
28
- * @memberOf module:arrayHelpers
29
- * @property {string} value - The element value being compared
30
- * @property {Array.<Array.<string|number>>} keys - Keys in arrays associated with this value
31
- * @property {Array.<number>} result - The results in the order of the compared arrays
32
- */
33
- export type compareArrayResult = {
34
- value: string;
35
- keys: Array<Array<number | string>>;
36
- result: Array<number>;
37
- };
38
- export type compareArrayResultMap = Array<compareArrayResult>;
39
- /**
40
- * Compare two Arrays and return the Object where the value for each property is as follows:
41
- * -1 to indicate val1 is less than val2
42
- * 0 to indicate both values are the equal
43
- * 1 to indicate val1 is greater than val2
44
- * The returned Object uses the element values as the property names
45
- * This functions works by first creating a concatenated array of all unique values. Then for each unique values,
46
- * convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
47
- * Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
48
- * 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
49
- * or more.
50
- * @example
51
- * // example of input and resulting output
52
- * compareArrays(
53
- * ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
54
- * ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
55
- * )
56
- * // unique array
57
- * ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
58
- * // result object
59
- * [
60
- * {
61
- * value: 'match1',
62
- * keys: [[0], [0]],
63
- * result: [0, 0]
64
- * },
65
- * {
66
- * value: 'firstMismatch1',
67
- * keys: [[1], []],
68
- * result: [1, -1]
69
- * },
70
- * {
71
- * value: 'match2',
72
- * keys: [[2], [1]],
73
- * result: [0, 0]
74
- * },
75
- * {
76
- * value: 'firstMismatch2',
77
- * keys: [[3], []],
78
- * result: [1, -1]
79
- * },
80
- * {
81
- * value: 'badMatch1',
82
- * keys: [[4], [3, 4]],
83
- * result: [0, 0]
84
- * },
85
- * {
86
- * value: 'secondMismatch1',
87
- * keys: [[], [2]],
88
- * result: [-1, 1]
89
- * }
90
- * ]
91
- *
92
- * @memberOf module:arrayHelpers
93
- * @param {...Array} arrays - The arrays to compare
94
- * @returns {Array.<module:arrayHelpers~compareArrayResult>}
95
- */
96
- declare const compareArrays: (...arrays: Array<Array<any>>) => compareArrayResultMap;
97
- export default compareArrays;
1
+ import 'core-js/stable';
2
+ /**
3
+ * Store the comparison result for an element that may exist in either of compared arrays.
4
+ * - value stores the element value from the arrays being compared
5
+ * - results has the comparison results where first index (0) is result for first compared array
6
+ * and the second index (1) will be the result for the second compared array
7
+ * @example
8
+ * // example of input and resulting output
9
+ *
10
+ * const arr1 = ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1']
11
+ * const arr2 = ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
12
+ *
13
+ * // Taking the first element in both, then the value: 'match1' exists in both arrays
14
+ * // compareArrayResult will be { value: 'match1', result: [0, 0] }
15
+ * // First index of 0 indicates this value in the first array exists in the second array
16
+ * // Second index of 0 indicates this value in the second array exists in the first array
17
+ *
18
+ * // Taking the second element in the first array, then the value: 'firstMismatch1' exists in only the first array
19
+ * // compareArrayResult will be { value: 'firstMismatch1', result: [1, -1] }
20
+ * // First index of 1 indicates this value in the first array might need to be added to the second array
21
+ * // Second index of -1 indicates this value only exists in the first array
22
+ *
23
+ * // Taking the third element in the second array, then the value: 'secondMismatch1' exists in only the second array
24
+ * // compareArrayResult will be { value: 'secondMismatch1', result: [-1, 1] }
25
+ * // First index of -1 indicates this value only exists in the second array
26
+ * // Second index of 1 indicates this value in the second array might need to be added to the first array
27
+ * @typedef {Object.<string, string|Array.<number>>} module:arrayHelpers~compareArrayResult
28
+ * @memberOf module:arrayHelpers
29
+ * @property {string} value - The element value being compared
30
+ * @property {Array.<Array.<string|number>>} keys - Keys in arrays associated with this value
31
+ * @property {Array.<number>} result - The results in the order of the compared arrays
32
+ */
33
+ export type compareArrayResult = {
34
+ value: string;
35
+ keys: Array<Array<number | string>>;
36
+ result: Array<number>;
37
+ };
38
+ export type compareArrayResultMap = Array<compareArrayResult>;
39
+ /**
40
+ * Compare two Arrays and return the Object where the value for each property is as follows:
41
+ * -1 to indicate val1 is less than val2
42
+ * 0 to indicate both values are the equal
43
+ * 1 to indicate val1 is greater than val2
44
+ * The returned Object uses the element values as the property names
45
+ * This functions works by first creating a concatenated array of all unique values. Then for each unique values,
46
+ * convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
47
+ * Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
48
+ * 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
49
+ * or more.
50
+ * @example
51
+ * // example of input and resulting output
52
+ * compareArrays(
53
+ * ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
54
+ * ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
55
+ * )
56
+ * // unique array
57
+ * ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
58
+ * // result object
59
+ * [
60
+ * {
61
+ * value: 'match1',
62
+ * keys: [[0], [0]],
63
+ * result: [0, 0]
64
+ * },
65
+ * {
66
+ * value: 'firstMismatch1',
67
+ * keys: [[1], []],
68
+ * result: [1, -1]
69
+ * },
70
+ * {
71
+ * value: 'match2',
72
+ * keys: [[2], [1]],
73
+ * result: [0, 0]
74
+ * },
75
+ * {
76
+ * value: 'firstMismatch2',
77
+ * keys: [[3], []],
78
+ * result: [1, -1]
79
+ * },
80
+ * {
81
+ * value: 'badMatch1',
82
+ * keys: [[4], [3, 4]],
83
+ * result: [0, 0]
84
+ * },
85
+ * {
86
+ * value: 'secondMismatch1',
87
+ * keys: [[], [2]],
88
+ * result: [-1, 1]
89
+ * }
90
+ * ]
91
+ *
92
+ * @memberOf module:arrayHelpers
93
+ * @param {...Array} arrays - The arrays to compare
94
+ * @returns {Array.<module:arrayHelpers~compareArrayResult>}
95
+ */
96
+ declare const compareArrays: (...arrays: Array<Array<any>>) => compareArrayResultMap;
97
+ export default compareArrays;
98
98
  //# sourceMappingURL=compareArrays.d.ts.map