si-funciona 2.3.2 → 2.3.4

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 (181) hide show
  1. package/README.md +1337 -1244
  2. package/browser/siFunciona.js +24205 -24282
  3. package/browser/siFunciona.min.js +1 -1
  4. package/dist/helpers/arrays/BasicQueue.d.ts +66 -61
  5. package/dist/helpers/arrays/BasicQueue.js +62 -60
  6. package/dist/helpers/arrays/BasicQueue.min.js +1 -1
  7. package/dist/helpers/arrays/addUniqueToArray.d.ts +1 -0
  8. package/dist/helpers/arrays/buildArray.d.ts +1 -0
  9. package/dist/helpers/arrays/buildArrayOfReferences.d.ts +1 -0
  10. package/dist/helpers/arrays/compareArrays.d.ts +1 -0
  11. package/dist/helpers/arrays/compareArrays.js +24 -30
  12. package/dist/helpers/arrays/compareArrays.min.js +1 -1
  13. package/dist/helpers/arrays/mergeArrays.d.ts +1 -0
  14. package/dist/helpers/arrays/mergeArrays.js +2 -7
  15. package/dist/helpers/arrays/mergeArrays.min.js +1 -1
  16. package/dist/helpers/arrays/uniqueArray.d.ts +1 -0
  17. package/dist/helpers/arrays.d.ts +22 -20
  18. package/dist/helpers/arrays.js +33 -32
  19. package/dist/helpers/descriptors/assignDescriptor.d.ts +15 -11
  20. package/dist/helpers/descriptors/assignDescriptor.js +58 -60
  21. package/dist/helpers/descriptors/assignDescriptor.min.js +1 -1
  22. package/dist/helpers/descriptors/assignDescriptorDetail.d.ts +15 -11
  23. package/dist/helpers/descriptors/assignDescriptorDetail.js +37 -38
  24. package/dist/helpers/descriptors/assignDescriptorDetail.min.js +1 -1
  25. package/dist/helpers/descriptors/checkClearValues.d.ts +13 -11
  26. package/dist/helpers/descriptors/checkClearValues.js +21 -23
  27. package/dist/helpers/descriptors/checkClearValues.min.js +1 -1
  28. package/dist/helpers/descriptors/checkDescriptorComplete.d.ts +12 -10
  29. package/dist/helpers/descriptors/checkDescriptorComplete.js +20 -19
  30. package/dist/helpers/descriptors/cloneDescriptor.d.ts +11 -10
  31. package/dist/helpers/descriptors/cloneDescriptor.js +36 -37
  32. package/dist/helpers/descriptors/cloneDescriptor.min.js +1 -1
  33. package/dist/helpers/descriptors/cloneDescriptorDetail.d.ts +11 -10
  34. package/dist/helpers/descriptors/cloneDescriptorDetail.js +27 -27
  35. package/dist/helpers/descriptors/compareDescriptor.d.ts +14 -11
  36. package/dist/helpers/descriptors/compareDescriptor.js +33 -32
  37. package/dist/helpers/descriptors/compareDescriptor.min.js +1 -1
  38. package/dist/helpers/descriptors/describeObject.d.ts +16 -13
  39. package/dist/helpers/descriptors/describeObject.js +53 -51
  40. package/dist/helpers/descriptors/describeObjectDetail.d.ts +15 -12
  41. package/dist/helpers/descriptors/describeObjectDetail.js +38 -38
  42. package/dist/helpers/descriptors/describeObjectDetail.min.js +1 -1
  43. package/dist/helpers/descriptors/describeObjectMap.d.ts +37 -20
  44. package/dist/helpers/descriptors/describeObjectMap.js +108 -97
  45. package/dist/helpers/descriptors/describeObjectMap.min.js +1 -1
  46. package/dist/helpers/descriptors/nextReference.d.ts +14 -11
  47. package/dist/helpers/descriptors/nextReference.js +31 -29
  48. package/dist/helpers/descriptors/sameDescriptor.d.ts +14 -11
  49. package/dist/helpers/descriptors/sameDescriptor.js +22 -20
  50. package/dist/helpers/descriptors/samples/descriptor.d.ts +35 -27
  51. package/dist/helpers/descriptors/samples/descriptorDetail.d.ts +43 -34
  52. package/dist/helpers/descriptors/samples/descriptorMap.d.ts +17 -12
  53. package/dist/helpers/descriptors/samples/mappedDescriptorMap.d.ts +11 -7
  54. package/dist/helpers/descriptors/samples/mappedDescriptorMap.js +287 -284
  55. package/dist/helpers/descriptors.d.ts +45 -28
  56. package/dist/helpers/descriptors.js +58 -42
  57. package/dist/helpers/functions/callWithParams.d.ts +1 -0
  58. package/dist/helpers/functions/callWithParams.js +1 -6
  59. package/dist/helpers/functions/callWithParams.min.js +1 -1
  60. package/dist/helpers/functions/curry.d.ts +1 -0
  61. package/dist/helpers/functions/curry.js +1 -12
  62. package/dist/helpers/functions/curry.min.js +1 -1
  63. package/dist/helpers/functions/delay.d.ts +1 -0
  64. package/dist/helpers/functions/delay.js +4 -5
  65. package/dist/helpers/functions/delay.min.js +1 -1
  66. package/dist/helpers/functions/makeBasicQueue.d.ts +11 -10
  67. package/dist/helpers/functions/makeBasicQueue.js +19 -20
  68. package/dist/helpers/functions/makeBasicQueue.min.js +1 -1
  69. package/dist/helpers/functions/onBodyLoad.d.ts +1 -0
  70. package/dist/helpers/functions/onBodyLoad.js +1 -2
  71. package/dist/helpers/functions/onBodyLoad.min.js +1 -1
  72. package/dist/helpers/functions/pipe.d.ts +1 -0
  73. package/dist/helpers/functions/pipe.js +3 -6
  74. package/dist/helpers/functions/pipe.min.js +1 -1
  75. package/dist/helpers/functions/preloadParams.d.ts +1 -0
  76. package/dist/helpers/functions/preloadParams.js +3 -8
  77. package/dist/helpers/functions/preloadParams.min.js +1 -1
  78. package/dist/helpers/functions/queueManager.d.ts +50 -47
  79. package/dist/helpers/functions/queueManager.js +124 -132
  80. package/dist/helpers/functions/queueManager.min.js +1 -1
  81. package/dist/helpers/functions/queueTimeout.d.ts +1 -0
  82. package/dist/helpers/functions/queueTimeout.js +2 -10
  83. package/dist/helpers/functions/queueTimeout.min.js +1 -1
  84. package/dist/helpers/functions/relevancyFilter.d.ts +36 -35
  85. package/dist/helpers/functions/relevancyFilter.js +34 -36
  86. package/dist/helpers/functions/relevancyFilter.min.js +1 -1
  87. package/dist/helpers/functions/trace.d.ts +15 -12
  88. package/dist/helpers/functions/trace.js +25 -26
  89. package/dist/helpers/functions/trace.min.js +1 -1
  90. package/dist/helpers/functions.d.ts +1 -0
  91. package/dist/helpers/numbers/absoluteMax.d.ts +1 -0
  92. package/dist/helpers/numbers/absoluteMin.d.ts +1 -0
  93. package/dist/helpers/numbers/compare.d.ts +1 -0
  94. package/dist/helpers/numbers/greatestCommonDivisor.d.ts +1 -0
  95. package/dist/helpers/numbers/leastCommonMultiple.d.ts +1 -0
  96. package/dist/helpers/numbers/lowestCommonDenominator.d.ts +11 -10
  97. package/dist/helpers/numbers/lowestCommonDenominator.js +20 -23
  98. package/dist/helpers/numbers/lowestCommonDenominator.min.js +1 -1
  99. package/dist/helpers/numbers/randomInteger.d.ts +1 -0
  100. package/dist/helpers/numbers/randomInteger.js +1 -5
  101. package/dist/helpers/numbers/randomInteger.min.js +1 -1
  102. package/dist/helpers/numbers/randomNumber.d.ts +1 -0
  103. package/dist/helpers/numbers/randomNumber.js +1 -5
  104. package/dist/helpers/numbers/randomNumber.min.js +1 -1
  105. package/dist/helpers/numbers/simplestRatio.d.ts +1 -0
  106. package/dist/helpers/numbers/simplestRatio.js +4 -4
  107. package/dist/helpers/numbers/simplestRatio.min.js +1 -1
  108. package/dist/helpers/numbers.d.ts +1 -0
  109. package/dist/helpers/objects/cloneObject.d.ts +1 -0
  110. package/dist/helpers/objects/cloneObject.js +10 -15
  111. package/dist/helpers/objects/cloneObject.min.js +1 -1
  112. package/dist/helpers/objects/dotGet.d.ts +1 -0
  113. package/dist/helpers/objects/dotGet.js +1 -2
  114. package/dist/helpers/objects/dotGet.min.js +1 -1
  115. package/dist/helpers/objects/dotNotate.d.ts +1 -0
  116. package/dist/helpers/objects/dotNotate.js +6 -15
  117. package/dist/helpers/objects/dotNotate.min.js +1 -1
  118. package/dist/helpers/objects/dotSet.d.ts +1 -0
  119. package/dist/helpers/objects/dotSet.js +1 -2
  120. package/dist/helpers/objects/dotSet.min.js +1 -1
  121. package/dist/helpers/objects/dotUnset.d.ts +1 -0
  122. package/dist/helpers/objects/emptyObject.d.ts +1 -0
  123. package/dist/helpers/objects/filterObject.d.ts +1 -0
  124. package/dist/helpers/objects/filterObject.js +8 -11
  125. package/dist/helpers/objects/filterObject.min.js +1 -1
  126. package/dist/helpers/objects/isCloneable.d.ts +1 -0
  127. package/dist/helpers/objects/isInstanceObject.d.ts +1 -0
  128. package/dist/helpers/objects/isObject.d.ts +1 -0
  129. package/dist/helpers/objects/mapObject.d.ts +1 -0
  130. package/dist/helpers/objects/mapObject.js +1 -4
  131. package/dist/helpers/objects/mapObject.min.js +1 -1
  132. package/dist/helpers/objects/mergeObjects.d.ts +1 -0
  133. package/dist/helpers/objects/mergeObjectsBase.d.ts +1 -0
  134. package/dist/helpers/objects/mergeObjectsBase.js +58 -67
  135. package/dist/helpers/objects/mergeObjectsBase.min.js +1 -1
  136. package/dist/helpers/objects/mergeObjectsMutable.d.ts +1 -0
  137. package/dist/helpers/objects/objectKeys.d.ts +1 -0
  138. package/dist/helpers/objects/objectKeys.js +1 -2
  139. package/dist/helpers/objects/objectKeys.min.js +1 -1
  140. package/dist/helpers/objects/objectValues.d.ts +1 -0
  141. package/dist/helpers/objects/objectValues.js +1 -4
  142. package/dist/helpers/objects/objectValues.min.js +1 -1
  143. package/dist/helpers/objects/reduceObject.d.ts +1 -0
  144. package/dist/helpers/objects/reduceObject.js +1 -4
  145. package/dist/helpers/objects/reduceObject.min.js +1 -1
  146. package/dist/helpers/objects/setAndReturnValue.d.ts +1 -0
  147. package/dist/helpers/objects/setValue.d.ts +1 -0
  148. package/dist/helpers/objects.d.ts +5 -4
  149. package/dist/helpers/strings/camelCase.d.ts +10 -9
  150. package/dist/helpers/strings/camelCase.js +20 -20
  151. package/dist/helpers/strings/kabobCase.d.ts +10 -9
  152. package/dist/helpers/strings/kabobCase.js +19 -19
  153. package/dist/helpers/strings/makeFilepath.d.ts +10 -9
  154. package/dist/helpers/strings/makeFilepath.js +49 -50
  155. package/dist/helpers/strings/makeFilepath.min.js +1 -1
  156. package/dist/helpers/strings/makeRelativePath.d.ts +10 -9
  157. package/dist/helpers/strings/makeRelativePath.js +43 -43
  158. package/dist/helpers/strings/makeRelativePath.min.js +1 -1
  159. package/dist/helpers/strings/regexEscape.d.ts +9 -8
  160. package/dist/helpers/strings/regexEscape.js +15 -17
  161. package/dist/helpers/strings/regexEscape.min.js +1 -1
  162. package/dist/helpers/strings/snakeCase.d.ts +10 -9
  163. package/dist/helpers/strings/snakeCase.js +19 -19
  164. package/dist/helpers/strings/strAfter.d.ts +11 -10
  165. package/dist/helpers/strings/strAfter.js +19 -19
  166. package/dist/helpers/strings/strAfterLast.d.ts +11 -10
  167. package/dist/helpers/strings/strAfterLast.js +19 -19
  168. package/dist/helpers/strings/strBefore.d.ts +11 -10
  169. package/dist/helpers/strings/strBefore.js +19 -19
  170. package/dist/helpers/strings/strBeforeLast.d.ts +11 -10
  171. package/dist/helpers/strings/strBeforeLast.js +19 -19
  172. package/dist/helpers/strings/titleCase.d.ts +10 -9
  173. package/dist/helpers/strings/titleCase.js +20 -20
  174. package/dist/helpers/strings/ucFirst.d.ts +10 -9
  175. package/dist/helpers/strings/ucFirst.js +15 -15
  176. package/dist/helpers/strings/words.d.ts +11 -9
  177. package/dist/helpers/strings/words.js +16 -16
  178. package/dist/helpers/strings/words.min.js +1 -1
  179. package/dist/helpers/strings.d.ts +1 -0
  180. package/dist/main.d.ts +1 -0
  181. package/package.json +4 -4
package/README.md CHANGED
@@ -2,1247 +2,1340 @@
2
2
 
3
3
  ## Funciones de utilidad para uso general. [General usage utility functions.]
4
4
 
5
- ## Modules
6
-
7
- <dl>
8
- <dt><a href="#module_siFunciona">siFunciona</a></dt>
9
- <dd><p>All the siFunciona system functions for stringing together functions and simplifying logic.</p>
10
- </dd>
11
- <dt><a href="#module_stringHelpers">stringHelpers</a></dt>
12
- <dd><p>Manage how strings are manipulated with these utilities.</p>
13
- </dd>
14
- <dt><a href="#module_objectHelpers">objectHelpers</a></dt>
15
- <dd><p>Simplify working with object by providing array-like parsing. Also, provides cloning and merging along with accessors that always have a return value for optimal nesting.</p>
16
- </dd>
17
- <dt><a href="#module_numberHelpers">numberHelpers</a></dt>
18
- <dd><p>Some number comparators and random number generators.</p>
19
- </dd>
20
- <dt><a href="#module_functionHelpers">functionHelpers</a></dt>
21
- <dd><p>Manage how functions are called with these utilities.</p>
22
- </dd>
23
- <dt><a href="#module_objectDescriptors">objectDescriptors</a></dt>
24
- <dd><p>Create a format to standardize every object into a specific template.</p>
25
- </dd>
26
- <dt><a href="#module_arrayHelpers">arrayHelpers</a></dt>
27
- <dd><p>Some simple utility functions for generating arrays or performing work on arrays.</p>
28
- </dd>
29
- </dl>
30
-
31
- <a name="module_siFunciona"></a>
32
-
33
- ## siFunciona
34
- All the siFunciona system functions for stringing together functions and simplifying logic.
35
-
36
- **Version**: 1.0.0
37
- **Author**: Joshua Heagle <joshuaheagle@gmail.com>
38
- <a name="module_stringHelpers"></a>
39
-
40
- ## stringHelpers
41
- Manage how strings are manipulated with these utilities.
42
-
43
- **Version**: 1.0.0
44
- **Author**: Joshua Heagle <joshuaheagle@gmail.com>
45
-
46
- * [stringHelpers](#module_stringHelpers)
47
- * [.words(str)](#module_stringHelpers.words) ⇒ <code>array</code>
48
- * [.ucFirst(str)](#module_stringHelpers.ucFirst) ⇒ <code>string</code>
49
- * [.titleCase(str)](#module_stringHelpers.titleCase) <code>string</code>
50
- * [.strBeforeLast(str, search)](#module_stringHelpers.strBeforeLast) ⇒ <code>string</code>
51
- * [.strBefore(str, search)](#module_stringHelpers.strBefore) ⇒ <code>string</code>
52
- * [.strAfterLast(str, search)](#module_stringHelpers.strAfterLast) <code>string</code>
53
- * [.strAfter(str, search)](#module_stringHelpers.strAfter) ⇒ <code>string</code>
54
- * [.snakeCase(str)](#module_stringHelpers.snakeCase) ⇒ <code>string</code>
55
- * [.regexEscape(str)](#module_stringHelpers.regexEscape) ⇒ <code>string</code>
56
- * [.makeRelativePath(fromFile, toFile)](#module_stringHelpers.makeRelativePath) <code>string</code>
57
- * [.makeFilepath(root, [append])](#module_stringHelpers.makeFilepath) ⇒ <code>string</code>
58
- * [.kabobCase(str)](#module_stringHelpers.kabobCase) ⇒ <code>string</code>
59
- * [.camelCase(str)](#module_stringHelpers.camelCase) <code>string</code>
60
-
61
- <a name="module_stringHelpers.words"></a>
62
-
63
- ### stringHelpers.words(str) ⇒ <code>array</code>
64
- Split a string into sets of numbers or letters.
65
-
66
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
67
-
68
- | Param | Type |
69
- | --- | --- |
70
- | str | <code>string</code> |
71
-
72
- <a name="module_stringHelpers.ucFirst"></a>
73
-
74
- ### stringHelpers.ucFirst(str) ⇒ <code>string</code>
75
- Given a string, make the first character uppercase and the rest lowercase.
76
-
77
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
78
-
79
- | Param | Type |
80
- | --- | --- |
81
- | str | <code>string</code> |
82
-
83
- <a name="module_stringHelpers.titleCase"></a>
84
-
85
- ### stringHelpers.titleCase(str) <code>string</code>
86
- Given a string in kebab-case, snake_case, camelCase or 'Sentence case', convert to 'Title Case'.
87
-
88
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
89
-
90
- | Param | Type |
91
- | --- | --- |
92
- | str | <code>string</code> |
93
-
94
- <a name="module_stringHelpers.strBeforeLast"></a>
95
-
96
- ### stringHelpers.strBeforeLast(str, search) <code>string</code>
97
- Retrieve the string part after the last search match.
98
-
99
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
100
-
101
- | Param | Type |
102
- | --- | --- |
103
- | str | <code>string</code> |
104
- | search | <code>string</code> |
105
-
106
- <a name="module_stringHelpers.strBefore"></a>
107
-
108
- ### stringHelpers.strBefore(str, search) <code>string</code>
109
- Retrieve the string part before the search match.
110
-
111
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
112
-
113
- | Param | Type |
114
- | --- | --- |
115
- | str | <code>string</code> |
116
- | search | <code>string</code> |
117
-
118
- <a name="module_stringHelpers.strAfterLast"></a>
119
-
120
- ### stringHelpers.strAfterLast(str, search) <code>string</code>
121
- Retrieve the string part after the last search match.
122
-
123
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
124
-
125
- | Param | Type |
126
- | --- | --- |
127
- | str | <code>string</code> |
128
- | search | <code>string</code> |
129
-
130
- <a name="module_stringHelpers.strAfter"></a>
131
-
132
- ### stringHelpers.strAfter(str, search) <code>string</code>
133
- Retrieve the string part after the search match.
134
-
135
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
136
-
137
- | Param | Type |
138
- | --- | --- |
139
- | str | <code>string</code> |
140
- | search | <code>string</code> |
141
-
142
- <a name="module_stringHelpers.snakeCase"></a>
143
-
144
- ### stringHelpers.snakeCase(str) <code>string</code>
145
- Given a string in kebab-case, camelCase or 'Sentence case', convert to snake_case.
146
-
147
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
148
-
149
- | Param | Type |
150
- | --- | --- |
151
- | str | <code>string</code> |
152
-
153
- <a name="module_stringHelpers.regexEscape"></a>
154
-
155
- ### stringHelpers.regexEscape(str) ⇒ <code>string</code>
156
- Take a string and escape the regex characters.
157
-
158
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
159
-
160
- | Param | Type |
161
- | --- | --- |
162
- | str | <code>string</code> |
163
-
164
- <a name="module_stringHelpers.makeRelativePath"></a>
165
-
166
- ### stringHelpers.makeRelativePath(fromFile, toFile) ⇒ <code>string</code>
167
- Compare two file paths and simplify them to a relative path.
168
-
169
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
170
-
171
- | Param | Type |
172
- | --- | --- |
173
- | fromFile | <code>string</code> |
174
- | toFile | <code>string</code> |
175
-
176
- <a name="module_stringHelpers.makeFilepath"></a>
177
-
178
- ### stringHelpers.makeFilepath(root, [append]) <code>string</code>
179
- Format the given path so that it does not have trailing slashes and also correctly appends a path.
180
-
181
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
182
-
183
- | Param | Type | Default |
184
- | --- | --- | --- |
185
- | root | <code>string</code> | |
186
- | [append] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> |
187
-
188
- <a name="module_stringHelpers.kabobCase"></a>
189
-
190
- ### stringHelpers.kabobCase(str) ⇒ <code>string</code>
191
- Given a string in snake_case, camelCase or 'Sentence case', convert to kabob-case.
192
-
193
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
194
-
195
- | Param | Type |
196
- | --- | --- |
197
- | str | <code>string</code> |
198
-
199
- <a name="module_stringHelpers.camelCase"></a>
200
-
201
- ### stringHelpers.camelCase(str) ⇒ <code>string</code>
202
- Given a string in kebab-case, snake_case or 'Sentence case', convert to camelCase.
203
-
204
- **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
205
-
206
- | Param | Type |
207
- | --- | --- |
208
- | str | <code>string</code> |
209
-
210
- <a name="module_objectHelpers"></a>
211
-
212
- ## objectHelpers
213
- Simplify working with object by providing array-like parsing. Also, provides cloning and merging along with accessors that always have a return value for optimal nesting.
214
-
215
- **Version**: 1.0.0
216
- **Author**: Joshua Heagle <joshuaheagle@gmail.com>
217
-
218
- * [objectHelpers](#module_objectHelpers)
219
- * _static_
220
- * [.mergeObjectsMutable](#module_objectHelpers.mergeObjectsMutable) ⇒ <code>\*</code>
221
- * [.mergeObjects](#module_objectHelpers.mergeObjects) ⇒ <code>\*</code>
222
- * [.setValue(key, value, item)](#module_objectHelpers.setValue) ⇒ <code>Object</code> \| <code>Array</code>
223
- * [.setAndReturnValue(item, key, value)](#module_objectHelpers.setAndReturnValue) <code>\*</code>
224
- * [.reduceObject(obj, fn, [initialValue])](#module_objectHelpers.reduceObject) ⇒ <code>\*</code>
225
- * [.objectValues(object, [includeInherited])](#module_objectHelpers.objectValues) <code>Array</code>
226
- * [.objectKeys(object, [includeInherited])](#module_objectHelpers.objectKeys) ⇒ <code>Array.&lt;(string\|number)&gt;</code>
227
- * [.mergeObjectsBase([options])](#module_objectHelpers.mergeObjectsBase) <code>module:objectHelpers~mergeObjectsCallback</code> \| <code>mergeObjectsCallback</code>
228
- * [.mapObject(obj, fn, [thisArg])](#module_objectHelpers.mapObject) <code>Object</code> \| <code>Array</code>
229
- * [.isObject(object)](#module_objectHelpers.isObject) <code>boolean</code>
230
- * [.isInstanceObject(object)](#module_objectHelpers.isInstanceObject) ⇒ <code>boolean</code>
231
- * [.isCloneable(value)](#module_objectHelpers.isCloneable) ⇒ <code>boolean</code>
232
- * [.filterObject(obj, fn, [thisArg])](#module_objectHelpers.filterObject) ⇒ <code>Object</code> \| <code>Array</code>
233
- * [.emptyObject(item)](#module_objectHelpers.emptyObject) ⇒ <code>boolean</code>
234
- * [.dotUnset(arrayObject, dotNotation)](#module_objectHelpers.dotUnset) <code>Object</code>
235
- * [.dotSet(arrayObject, dotNotation, value)](#module_objectHelpers.dotSet) ⇒ <code>Object</code>
236
- * [.dotNotate(arrayObject, [retainObjects])](#module_objectHelpers.dotNotate) ⇒ <code>DotNotatedObject</code>
237
- * [.dotGet(arrayObject, dotNotation, [defaultValue])](#module_objectHelpers.dotGet) ⇒ <code>\*</code>
238
- * [.cloneObject(object, [options])](#module_objectHelpers.cloneObject) ⇒ <code>Object</code>
239
- * _inner_
240
- * [~handleRetainObjects([retainObjects])](#module_objectHelpers..handleRetainObjects) ⇒ <code>function</code>
241
- * [~performDotNotate(arrayObject, didRetain, [prepend], [results])](#module_objectHelpers..performDotNotate) ⇒ <code>DotNotatedObject</code>
242
-
243
- <a name="module_objectHelpers.mergeObjectsMutable"></a>
244
-
245
- ### objectHelpers.mergeObjectsMutable ⇒ <code>\*</code>
246
- Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
247
-
248
- **Kind**: static constant of [<code>objectHelpers</code>](#module_objectHelpers)
249
- **See**: [module:objectHelpers~mergeObjectsCallback](module:objectHelpers~mergeObjectsCallback)
250
-
251
- | Param | Type | Description |
252
- | --- | --- | --- |
253
- | ...objects | <code>Object</code> | Provide a list of objects which will be merged starting from the end up into the first |
254
-
255
- <a name="module_objectHelpers.mergeObjects"></a>
256
-
257
- ### objectHelpers.mergeObjects ⇒ <code>\*</code>
258
- Uses mergeObjectsBase deep merge objects and arrays, merge by value.
259
-
260
- **Kind**: static constant of [<code>objectHelpers</code>](#module_objectHelpers)
261
- **See**: [module:objectHelpers~mergeObjectsCallback](module:objectHelpers~mergeObjectsCallback)
262
-
263
- | Param | Type | Description |
264
- | --- | --- | --- |
265
- | ...objects | <code>Object</code> | Provide a list of objects which will be merged starting from the end up into the first |
266
-
267
- <a name="module_objectHelpers.setValue"></a>
268
-
269
- ### objectHelpers.setValue(key, value, item) <code>Object</code> \| <code>Array</code>
270
- Set a value on an item, then return the item.
271
- NOTE: Argument order designed for usage with pipe
272
-
273
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
274
-
275
- | Param | Type | Description |
276
- | --- | --- | --- |
277
- | key | <code>string</code> \| <code>number</code> | The key on the item which will have its value set |
278
- | value | <code>\*</code> | Any value to be applied to the key |
279
- | item | <code>Object</code> \| <code>Array</code> | An object or array to be updated |
280
-
281
- <a name="module_objectHelpers.setAndReturnValue"></a>
282
-
283
- ### objectHelpers.setAndReturnValue(item, key, value) ⇒ <code>\*</code>
284
- Set a value on an item, then return the value
285
-
286
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
287
-
288
- | Param | Type | Description |
289
- | --- | --- | --- |
290
- | item | <code>Object</code> \| <code>Array</code> | An object or array to be updated |
291
- | key | <code>string</code> \| <code>number</code> | The key on the item which will have its value set |
292
- | value | <code>\*</code> | Any value to be applied to the key |
293
-
294
- <a name="module_objectHelpers.reduceObject"></a>
295
-
296
- ### objectHelpers.reduceObject(obj, fn, [initialValue]) <code>\*</code>
297
- This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
298
- If an array is passed in instead then it will perform standard reduce(). It is recommended to
299
- always use the standard reduce() function when it is known that the object is actually an array.
300
-
301
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
302
-
303
- | Param | Type | Description |
304
- | --- | --- | --- |
305
- | obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be filtered |
306
- | fn | <code>module:objectHelpers~reduceCallback</code> \| <code>function</code> \| <code>reduceCallback</code> | The function to be processed for each filtered property |
307
- | [initialValue] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as the first argument to the first call of the callback. If no initial value is supplied, the first element in the array will be used. Calling reduce on an empty array without an initial value is an error. |
308
-
309
- <a name="module_objectHelpers.objectValues"></a>
310
-
311
- ### objectHelpers.objectValues(object, [includeInherited]) <code>Array</code>
312
- Get an array of values from any object or array. Will return empty array when invalid or there are no values.
313
- Optional flag will include the inherited values from prototype chain when set.
314
-
315
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
316
-
317
- | Param | Type | Default |
318
- | --- | --- | --- |
319
- | object | <code>Object</code> \| <code>Array</code> | |
320
- | [includeInherited] | <code>boolean</code> | <code>false</code> |
321
-
322
- <a name="module_objectHelpers.objectKeys"></a>
323
-
324
- ### objectHelpers.objectKeys(object, [includeInherited]) <code>Array.&lt;(string\|number)&gt;</code>
325
- Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
326
- Optional flag will include the inherited keys from prototype chain when set.
327
-
328
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
329
-
330
- | Param | Type | Default |
331
- | --- | --- | --- |
332
- | object | <code>Object</code> \| <code>Array</code> | |
333
- | [includeInherited] | <code>boolean</code> | <code>false</code> |
334
-
335
- <a name="module_objectHelpers.mergeObjectsBase"></a>
336
-
337
- ### objectHelpers.mergeObjectsBase([options]) ⇒ <code>module:objectHelpers~mergeObjectsCallback</code> \| <code>mergeObjectsCallback</code>
338
- Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
339
- Objects having the same attributes will overwrite from last object to first.
340
- NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
341
- have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
342
-
343
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
344
-
345
- | Param | Type | Default | Description |
346
- | --- | --- | --- | --- |
347
- | [options] | <code>Object</code> | <code>{}</code> | |
348
- | [options.mapLimit] | <code>number</code> | <code>100</code> | Size of temporary reference array used in memory before assessing relevancy. |
349
- | [options.depthLimit] | <code>number</code> | <code>-1</code> | Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited. |
350
- | [options.relevancyRange] | <code>number</code> | <code>1000</code> | Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed. |
351
- | [options.map] | <code>Iterable</code> \| <code>array</code> | <code>[]</code> | A predetermined list of references gathered (to be passed to itself during recursion). |
352
- | [options.useClone] | <code>boolean</code> | <code>false</code> | |
353
-
354
- <a name="module_objectHelpers.mapObject"></a>
355
-
356
- ### objectHelpers.mapObject(obj, fn, [thisArg]) ⇒ <code>Object</code> \| <code>Array</code>
357
- This function is intended to replicate behaviour of the Array.map() function but for Objects.
358
- If an array is passed in instead then it will perform standard map(). It is recommended to
359
- always use the standard map() function when it is known that the object is actually an array.
360
-
361
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
362
-
363
- | Param | Type | Description |
364
- | --- | --- | --- |
365
- | obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be mapped |
366
- | fn | <code>module:objectHelpers~mapCallback</code> \| <code>function</code> | The function to be processed for each mapped property |
367
- | [thisArg] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as this when executing callback. |
368
-
369
- <a name="module_objectHelpers.isObject"></a>
370
-
371
- ### objectHelpers.isObject(object) <code>boolean</code>
372
- Check if the provided thing is an object / array.
373
-
374
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
375
-
376
- | Param | Type |
377
- | --- | --- |
378
- | object | <code>\*</code> |
379
-
380
- <a name="module_objectHelpers.isInstanceObject"></a>
381
-
382
- ### objectHelpers.isInstanceObject(object) <code>boolean</code>
383
- Check if the current object has inherited properties.
384
-
385
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
386
-
387
- | Param | Type |
388
- | --- | --- |
389
- | object | <code>Object</code> \| <code>Array</code> |
390
-
391
- <a name="module_objectHelpers.isCloneable"></a>
392
-
393
- ### objectHelpers.isCloneable(value) <code>boolean</code>
394
- Determine if the value is a reference instance
395
-
396
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
397
-
398
- | Param | Type |
399
- | --- | --- |
400
- | value | <code>Array</code> \| <code>Object</code> \| <code>\*</code> |
401
-
402
- <a name="module_objectHelpers.filterObject"></a>
403
-
404
- ### objectHelpers.filterObject(obj, fn, [thisArg]) <code>Object</code> \| <code>Array</code>
405
- This function is intended to replicate behaviour of the Array.filter() function but for Objects.
406
- If an array is passed in instead then it will perform standard filter(). It is recommended to
407
- always use the standard filter() function when it is known that the object is actually an array.
408
-
409
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
410
-
411
- | Param | Type | Description |
412
- | --- | --- | --- |
413
- | obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be filtered |
414
- | fn | <code>module:objectHelpers~filterCallback</code> \| <code>function</code> | The function to be processed for each filtered property |
415
- | [thisArg] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as this when executing callback. |
416
-
417
- <a name="module_objectHelpers.emptyObject"></a>
418
-
419
- ### objectHelpers.emptyObject(item) <code>boolean</code>
420
- Helper function for testing if the item is an Object or Array that does not have any properties
421
-
422
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
423
-
424
- | Param | Type | Description |
425
- | --- | --- | --- |
426
- | item | <code>Object</code> \| <code>Array</code> | Object or Array to test |
427
-
428
- <a name="module_objectHelpers.dotUnset"></a>
429
-
430
- ### objectHelpers.dotUnset(arrayObject, dotNotation) <code>Object</code>
431
- Unset a nested property value an object.
432
-
433
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
434
- **Returns**: <code>Object</code> - The modified object
435
-
436
- | Param | Type | Description |
437
- | --- | --- | --- |
438
- | arrayObject | <code>Object</code> | The array or object to set the property on |
439
- | dotNotation | <code>string</code> | The path for the property |
440
-
441
- <a name="module_objectHelpers.dotSet"></a>
442
-
443
- ### objectHelpers.dotSet(arrayObject, dotNotation, value) <code>Object</code>
444
- Set a nested property value an object.
445
-
446
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
447
- **Returns**: <code>Object</code> - The modified object
448
-
449
- | Param | Type | Description |
450
- | --- | --- | --- |
451
- | arrayObject | <code>Object</code> | The array or object to set the property on |
452
- | dotNotation | <code>string</code> | The path for the property |
453
- | value | <code>\*</code> | The default value to return if the property is not found |
454
-
455
- <a name="module_objectHelpers.dotNotate"></a>
456
-
457
- ### objectHelpers.dotNotate(arrayObject, [retainObjects]) <code>DotNotatedObject</code>
458
- Convert an array or object to a single dimensional associative array with dot notation.
459
-
460
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
461
- **Returns**: <code>DotNotatedObject</code> - The dot-notated object
462
-
463
- | Param | Type | Default | Description |
464
- | --- | --- | --- | --- |
465
- | arrayObject | <code>Object</code> | | The array or object to dot-notate |
466
- | [retainObjects] | <code>Array.&lt;DotNotationString&gt;</code> | <code>[]</code> | An array of keys to retain as objects |
467
-
468
- <a name="module_objectHelpers.dotGet"></a>
469
-
470
- ### objectHelpers.dotGet(arrayObject, dotNotation, [defaultValue]) <code>\*</code>
471
- Get a nested property value from an object.
472
-
473
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
474
- **Returns**: <code>\*</code> - The value of the property
475
-
476
- | Param | Type | Default | Description |
477
- | --- | --- | --- | --- |
478
- | arrayObject | <code>Object</code> | | The array or object to get the property from |
479
- | dotNotation | <code>string</code> | | The path to the property |
480
- | [defaultValue] | <code>string</code> \| <code>null</code> | <code>null</code> | The default value to return if the property is not found |
481
-
482
- <a name="module_objectHelpers.cloneObject"></a>
483
-
484
- ### objectHelpers.cloneObject(object, [options]) <code>Object</code>
485
- Clone objects for manipulation without data corruption, returns a copy of the provided object.
486
- NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
487
- have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
488
-
489
- **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
490
-
491
- | Param | Type | Default | Description |
492
- | --- | --- | --- | --- |
493
- | object | <code>Object</code> | | The original object that is being cloned |
494
- | [options] | <code>Object</code> | <code>{}</code> | |
495
- | [options.mapLimit] | <code>number</code> | <code>100</code> | Size of temporary reference array used in memory before assessing relevancy. |
496
- | [options.depthLimit] | <code>number</code> | <code>-1</code> | Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited. |
497
- | [options.relevancyRange] | <code>number</code> | <code>1000</code> | Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed. |
498
-
499
- <a name="module_objectHelpers..handleRetainObjects"></a>
500
-
501
- ### objectHelpers~handleRetainObjects([retainObjects]) <code>function</code>
502
- Convert an array of keys into a regex, return a function to test if incoming keys match.
503
-
504
- **Kind**: inner method of [<code>objectHelpers</code>](#module_objectHelpers)
505
- **Returns**: <code>function</code> - The dot-notated array
506
-
507
- | Param | Type | Default | Description |
508
- | --- | --- | --- | --- |
509
- | [retainObjects] | <code>Array.&lt;DotNotationString&gt;</code> | <code>[]</code> | An array of keys to retain as objects |
510
-
511
- <a name="module_objectHelpers..performDotNotate"></a>
512
-
513
- ### objectHelpers~performDotNotate(arrayObject, didRetain, [prepend], [results]) <code>DotNotatedObject</code>
514
- The underlying logic function for converting arrays to dot-notation.
515
-
516
- **Kind**: inner method of [<code>objectHelpers</code>](#module_objectHelpers)
517
- **Returns**: <code>DotNotatedObject</code> - The dot-notated object
518
-
519
- | Param | Type | Default | Description |
520
- | --- | --- | --- | --- |
521
- | arrayObject | <code>Object</code> | | The array or object to dot-notate |
522
- | didRetain | <code>function</code> | | The test function to see if a key should be retained |
523
- | [prepend] | <code>DotNotationString</code> | <code>&#x27;&#x27;</code> | The path for the property being processed |
524
- | [results] | <code>DotNotatedObject</code> | <code>{}</code> | The final array to return |
525
-
526
- <a name="module_numberHelpers"></a>
527
-
528
- ## numberHelpers
529
- Some number comparators and random number generators.
530
-
531
- **Version**: 1.0.0
532
- **Author**: Joshua Heagle <joshuaheagle@gmail.com>
533
-
534
- * [numberHelpers](#module_numberHelpers)
535
- * [.simplestRatio(...numbers)](#module_numberHelpers.simplestRatio) <code>Array.&lt;number&gt;</code>
536
- * [.randomNumber(range, [offset], [interval])](#module_numberHelpers.randomNumber) ⇒ <code>number</code>
537
- * [.randomInteger(range, [offset], [interval])](#module_numberHelpers.randomInteger) ⇒ <code>number</code>
538
- * [.lowestCommonDenominator(num1, num2)](#module_numberHelpers.lowestCommonDenominator) ⇒ <code>number</code>
539
- * [.leastCommonMultiple(num1, num2)](#module_numberHelpers.leastCommonMultiple) ⇒ <code>number</code>
540
- * [.greatestCommonDivisor(num1, num2)](#module_numberHelpers.greatestCommonDivisor) <code>number</code>
541
- * [.compare(val1, val2)](#module_numberHelpers.compare) <code>number</code>
542
- * [.absoluteMin(num1, num2)](#module_numberHelpers.absoluteMin) <code>number</code>
543
- * [.absoluteMax(num1, num2)](#module_numberHelpers.absoluteMax) <code>number</code>
544
-
545
- <a name="module_numberHelpers.simplestRatio"></a>
546
-
547
- ### numberHelpers.simplestRatio(...numbers) ⇒ <code>Array.&lt;number&gt;</code>
548
- Reduce several numbers to their simplest form / ratio
549
-
550
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
551
-
552
- | Param | Type | Description |
553
- | --- | --- | --- |
554
- | ...numbers | <code>number</code> | Array of numbers to simplify |
555
-
556
- <a name="module_numberHelpers.randomNumber"></a>
557
-
558
- ### numberHelpers.randomNumber(range, [offset], [interval]) ⇒ <code>number</code>
559
- Create a single random number within provided range. And with optional offset,
560
- The distance between the result numbers can be adjusted with interval.
561
-
562
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
563
-
564
- | Param | Type | Default | Description |
565
- | --- | --- | --- | --- |
566
- | range | <code>number</code> | | Choose the breadth of the random number (0-100 would be 100 for range) |
567
- | [offset] | <code>number</code> | <code>0</code> | Choose the starting number (1-10 would be 1 for offset, 9 for range) |
568
- | [interval] | <code>number</code> | <code>1</code> | Choose the distance between numbers (~5, ~10, ~15 would be 5 for interval, 1 for offset, 2 for range) |
569
-
570
- <a name="module_numberHelpers.randomInteger"></a>
571
-
572
- ### numberHelpers.randomInteger(range, [offset], [interval]) ⇒ <code>number</code>
573
- Create a single random integer within provide range. And with optional offset,
574
- The distance between the result numbers can be adjusted with interval.
575
-
576
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
577
-
578
- | Param | Type | Default | Description |
579
- | --- | --- | --- | --- |
580
- | range | <code>number</code> | | Choose the breadth of the random number (0-100 would be 100 for range) |
581
- | [offset] | <code>number</code> | <code>0</code> | Choose the starting number (1-10 would be 1 for offset, 9 for range) |
582
- | [interval] | <code>number</code> | <code>1</code> | Choose the distance between numbers (5, 10, 15 would be 5 for interval, 1 for offset, 2 for range) |
583
-
584
- <a name="module_numberHelpers.lowestCommonDenominator"></a>
585
-
586
- ### numberHelpers.lowestCommonDenominator(num1, num2) <code>number</code>
587
- Helper for calculating the multiplier that would make each number relative to each other.
588
-
589
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
590
-
591
- | Param | Type | Description |
592
- | --- | --- | --- |
593
- | num1 | <code>number</code> | A number to compare |
594
- | num2 | <code>number</code> | Another number to be compared against |
595
-
596
- <a name="module_numberHelpers.leastCommonMultiple"></a>
597
-
598
- ### numberHelpers.leastCommonMultiple(num1, num2) ⇒ <code>number</code>
599
- Helper for calculating the multiplier that would make each number relative to each other.
600
-
601
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
602
-
603
- | Param | Type | Description |
604
- | --- | --- | --- |
605
- | num1 | <code>number</code> | A number to compare |
606
- | num2 | <code>number</code> | Another number to be compared against |
607
-
608
- <a name="module_numberHelpers.greatestCommonDivisor"></a>
609
-
610
- ### numberHelpers.greatestCommonDivisor(num1, num2) ⇒ <code>number</code>
611
- Return the highest number that can be divided into both numbers.
612
-
613
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
614
-
615
- | Param | Type | Description |
616
- | --- | --- | --- |
617
- | num1 | <code>number</code> | First number to assess |
618
- | num2 | <code>number</code> | Second number to compare for common divisor |
619
-
620
- <a name="module_numberHelpers.compare"></a>
621
-
622
- ### numberHelpers.compare(val1, val2) <code>number</code>
623
- Compare two numbers and return:
624
- -1 to indicate val1 is less than val2
625
- 0 to indicate both values are the equal
626
- 1 to indicate val1 is greater than val2
627
-
628
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
629
-
630
- | Param | Type | Description |
631
- | --- | --- | --- |
632
- | val1 | <code>number</code> | The first number to compare |
633
- | val2 | <code>number</code> | The second number to compare |
634
-
635
- <a name="module_numberHelpers.absoluteMin"></a>
636
-
637
- ### numberHelpers.absoluteMin(num1, num2) <code>number</code>
638
- Helper for returning the absolute min value
639
-
640
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
641
-
642
- | Param | Type | Description |
643
- | --- | --- | --- |
644
- | num1 | <code>number</code> | A number to compare |
645
- | num2 | <code>number</code> | Another number to be compared against |
646
-
647
- <a name="module_numberHelpers.absoluteMax"></a>
648
-
649
- ### numberHelpers.absoluteMax(num1, num2) <code>number</code>
650
- Helper for returning the absolute max value
651
-
652
- **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
653
-
654
- | Param | Type | Description |
655
- | --- | --- | --- |
656
- | num1 | <code>number</code> | A number to compare |
657
- | num2 | <code>number</code> | Another number to be compared against |
658
-
659
- <a name="module_functionHelpers"></a>
660
-
661
- ## functionHelpers
662
- Manage how functions are called with these utilities.
663
-
664
- **Version**: 1.0.0
665
- **Author**: Joshua Heagle <joshuaheagle@gmail.com>
666
-
667
- * [functionHelpers](#module_functionHelpers)
668
- * [.trace(label, useClone)](#module_functionHelpers.trace) ⇒ <code>function</code>
669
- * [.relevancyFilter(map, [options])](#module_functionHelpers.relevancyFilter) ⇒ <code>relevanceMap</code>
670
- * [.queueTimeout([queueManagerHandle])](#module_functionHelpers.queueTimeout) ⇒ <code>module:functionHelpers~queueTimeoutHandle</code>
671
- * [.queueManager([queue])](#module_functionHelpers.queueManager) <code>module:functionHelpers~queueManagerHandle</code>
672
- * [~makeQueuedRunnable(resolve, reject, fn, ...args)](#module_functionHelpers.queueManager..makeQueuedRunnable) ⇒ <code>queuedRunnable</code>
673
- * [~postRun(result)](#module_functionHelpers.queueManager..postRun) <code>\*</code>
674
- * [~runNextItem()](#module_functionHelpers.queueManager..runNextItem) ⇒ <code>IteratorYieldResult</code> \| <code>null</code>
675
- * [~pushAnother(fn, ...args)](#module_functionHelpers.queueManager..pushAnother)
676
- * [.preloadParams(fn, params, [unassignedParam])](#module_functionHelpers.preloadParams) <code>module:functionHelpers~callWithMissing</code>
677
- * [.pipe(...fns)](#module_functionHelpers.pipe) <code>\*</code>
678
- * [.onBodyLoad(callback, [reset])](#module_functionHelpers.onBodyLoad) <code>Array.&lt;function()&gt;</code>
679
- * [.makeBasicQueue(initialQueue)](#module_functionHelpers.makeBasicQueue) ⇒ <code>IsQueue</code>
680
- * [.delay(time)](#module_functionHelpers.delay) ⇒ <code>module:functionHelpers~delayHandler</code>
681
- * [.curry(fn)](#module_functionHelpers.curry) ⇒ <code>function</code> \| <code>\*</code>
682
- * [.callWithParams(fn, params, [minimum])](#module_functionHelpers.callWithParams) ⇒ <code>\*</code>
683
-
684
- <a name="module_functionHelpers.trace"></a>
685
-
686
- ### functionHelpers.trace(label, useClone) <code>function</code>
687
- Output the value with label to the console and return the value to not interrupt the code.
688
-
689
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
690
-
691
- | Param | Type | Description |
692
- | --- | --- | --- |
693
- | label | <code>string</code> | Pass an identifying label of the value being output. |
694
- | useClone | | Determines if the logged data should be a clone of the original to preserve state. |
695
-
696
- <a name="module_functionHelpers.relevancyFilter"></a>
697
-
698
- ### functionHelpers.relevancyFilter(map, [options]) ⇒ <code>relevanceMap</code>
699
- Remove elements out of relevance range and update the max relevance.
700
-
701
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
702
-
703
- | Param | Type | Default |
704
- | --- | --- | --- |
705
- | map | <code>relevanceMap</code> | |
706
- | [options] | <code>Object</code> | <code>{}</code> |
707
- | [options.mapLimit] | <code>int</code> | <code>1000</code> |
708
- | [options.relevancyRange] | <code>int</code> | <code>100</code> |
709
-
710
- <a name="module_functionHelpers.queueTimeout"></a>
711
-
712
- ### functionHelpers.queueTimeout([queueManagerHandle]) ⇒ <code>module:functionHelpers~queueTimeoutHandle</code>
713
- Manage functions to run sequentially with delays.
714
-
715
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
716
-
717
- | Param | Type | Default |
718
- | --- | --- | --- |
719
- | [queueManagerHandle] | <code>module:functionHelpers~queueManagerHandle</code> | <code></code> |
720
-
721
- <a name="module_functionHelpers.queueManager"></a>
722
-
723
- ### functionHelpers.queueManager([queue]) <code>module:functionHelpers~queueManagerHandle</code>
724
- Manage functions to run sequentially.
725
-
726
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
727
-
728
- | Param | Type | Default | Description |
729
- | --- | --- | --- | --- |
730
- | [queue] | <code>IsQueue</code> | <code>[]</code> | The iterable that can be used to store queued functions |
731
-
732
-
733
- * [.queueManager([queue])](#module_functionHelpers.queueManager) ⇒ <code>module:functionHelpers~queueManagerHandle</code>
734
- * [~makeQueuedRunnable(resolve, reject, fn, ...args)](#module_functionHelpers.queueManager..makeQueuedRunnable) ⇒ <code>queuedRunnable</code>
735
- * [~postRun(result)](#module_functionHelpers.queueManager..postRun) <code>\*</code>
736
- * [~runNextItem()](#module_functionHelpers.queueManager..runNextItem) ⇒ <code>IteratorYieldResult</code> \| <code>null</code>
737
- * [~pushAnother(fn, ...args)](#module_functionHelpers.queueManager..pushAnother)
738
-
739
- <a name="module_functionHelpers.queueManager..makeQueuedRunnable"></a>
740
-
741
- #### queueManager~makeQueuedRunnable(resolve, reject, fn, ...args) ⇒ <code>queuedRunnable</code>
742
- Convert a function to a queueable object.
743
-
744
- **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
745
-
746
- | Param | Type |
747
- | --- | --- |
748
- | resolve | <code>Promise.resolve</code> |
749
- | reject | <code>Promise.reject</code> |
750
- | fn | <code>function</code> |
751
- | ...args | <code>\*</code> |
752
-
753
- <a name="module_functionHelpers.queueManager..postRun"></a>
754
-
755
- #### queueManager~postRun(result) ⇒ <code>\*</code>
756
- After an item is run, THEN run this function to reset isRunning
757
-
758
- **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
759
-
760
- | Param | Type |
761
- | --- | --- |
762
- | result | <code>\*</code> |
763
-
764
- <a name="module_functionHelpers.queueManager..runNextItem"></a>
765
-
766
- #### queueManager~runNextItem() <code>IteratorYieldResult</code> \| <code>null</code>
767
- When ready, runs the next queued runnable generator.
768
-
769
- **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
770
- <a name="module_functionHelpers.queueManager..pushAnother"></a>
771
-
772
- #### queueManager~pushAnother(fn, ...args)
773
- Add a function into the queue to be run when ready.
774
-
775
- **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
776
- **Returns**: Promise
777
-
778
- | Param | Type | Description |
779
- | --- | --- | --- |
780
- | fn | <code>function</code> | The function to run when ready |
781
- | ...args | <code>\*</code> | Optional arguments to apply when the function is ready to be run |
782
-
783
- <a name="module_functionHelpers.preloadParams"></a>
784
-
785
- ### functionHelpers.preloadParams(fn, params, [unassignedParam]) ⇒ <code>module:functionHelpers~callWithMissing</code>
786
- Provide an array of parameters to be used with a function, allow the function to be called later
787
- with the missing parameter.
788
-
789
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
790
-
791
- | Param | Type | Default | Description |
792
- | --- | --- | --- | --- |
793
- | fn | <code>function</code> | | The function to be called |
794
- | params | <code>Array</code> | | The parameters to preload |
795
- | [unassignedParam] | <code>number</code> | <code>0</code> | Position of missing parameter (zero indexed) |
796
-
797
- <a name="module_functionHelpers.pipe"></a>
798
-
799
- ### functionHelpers.pipe(...fns) ⇒ <code>\*</code>
800
- Take one or more function with a single parameter and return value.
801
- Pass a parameter and the value will be transformed by each function then returned.
802
-
803
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
804
-
805
- | Param | Type | Description |
806
- | --- | --- | --- |
807
- | ...fns | <code>function</code> | Takes a series of functions having the same parameter |
808
-
809
- <a name="module_functionHelpers.onBodyLoad"></a>
810
-
811
- ### functionHelpers.onBodyLoad(callback, [reset]) <code>Array.&lt;function()&gt;</code>
812
- Prepare functions to be called once the body is available.
813
-
814
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
815
-
816
- | Param | Type | Default |
817
- | --- | --- | --- |
818
- | callback | <code>function</code> | |
819
- | [reset] | <code>boolean</code> | <code>false</code> |
820
-
821
- <a name="module_functionHelpers.makeBasicQueue"></a>
822
-
823
- ### functionHelpers.makeBasicQueue(initialQueue) <code>IsQueue</code>
824
- Create an instance of a basic queue.
825
-
826
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
827
-
828
- | Param | Type |
829
- | --- | --- |
830
- | initialQueue | <code>Array</code> |
831
-
832
- <a name="module_functionHelpers.delay"></a>
833
-
834
- ### functionHelpers.delay(time) <code>module:functionHelpers~delayHandler</code>
835
- Provide a timeout which returns a promise.
836
-
837
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
838
-
839
- | Param | Type | Description |
840
- | --- | --- | --- |
841
- | time | <code>number</code> | Delay in milliseconds |
842
-
843
- <a name="module_functionHelpers.curry"></a>
844
-
845
- ### functionHelpers.curry(fn) ⇒ <code>function</code> \| <code>\*</code>
846
- Return a curried version of the passed function.
847
- The returned function expects the same number of arguments minus the ones provided.
848
- fn is the name of the function being curried.
849
-
850
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
851
-
852
- | Param | Type | Description |
853
- | --- | --- | --- |
854
- | fn | <code>function</code> | Receives a function to be curried |
855
-
856
- <a name="module_functionHelpers.callWithParams"></a>
857
-
858
- ### functionHelpers.callWithParams(fn, params, [minimum]) ⇒ <code>\*</code>
859
- Given a function, call with the correct number of parameters from an array of possible parameters.
860
-
861
- **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
862
-
863
- | Param | Type | Default | Description |
864
- | --- | --- | --- | --- |
865
- | fn | <code>function</code> | | The function to be called |
866
- | params | <code>Array</code> | | Array of possible function parameters |
867
- | [minimum] | <code>number</code> | <code>2</code> | Minimum number of parameters to use in the function |
868
-
869
- <a name="module_objectDescriptors"></a>
870
-
871
- ## objectDescriptors
872
- Create a format to standardize every object into a specific template.
873
-
874
- **Version**: 1.0.0
875
- **Author**: Joshua Heagle <joshuaheagle@gmail.com>
876
-
877
- * [objectDescriptors](#module_objectDescriptors)
878
- * [.mappedDescriptorMap](#module_objectDescriptors.mappedDescriptorMap) : <code>module:objectDescriptors~descriptorMap</code>
879
- * [.descriptorMapSample](#module_objectDescriptors.descriptorMapSample) : <code>module:objectDescriptors~descriptorMap</code>
880
- * [.descriptorDetailSample](#module_objectDescriptors.descriptorDetailSample) : <code>module:objectDescriptors~descriptorDetail</code>
881
- * [.descriptorSample](#module_objectDescriptors.descriptorSample) : <code>module:objectDescriptors~descriptor</code>
882
- * [.sameDescriptor(descriptor1, descriptor2)](#module_objectDescriptors.sameDescriptor) ⇒ <code>boolean</code>
883
- * [.nextReference(descriptor, currentReference)](#module_objectDescriptors.nextReference) <code>number</code> \| <code>undefined</code>
884
- * [.describeObjectMap(object, [options])](#module_objectDescriptors.describeObjectMap) ⇒ <code>module:objectDescriptors~descriptorMap</code>
885
- * [.describeObjectDetail(value, [key], [index])](#module_objectDescriptors.describeObjectDetail) <code>module:objectDescriptors~descriptorDetail</code>
886
- * [.describeObject(object)](#module_objectDescriptors.describeObject) <code>module:objectDescriptors~descriptor</code>
887
- * [.compareDescriptor(descriptor1, descriptor2)](#module_objectDescriptors.compareDescriptor) <code>boolean</code>
888
- * [.cloneDescriptorDetail(originalDetail)](#module_objectDescriptors.cloneDescriptorDetail) <code>module:objectDescriptors~descriptorDetail</code>
889
- * [.cloneDescriptor(originalMap)](#module_objectDescriptors.cloneDescriptor) <code>module:objectDescriptors~descriptor</code>
890
- * [.checkDescriptorComplete(descriptor)](#module_objectDescriptors.checkDescriptorComplete) ⇒ <code>module:objectDescriptors~descriptor</code>
891
- * [.checkClearValues(descriptor, [keepValues])](#module_objectDescriptors.checkClearValues) ⇒ <code>module:objectDescriptors~descriptor</code>
892
- * [.assignDescriptorDetail(originalDetail, ...details)](#module_objectDescriptors.assignDescriptorDetail) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
893
- * [.assignDescriptor(originalMap, ...descriptors)](#module_objectDescriptors.assignDescriptor) ⇒ <code>module:objectDescriptors~descriptor</code>
894
-
895
- <a name="module_objectDescriptors.mappedDescriptorMap"></a>
896
-
897
- ### objectDescriptors.mappedDescriptorMap : <code>module:objectDescriptors~descriptorMap</code>
898
- **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
899
- <a name="module_objectDescriptors.descriptorMapSample"></a>
900
-
901
- ### objectDescriptors.descriptorMapSample : <code>module:objectDescriptors~descriptorMap</code>
902
- **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
903
- <a name="module_objectDescriptors.descriptorDetailSample"></a>
904
-
905
- ### objectDescriptors.descriptorDetailSample : <code>module:objectDescriptors~descriptorDetail</code>
906
- **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
907
- <a name="module_objectDescriptors.descriptorSample"></a>
908
-
909
- ### objectDescriptors.descriptorSample : <code>module:objectDescriptors~descriptor</code>
910
- **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
911
- <a name="module_objectDescriptors.sameDescriptor"></a>
912
-
913
- ### objectDescriptors.sameDescriptor(descriptor1, descriptor2) <code>boolean</code>
914
- Check if the two descriptors are the same.
915
-
916
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
917
-
918
- | Param | Type |
919
- | --- | --- |
920
- | descriptor1 | <code>module:objectDescriptors~descriptor</code> |
921
- | descriptor2 | <code>module:objectDescriptors~descriptor</code> |
922
-
923
- <a name="module_objectDescriptors.nextReference"></a>
924
-
925
- ### objectDescriptors.nextReference(descriptor, currentReference) ⇒ <code>number</code> \| <code>undefined</code>
926
- Find the index of the next module:objectDescriptors.descriptorDetail to build a resource for.
927
-
928
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
929
-
930
- | Param | Type |
931
- | --- | --- |
932
- | descriptor | <code>module:objectDescriptors~descriptor</code> |
933
- | currentReference | <code>number</code> |
934
-
935
- <a name="module_objectDescriptors.describeObjectMap"></a>
936
-
937
- ### objectDescriptors.describeObjectMap(object, [options]) <code>module:objectDescriptors~descriptorMap</code>
938
- Trace out the entire object including nested objects.
939
-
940
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
941
-
942
- | Param | Type | Default |
943
- | --- | --- | --- |
944
- | object | <code>Object</code> \| <code>Array</code> | |
945
- | [options] | <code>Object</code> | <code>{}</code> |
946
- | [options.mapLimit] | <code>number</code> | <code>1000000000</code> |
947
- | [options.depthLimit] | <code>number</code> | <code>-1</code> |
948
- | [options.keepValues] | <code>boolean</code> | <code>false</code> |
949
-
950
- <a name="module_objectDescriptors.describeObjectDetail"></a>
951
-
952
- ### objectDescriptors.describeObjectDetail(value, [key], [index]) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
953
- Trace an object's attribute and provide details about it.
954
-
955
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
956
-
957
- | Param | Type | Default |
958
- | --- | --- | --- |
959
- | value | <code>\*</code> | |
960
- | [key] | <code>string</code> \| <code>number</code> | <code>0</code> |
961
- | [index] | <code>number</code> | <code>0</code> |
962
-
963
- <a name="module_objectDescriptors.describeObject"></a>
964
-
965
- ### objectDescriptors.describeObject(object) <code>module:objectDescriptors~descriptor</code>
966
- Trace an object and return the descriptor which defines the object's structure and attributes.
967
-
968
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
969
-
970
- | Param | Type |
971
- | --- | --- |
972
- | object | <code>Object</code> |
973
-
974
- <a name="module_objectDescriptors.compareDescriptor"></a>
975
-
976
- ### objectDescriptors.compareDescriptor(descriptor1, descriptor2) <code>boolean</code>
977
- Check if two descriptors are the same or similar in that they have similar keys and the associated types are the same.
978
-
979
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
980
-
981
- | Param | Type |
982
- | --- | --- |
983
- | descriptor1 | <code>module:objectDescriptors~descriptor</code> |
984
- | descriptor2 | <code>module:objectDescriptors~descriptor</code> |
985
-
986
- <a name="module_objectDescriptors.cloneDescriptorDetail"></a>
987
-
988
- ### objectDescriptors.cloneDescriptorDetail(originalDetail) <code>module:objectDescriptors~descriptorDetail</code>
989
- Get a new copy of an existing Descriptor Detail
990
-
991
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
992
-
993
- | Param | Type |
994
- | --- | --- |
995
- | originalDetail | <code>module:objectDescriptors~descriptorDetail</code> |
996
-
997
- <a name="module_objectDescriptors.cloneDescriptor"></a>
998
-
999
- ### objectDescriptors.cloneDescriptor(originalMap) <code>module:objectDescriptors~descriptor</code>
1000
- Make a copy of an object descriptor so that the original will not be mutated.
1001
-
1002
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1003
-
1004
- | Param | Type |
1005
- | --- | --- |
1006
- | originalMap | <code>module:objectDescriptors~descriptor</code> |
1007
-
1008
- <a name="module_objectDescriptors.checkDescriptorComplete"></a>
1009
-
1010
- ### objectDescriptors.checkDescriptorComplete(descriptor) <code>module:objectDescriptors~descriptor</code>
1011
- Check if the descriptors references have all been built and set complete to true if they have.
1012
-
1013
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1014
-
1015
- | Param | Type |
1016
- | --- | --- |
1017
- | descriptor | <code>module:objectDescriptors~descriptor</code> |
1018
-
1019
- <a name="module_objectDescriptors.checkClearValues"></a>
1020
-
1021
- ### objectDescriptors.checkClearValues(descriptor, [keepValues]) ⇒ <code>module:objectDescriptors~descriptor</code>
1022
- Check if we should clear the values on this descriptor
1023
-
1024
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1025
-
1026
- | Param | Type | Default |
1027
- | --- | --- | --- |
1028
- | descriptor | <code>module:objectDescriptors~descriptor</code> | |
1029
- | [keepValues] | <code>boolean</code> | <code>false</code> |
1030
-
1031
- <a name="module_objectDescriptors.assignDescriptorDetail"></a>
1032
-
1033
- ### objectDescriptors.assignDescriptorDetail(originalDetail, ...details) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
1034
- Assign properties from other details onto an existing detail.
1035
-
1036
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1037
-
1038
- | Param | Type |
1039
- | --- | --- |
1040
- | originalDetail | <code>module:objectDescriptors~descriptorDetail</code> |
1041
- | ...details | <code>module:objectDescriptors~descriptorDetail</code> |
1042
-
1043
- <a name="module_objectDescriptors.assignDescriptor"></a>
1044
-
1045
- ### objectDescriptors.assignDescriptor(originalMap, ...descriptors) <code>module:objectDescriptors~descriptor</code>
1046
- Apply one or more descriptors to an existing descriptor so that they represent a merged version of the descriptors.
1047
-
1048
- **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1049
-
1050
- | Param | Type |
1051
- | --- | --- |
1052
- | originalMap | <code>module:objectDescriptors~descriptor</code> |
1053
- | ...descriptors | <code>module:objectDescriptors~descriptor</code> |
1054
-
1055
- <a name="module_arrayHelpers"></a>
1056
-
1057
- ## arrayHelpers
1058
- Some simple utility functions for generating arrays or performing work on arrays.
1059
-
1060
- **Version**: 1.0.0
1061
- **Author**: Joshua Heagle <joshuaheagle@gmail.com>
1062
-
1063
- * [arrayHelpers](#module_arrayHelpers)
1064
- * [.BasicQueue](#module_arrayHelpers.BasicQueue)
1065
- * [.dequeue()](#module_arrayHelpers.BasicQueue+dequeue) <code>queuedItem</code> \| <code>\*</code>
1066
- * [.empty()](#module_arrayHelpers.BasicQueue+empty) <code>boolean</code>
1067
- * [.enqueue(data)](#module_arrayHelpers.BasicQueue+enqueue) ⇒ <code>BasicQueue</code>
1068
- * [.peek()](#module_arrayHelpers.BasicQueue+peek) ⇒ <code>queuedItem</code> \| <code>\*</code>
1069
- * [.size()](#module_arrayHelpers.BasicQueue+size) ⇒ <code>number</code>
1070
- * [.uniqueArray(array)](#module_arrayHelpers.uniqueArray) ⇒ <code>Array</code>
1071
- * [.mergeArrays(...arrays)](#module_arrayHelpers.mergeArrays) <code>Array</code>
1072
- * [.compareArrays(...arrays)](#module_arrayHelpers.compareArrays) ⇒ <code>Array.&lt;module:arrayHelpers~compareArrayResult&gt;</code>
1073
- * [.buildArrayOfReferences(item, length)](#module_arrayHelpers.buildArrayOfReferences) <code>Array.&lt;\*&gt;</code>
1074
- * [.buildArray(item, length)](#module_arrayHelpers.buildArray) ⇒ <code>Array.&lt;\*&gt;</code>
1075
- * [.addUniqueToArray(item, array)](#module_arrayHelpers.addUniqueToArray) ⇒ <code>Array</code>
1076
-
1077
- <a name="module_arrayHelpers.BasicQueue"></a>
1078
-
1079
- ### arrayHelpers.BasicQueue
1080
- Class BasicQueue is a functional example of a queue to be used with queueManager.
1081
-
1082
- **Kind**: static class of [<code>arrayHelpers</code>](#module_arrayHelpers)
1083
-
1084
- * [.BasicQueue](#module_arrayHelpers.BasicQueue)
1085
- * [.dequeue()](#module_arrayHelpers.BasicQueue+dequeue) ⇒ <code>queuedItem</code> \| <code>\*</code>
1086
- * [.empty()](#module_arrayHelpers.BasicQueue+empty) <code>boolean</code>
1087
- * [.enqueue(data)](#module_arrayHelpers.BasicQueue+enqueue) ⇒ <code>BasicQueue</code>
1088
- * [.peek()](#module_arrayHelpers.BasicQueue+peek) ⇒ <code>queuedItem</code> \| <code>\*</code>
1089
- * [.size()](#module_arrayHelpers.BasicQueue+size) <code>number</code>
1090
-
1091
- <a name="module_arrayHelpers.BasicQueue+dequeue"></a>
1092
-
1093
- #### basicQueue.dequeue() ⇒ <code>queuedItem</code> \| <code>\*</code>
1094
- Remove and return the next item in the queue
1095
-
1096
- **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1097
- <a name="module_arrayHelpers.BasicQueue+empty"></a>
1098
-
1099
- #### basicQueue.empty() <code>boolean</code>
1100
- Check if the queue is empty
1101
-
1102
- **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1103
- <a name="module_arrayHelpers.BasicQueue+enqueue"></a>
1104
-
1105
- #### basicQueue.enqueue(data) <code>BasicQueue</code>
1106
- Add an item to the end of the queue
1107
-
1108
- **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1109
-
1110
- | Param | Type |
1111
- | --- | --- |
1112
- | data | <code>queuedItem</code> \| <code>\*</code> |
1113
-
1114
- <a name="module_arrayHelpers.BasicQueue+peek"></a>
1115
-
1116
- #### basicQueue.peek() ⇒ <code>queuedItem</code> \| <code>\*</code>
1117
- Retrieve the next item from the queue
1118
-
1119
- **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1120
- <a name="module_arrayHelpers.BasicQueue+size"></a>
1121
-
1122
- #### basicQueue.size() ⇒ <code>number</code>
1123
- Get the quantity of items in the queue
1124
-
1125
- **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1126
- <a name="module_arrayHelpers.uniqueArray"></a>
1127
-
1128
- ### arrayHelpers.uniqueArray(array) ⇒ <code>Array</code>
1129
- Remove duplicate values from an array. uniqueArray
1130
-
1131
- **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1132
-
1133
- | Param | Type | Description |
1134
- | --- | --- | --- |
1135
- | array | <code>Array</code> | The array to make unique |
1136
-
1137
- <a name="module_arrayHelpers.mergeArrays"></a>
1138
-
1139
- ### arrayHelpers.mergeArrays(...arrays) ⇒ <code>Array</code>
1140
- Take multiple arrays and then filter all these into one unique array.
1141
-
1142
- **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1143
-
1144
- | Param | Type | Description |
1145
- | --- | --- | --- |
1146
- | ...arrays | <code>Array</code> | Provide multiple arrays to create one unique array |
1147
-
1148
- <a name="module_arrayHelpers.compareArrays"></a>
1149
-
1150
- ### arrayHelpers.compareArrays(...arrays) ⇒ <code>Array.&lt;module:arrayHelpers~compareArrayResult&gt;</code>
1151
- Compare two Arrays and return the Object where the value for each property is as follows:
1152
- -1 to indicate val1 is less than val2
1153
- 0 to indicate both values are the equal
1154
- 1 to indicate val1 is greater than val2
1155
- The returned Object uses the element values as the property names
1156
- This functions works by first creating a concatenated array of all unique values. Then for each unique values,
1157
- convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
1158
- Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
1159
- 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
1160
- or more.
1161
-
1162
- **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1163
-
1164
- | Param | Type | Description |
1165
- | --- | --- | --- |
1166
- | ...arrays | <code>Array</code> | The arrays to compare |
1167
-
1168
- **Example**
1169
- ```js
1170
- // example of input and resulting output
1171
- compareArrays(
1172
- ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
1173
- ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
1174
- )
1175
- // unique array
1176
- ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
1177
- // result object
1178
- [
1179
- {
1180
- value: 'match1',
1181
- keys: [[0], [0]],
1182
- result: [0, 0]
1183
- },
1184
- {
1185
- value: 'firstMismatch1',
1186
- keys: [[1], []],
1187
- result: [1, -1]
1188
- },
1189
- {
1190
- value: 'match2',
1191
- keys: [[2], [1]],
1192
- result: [0, 0]
1193
- },
1194
- {
1195
- value: 'firstMismatch2',
1196
- keys: [[3], []],
1197
- result: [1, -1]
1198
- },
1199
- {
1200
- value: 'badMatch1',
1201
- keys: [[4], [3, 4]],
1202
- result: [0, 0]
1203
- },
1204
- {
1205
- value: 'secondMismatch1',
1206
- keys: [[], [2]],
1207
- result: [-1, 1]
1208
- }
1209
- ]
1210
- ```
1211
- <a name="module_arrayHelpers.buildArrayOfReferences"></a>
1212
-
1213
- ### arrayHelpers.buildArrayOfReferences(item, length) ⇒ <code>Array.&lt;\*&gt;</code>
1214
- Leverage buildArrayBase to generate an array filled with references to the provided item.
1215
- The length defines how long the array should be.
1216
-
1217
- **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1218
-
1219
- | Param | Type | Description |
1220
- | --- | --- | --- |
1221
- | item | <code>\*</code> | The item to be used for each array element |
1222
- | length | <code>number</code> | The desired length of the array |
1223
-
1224
- <a name="module_arrayHelpers.buildArray"></a>
1225
-
1226
- ### arrayHelpers.buildArray(item, length) <code>Array.&lt;\*&gt;</code>
1227
- Leverage buildArrayBase to generate an array filled with a copy of the provided item.
1228
- The length defines how long the array should be.
1229
-
1230
- **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1231
-
1232
- | Param | Type | Description |
1233
- | --- | --- | --- |
1234
- | item | <code>\*</code> | The item to be used for each array element |
1235
- | length | <code>number</code> | The desired length of the array |
1236
-
1237
- <a name="module_arrayHelpers.addUniqueToArray"></a>
1238
-
1239
- ### arrayHelpers.addUniqueToArray(item, array) <code>Array</code>
1240
- Having an array and a potential new array element, check if the element is in the array, if not append to array.
1241
-
1242
- **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1243
-
1244
- | Param | Type | Description |
1245
- | --- | --- | --- |
1246
- | item | <code>\*</code> | An potential array element, possibly a DomItem |
1247
- | array | <code>Array</code> | An array where an element may be appended. |
1248
-
5
+ ## Modules
6
+
7
+ <dl>
8
+ <dt><a href="#module_siFunciona">siFunciona</a></dt>
9
+ <dd><p>All the siFunciona system functions for stringing together functions and simplifying logic.</p>
10
+ </dd>
11
+ <dt><a href="#module_stringHelpers">stringHelpers</a></dt>
12
+ <dd><p>Manage how strings are manipulated with these utilities.</p>
13
+ </dd>
14
+ <dt><a href="#module_objectHelpers">objectHelpers</a></dt>
15
+ <dd><p>Simplify working with object by providing array-like parsing. Also, provides cloning and merging along with accessors that always have a return value for optimal nesting.</p>
16
+ </dd>
17
+ <dt><a href="#module_numberHelpers">numberHelpers</a></dt>
18
+ <dd><p>Some number comparators and random number generators.</p>
19
+ </dd>
20
+ <dt><a href="#module_functionHelpers">functionHelpers</a></dt>
21
+ <dd><p>Manage how functions are called with these utilities.</p>
22
+ </dd>
23
+ <dt><a href="#module_objectDescriptors">objectDescriptors</a></dt>
24
+ <dd><p>A &quot;descriptor&quot; is a flat, serializable snapshot of an object or array&#39;s shape: for each property, its type(s),
25
+ whether it&#39;s nullable, and - if the property&#39;s own value is itself an object/array - a reference to that nested
26
+ value&#39;s own descriptor elsewhere in the same list, rather than nesting descriptors inside descriptors. This flat,
27
+ reference-based structure is what lets these utilities walk deeply nested and even circular object graphs (an
28
+ object that contains itself, directly or indirectly) without infinite recursion, since a value that&#39;s already
29
+ been described is simply pointed to again instead of re-described.</p>
30
+ <p>Start with <a href="#module_objectDescriptors.describeObjectMap">describeObjectMap</a>, which takes any real object or array and produces
31
+ this flat list of descriptors for you - the other functions here (comparing, merging, cloning descriptors) are
32
+ building blocks used internally, or useful once you already have descriptors to work with directly.</p>
33
+ <p>The concrete use this module has earned its keep on: describing two objects and comparing the results tells
34
+ you whether they&#39;re the same shape and values even when they&#39;re different references entirely (see
35
+ <a href="#module_objectDescriptors.sameDescriptor">sameDescriptor</a>/<a href="#module_objectDescriptors.compareDescriptor">compareDescriptor</a>) - useful
36
+ anywhere you need to check that two objects genuinely match without caring whether they&#39;re literally the same
37
+ instance. A descriptor also doubles as a flat, structured summary of an object&#39;s shape, which can be handy for
38
+ discussion or assessment purposes (e.g. describing what an object looks like without dumping the whole thing).</p>
39
+ </dd>
40
+ <dt><a href="#module_arrayHelpers">arrayHelpers</a></dt>
41
+ <dd><p>Utilities for building, merging, deduplicating and comparing arrays, plus a basic FIFO queue (BasicQueue) for
42
+ use with functionHelpers&#39; queueManager/queueTimeout.</p>
43
+ </dd>
44
+ </dl>
45
+
46
+ <a name="module_siFunciona"></a>
47
+
48
+ ## siFunciona
49
+ All the siFunciona system functions for stringing together functions and simplifying logic.
50
+
51
+ **Version**: 1.0.0
52
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
53
+ <a name="module_stringHelpers"></a>
54
+
55
+ ## stringHelpers
56
+ Manage how strings are manipulated with these utilities.
57
+
58
+ **Version**: 1.0.0
59
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
60
+
61
+ * [stringHelpers](#module_stringHelpers)
62
+ * [.words(str)](#module_stringHelpers.words) ⇒ <code>Array.&lt;string&gt;</code>
63
+ * [.ucFirst(str)](#module_stringHelpers.ucFirst) ⇒ <code>string</code>
64
+ * [.titleCase(str)](#module_stringHelpers.titleCase) ⇒ <code>string</code>
65
+ * [.strBeforeLast(str, search)](#module_stringHelpers.strBeforeLast) ⇒ <code>string</code>
66
+ * [.strBefore(str, search)](#module_stringHelpers.strBefore) <code>string</code>
67
+ * [.strAfterLast(str, search)](#module_stringHelpers.strAfterLast) ⇒ <code>string</code>
68
+ * [.strAfter(str, search)](#module_stringHelpers.strAfter) <code>string</code>
69
+ * [.snakeCase(str)](#module_stringHelpers.snakeCase) <code>string</code>
70
+ * [.regexEscape(str)](#module_stringHelpers.regexEscape) <code>string</code>
71
+ * [.makeRelativePath(fromFile, toFile)](#module_stringHelpers.makeRelativePath) ⇒ <code>string</code>
72
+ * [.makeFilepath(root, [append])](#module_stringHelpers.makeFilepath) ⇒ <code>string</code>
73
+ * [.kabobCase(str)](#module_stringHelpers.kabobCase) ⇒ <code>string</code>
74
+ * [.camelCase(str)](#module_stringHelpers.camelCase) ⇒ <code>string</code>
75
+
76
+ <a name="module_stringHelpers.words"></a>
77
+
78
+ ### stringHelpers.words(str) ⇒ <code>Array.&lt;string&gt;</code>
79
+ Split a string into sets of numbers or letters - the shared tokenizer behind camelCase/kabobCase/snakeCase/
80
+ titleCase, so each can rebuild the string in its own casing style.
81
+
82
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
83
+
84
+ | Param | Type | Description |
85
+ | --- | --- | --- |
86
+ | str | <code>string</code> | The string to split. |
87
+
88
+ <a name="module_stringHelpers.ucFirst"></a>
89
+
90
+ ### stringHelpers.ucFirst(str) <code>string</code>
91
+ Given a string, make the first character uppercase and the rest lowercase.
92
+
93
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
94
+
95
+ | Param | Type | Description |
96
+ | --- | --- | --- |
97
+ | str | <code>string</code> | The string to convert. |
98
+
99
+ <a name="module_stringHelpers.titleCase"></a>
100
+
101
+ ### stringHelpers.titleCase(str) <code>string</code>
102
+ Given a string in kebab-case, snake_case, camelCase or 'Sentence case', convert to 'Title Case'.
103
+
104
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
105
+
106
+ | Param | Type | Description |
107
+ | --- | --- | --- |
108
+ | str | <code>string</code> | The string to convert. |
109
+
110
+ <a name="module_stringHelpers.strBeforeLast"></a>
111
+
112
+ ### stringHelpers.strBeforeLast(str, search) ⇒ <code>string</code>
113
+ Retrieve the string part before the last search match.
114
+
115
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
116
+ **Returns**: <code>string</code> - The portion of `str` before the last occurrence of `search`, or `''` if not found.
117
+
118
+ | Param | Type | Description |
119
+ | --- | --- | --- |
120
+ | str | <code>string</code> | The string to search within. |
121
+ | search | <code>string</code> | The substring to search for. |
122
+
123
+ <a name="module_stringHelpers.strBefore"></a>
124
+
125
+ ### stringHelpers.strBefore(str, search) <code>string</code>
126
+ Retrieve the string part before the search match.
127
+
128
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
129
+ **Returns**: <code>string</code> - The portion of `str` before the first occurrence of `search`, or `''` if not found.
130
+
131
+ | Param | Type | Description |
132
+ | --- | --- | --- |
133
+ | str | <code>string</code> | The string to search within. |
134
+ | search | <code>string</code> | The substring to search for. |
135
+
136
+ <a name="module_stringHelpers.strAfterLast"></a>
137
+
138
+ ### stringHelpers.strAfterLast(str, search) <code>string</code>
139
+ Retrieve the string part after the last search match.
140
+
141
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
142
+ **Returns**: <code>string</code> - The portion of `str` after the last occurrence of `search`, or `''` if not found.
143
+
144
+ | Param | Type | Description |
145
+ | --- | --- | --- |
146
+ | str | <code>string</code> | The string to search within. |
147
+ | search | <code>string</code> | The substring to search for. |
148
+
149
+ <a name="module_stringHelpers.strAfter"></a>
150
+
151
+ ### stringHelpers.strAfter(str, search) <code>string</code>
152
+ Retrieve the string part after the search match.
153
+
154
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
155
+ **Returns**: <code>string</code> - The portion of `str` after the first occurrence of `search`, or `''` if not found.
156
+
157
+ | Param | Type | Description |
158
+ | --- | --- | --- |
159
+ | str | <code>string</code> | The string to search within. |
160
+ | search | <code>string</code> | The substring to search for. |
161
+
162
+ <a name="module_stringHelpers.snakeCase"></a>
163
+
164
+ ### stringHelpers.snakeCase(str) ⇒ <code>string</code>
165
+ Given a string in kebab-case, camelCase or 'Sentence case', convert to snake_case.
166
+
167
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
168
+
169
+ | Param | Type | Description |
170
+ | --- | --- | --- |
171
+ | str | <code>string</code> | The string to convert. |
172
+
173
+ <a name="module_stringHelpers.regexEscape"></a>
174
+
175
+ ### stringHelpers.regexEscape(str) ⇒ <code>string</code>
176
+ Take a string and escape the regex characters.
177
+
178
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
179
+
180
+ | Param | Type | Description |
181
+ | --- | --- | --- |
182
+ | str | <code>string</code> | The string to escape, so it can be used literally inside a `RegExp`. |
183
+
184
+ <a name="module_stringHelpers.makeRelativePath"></a>
185
+
186
+ ### stringHelpers.makeRelativePath(fromFile, toFile) <code>string</code>
187
+ Compare two file paths and simplify them to a relative path.
188
+
189
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
190
+ **Returns**: <code>string</code> - `toFile` expressed relative to `fromFile`.
191
+
192
+ | Param | Type | Description |
193
+ | --- | --- | --- |
194
+ | fromFile | <code>string</code> | The path of the file the resulting relative path will be used from. |
195
+ | toFile | <code>string</code> | The path of the file being referenced. |
196
+
197
+ <a name="module_stringHelpers.makeFilepath"></a>
198
+
199
+ ### stringHelpers.makeFilepath(root, [append]) ⇒ <code>string</code>
200
+ Format the given path so that it does not have trailing slashes and also correctly appends a path.
201
+
202
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
203
+
204
+ | Param | Type | Default | Description |
205
+ | --- | --- | --- | --- |
206
+ | root | <code>string</code> | | The base path to start from. |
207
+ | [append] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | A path to append to `root` - may itself use `./` or `../` segments. |
208
+
209
+ <a name="module_stringHelpers.kabobCase"></a>
210
+
211
+ ### stringHelpers.kabobCase(str) ⇒ <code>string</code>
212
+ Given a string in snake_case, camelCase or 'Sentence case', convert to kabob-case.
213
+
214
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
215
+
216
+ | Param | Type | Description |
217
+ | --- | --- | --- |
218
+ | str | <code>string</code> | The string to convert. |
219
+
220
+ <a name="module_stringHelpers.camelCase"></a>
221
+
222
+ ### stringHelpers.camelCase(str) ⇒ <code>string</code>
223
+ Given a string in kebab-case, snake_case or 'Sentence case', convert to camelCase.
224
+
225
+ **Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
226
+
227
+ | Param | Type | Description |
228
+ | --- | --- | --- |
229
+ | str | <code>string</code> | The string to convert. |
230
+
231
+ <a name="module_objectHelpers"></a>
232
+
233
+ ## objectHelpers
234
+ Simplify working with object by providing array-like parsing. Also, provides cloning and merging along with accessors that always have a return value for optimal nesting.
235
+
236
+ **Version**: 1.0.0
237
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
238
+
239
+ * [objectHelpers](#module_objectHelpers)
240
+ * _static_
241
+ * [.mergeObjectsMutable](#module_objectHelpers.mergeObjectsMutable) ⇒ <code>\*</code>
242
+ * [.mergeObjects](#module_objectHelpers.mergeObjects) ⇒ <code>\*</code>
243
+ * [.setValue(key, value, item)](#module_objectHelpers.setValue) ⇒ <code>Object</code> \| <code>Array</code>
244
+ * [.setAndReturnValue(item, key, value)](#module_objectHelpers.setAndReturnValue) ⇒ <code>\*</code>
245
+ * [.reduceObject(obj, fn, [initialValue])](#module_objectHelpers.reduceObject) ⇒ <code>\*</code>
246
+ * [.objectValues(object, [includeInherited])](#module_objectHelpers.objectValues) <code>Array</code>
247
+ * [.objectKeys(object, [includeInherited])](#module_objectHelpers.objectKeys) ⇒ <code>Array.&lt;(string\|number)&gt;</code>
248
+ * [.mergeObjectsBase([options])](#module_objectHelpers.mergeObjectsBase) <code>module:objectHelpers~mergeObjectsCallback</code> \| <code>mergeObjectsCallback</code>
249
+ * [.mapObject(obj, fn, [thisArg])](#module_objectHelpers.mapObject) ⇒ <code>Object</code> \| <code>Array</code>
250
+ * [.isObject(object)](#module_objectHelpers.isObject) ⇒ <code>boolean</code>
251
+ * [.isInstanceObject(object)](#module_objectHelpers.isInstanceObject) <code>boolean</code>
252
+ * [.isCloneable(value)](#module_objectHelpers.isCloneable) <code>boolean</code>
253
+ * [.filterObject(obj, fn, [thisArg])](#module_objectHelpers.filterObject) ⇒ <code>Object</code> \| <code>Array</code>
254
+ * [.emptyObject(item)](#module_objectHelpers.emptyObject) ⇒ <code>boolean</code>
255
+ * [.dotUnset(arrayObject, dotNotation)](#module_objectHelpers.dotUnset) ⇒ <code>Object</code>
256
+ * [.dotSet(arrayObject, dotNotation, value)](#module_objectHelpers.dotSet) ⇒ <code>Object</code>
257
+ * [.dotNotate(arrayObject, [retainObjects])](#module_objectHelpers.dotNotate) ⇒ <code>DotNotatedObject</code>
258
+ * [.dotGet(arrayObject, dotNotation, [defaultValue])](#module_objectHelpers.dotGet) <code>\*</code>
259
+ * [.cloneObject(object, [options])](#module_objectHelpers.cloneObject) ⇒ <code>Object</code>
260
+ * _inner_
261
+ * [~handleRetainObjects([retainObjects])](#module_objectHelpers..handleRetainObjects) ⇒ <code>function</code>
262
+ * [~performDotNotate(arrayObject, didRetain, [prepend], [results])](#module_objectHelpers..performDotNotate) ⇒ <code>DotNotatedObject</code>
263
+
264
+ <a name="module_objectHelpers.mergeObjectsMutable"></a>
265
+
266
+ ### objectHelpers.mergeObjectsMutable ⇒ <code>\*</code>
267
+ Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
268
+
269
+ **Kind**: static constant of [<code>objectHelpers</code>](#module_objectHelpers)
270
+ **See**: [module:objectHelpers~mergeObjectsCallback](module:objectHelpers~mergeObjectsCallback)
271
+
272
+ | Param | Type | Description |
273
+ | --- | --- | --- |
274
+ | ...objects | <code>Object</code> | Provide a list of objects which will be merged starting from the end up into the first |
275
+
276
+ <a name="module_objectHelpers.mergeObjects"></a>
277
+
278
+ ### objectHelpers.mergeObjects <code>\*</code>
279
+ Uses mergeObjectsBase deep merge objects and arrays, merge by value.
280
+
281
+ **Kind**: static constant of [<code>objectHelpers</code>](#module_objectHelpers)
282
+ **See**: [module:objectHelpers~mergeObjectsCallback](module:objectHelpers~mergeObjectsCallback)
283
+
284
+ | Param | Type | Description |
285
+ | --- | --- | --- |
286
+ | ...objects | <code>Object</code> | Provide a list of objects which will be merged starting from the end up into the first |
287
+
288
+ <a name="module_objectHelpers.setValue"></a>
289
+
290
+ ### objectHelpers.setValue(key, value, item) <code>Object</code> \| <code>Array</code>
291
+ Set a value on an item, then return the item.
292
+ NOTE: Argument order designed for usage with pipe
293
+
294
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
295
+
296
+ | Param | Type | Description |
297
+ | --- | --- | --- |
298
+ | key | <code>string</code> \| <code>number</code> | The key on the item which will have its value set |
299
+ | value | <code>\*</code> | Any value to be applied to the key |
300
+ | item | <code>Object</code> \| <code>Array</code> | An object or array to be updated |
301
+
302
+ <a name="module_objectHelpers.setAndReturnValue"></a>
303
+
304
+ ### objectHelpers.setAndReturnValue(item, key, value) <code>\*</code>
305
+ Set a value on an item, then return the value
306
+
307
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
308
+
309
+ | Param | Type | Description |
310
+ | --- | --- | --- |
311
+ | item | <code>Object</code> \| <code>Array</code> | An object or array to be updated |
312
+ | key | <code>string</code> \| <code>number</code> | The key on the item which will have its value set |
313
+ | value | <code>\*</code> | Any value to be applied to the key |
314
+
315
+ <a name="module_objectHelpers.reduceObject"></a>
316
+
317
+ ### objectHelpers.reduceObject(obj, fn, [initialValue]) <code>\*</code>
318
+ This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
319
+ If an array is passed in instead then it will perform standard reduce(). It is recommended to
320
+ always use the standard reduce() function when it is known that the object is actually an array.
321
+
322
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
323
+
324
+ | Param | Type | Description |
325
+ | --- | --- | --- |
326
+ | obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be filtered |
327
+ | fn | <code>module:objectHelpers~reduceCallback</code> \| <code>function</code> \| <code>reduceCallback</code> | The function to be processed for each filtered property |
328
+ | [initialValue] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as the first argument to the first call of the callback. If no initial value is supplied, the first element in the array will be used. Calling reduce on an empty array without an initial value is an error. |
329
+
330
+ <a name="module_objectHelpers.objectValues"></a>
331
+
332
+ ### objectHelpers.objectValues(object, [includeInherited]) <code>Array</code>
333
+ Get an array of values from any object or array. Will return empty array when invalid or there are no values.
334
+ Optional flag will include the inherited values from prototype chain when set.
335
+
336
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
337
+
338
+ | Param | Type | Default |
339
+ | --- | --- | --- |
340
+ | object | <code>Object</code> \| <code>Array</code> | |
341
+ | [includeInherited] | <code>boolean</code> | <code>false</code> |
342
+
343
+ <a name="module_objectHelpers.objectKeys"></a>
344
+
345
+ ### objectHelpers.objectKeys(object, [includeInherited]) <code>Array.&lt;(string\|number)&gt;</code>
346
+ Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
347
+ Optional flag will include the inherited keys from prototype chain when set.
348
+
349
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
350
+
351
+ | Param | Type | Default |
352
+ | --- | --- | --- |
353
+ | object | <code>Object</code> \| <code>Array</code> | |
354
+ | [includeInherited] | <code>boolean</code> | <code>false</code> |
355
+
356
+ <a name="module_objectHelpers.mergeObjectsBase"></a>
357
+
358
+ ### objectHelpers.mergeObjectsBase([options]) <code>module:objectHelpers~mergeObjectsCallback</code> \| <code>mergeObjectsCallback</code>
359
+ Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
360
+ Objects having the same attributes will overwrite from last object to first.
361
+ NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
362
+ have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
363
+
364
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
365
+
366
+ | Param | Type | Default | Description |
367
+ | --- | --- | --- | --- |
368
+ | [options] | <code>Object</code> | <code>{}</code> | |
369
+ | [options.mapLimit] | <code>number</code> | <code>100</code> | Size of temporary reference array used in memory before assessing relevancy. |
370
+ | [options.depthLimit] | <code>number</code> | <code>-1</code> | Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited. |
371
+ | [options.relevancyRange] | <code>number</code> | <code>1000</code> | Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed. |
372
+ | [options.map] | <code>Iterable</code> \| <code>array</code> | <code>[]</code> | A predetermined list of references gathered (to be passed to itself during recursion). |
373
+ | [options.useClone] | <code>boolean</code> | <code>false</code> | |
374
+
375
+ <a name="module_objectHelpers.mapObject"></a>
376
+
377
+ ### objectHelpers.mapObject(obj, fn, [thisArg]) ⇒ <code>Object</code> \| <code>Array</code>
378
+ This function is intended to replicate behaviour of the Array.map() function but for Objects.
379
+ If an array is passed in instead then it will perform standard map(). It is recommended to
380
+ always use the standard map() function when it is known that the object is actually an array.
381
+
382
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
383
+
384
+ | Param | Type | Description |
385
+ | --- | --- | --- |
386
+ | obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be mapped |
387
+ | fn | <code>module:objectHelpers~mapCallback</code> \| <code>function</code> | The function to be processed for each mapped property |
388
+ | [thisArg] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as this when executing callback. |
389
+
390
+ <a name="module_objectHelpers.isObject"></a>
391
+
392
+ ### objectHelpers.isObject(object) ⇒ <code>boolean</code>
393
+ Check if the provided thing is an object / array.
394
+
395
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
396
+
397
+ | Param | Type |
398
+ | --- | --- |
399
+ | object | <code>\*</code> |
400
+
401
+ <a name="module_objectHelpers.isInstanceObject"></a>
402
+
403
+ ### objectHelpers.isInstanceObject(object) ⇒ <code>boolean</code>
404
+ Check if the current object has inherited properties.
405
+
406
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
407
+
408
+ | Param | Type |
409
+ | --- | --- |
410
+ | object | <code>Object</code> \| <code>Array</code> |
411
+
412
+ <a name="module_objectHelpers.isCloneable"></a>
413
+
414
+ ### objectHelpers.isCloneable(value) <code>boolean</code>
415
+ Determine if the value is a reference instance
416
+
417
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
418
+
419
+ | Param | Type |
420
+ | --- | --- |
421
+ | value | <code>Array</code> \| <code>Object</code> \| <code>\*</code> |
422
+
423
+ <a name="module_objectHelpers.filterObject"></a>
424
+
425
+ ### objectHelpers.filterObject(obj, fn, [thisArg]) <code>Object</code> \| <code>Array</code>
426
+ This function is intended to replicate behaviour of the Array.filter() function but for Objects.
427
+ If an array is passed in instead then it will perform standard filter(). It is recommended to
428
+ always use the standard filter() function when it is known that the object is actually an array.
429
+
430
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
431
+
432
+ | Param | Type | Description |
433
+ | --- | --- | --- |
434
+ | obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be filtered |
435
+ | fn | <code>module:objectHelpers~filterCallback</code> \| <code>function</code> | The function to be processed for each filtered property |
436
+ | [thisArg] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as this when executing callback. |
437
+
438
+ <a name="module_objectHelpers.emptyObject"></a>
439
+
440
+ ### objectHelpers.emptyObject(item) ⇒ <code>boolean</code>
441
+ Helper function for testing if the item is an Object or Array that does not have any properties
442
+
443
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
444
+
445
+ | Param | Type | Description |
446
+ | --- | --- | --- |
447
+ | item | <code>Object</code> \| <code>Array</code> | Object or Array to test |
448
+
449
+ <a name="module_objectHelpers.dotUnset"></a>
450
+
451
+ ### objectHelpers.dotUnset(arrayObject, dotNotation) <code>Object</code>
452
+ Unset a nested property value an object.
453
+
454
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
455
+ **Returns**: <code>Object</code> - The modified object
456
+
457
+ | Param | Type | Description |
458
+ | --- | --- | --- |
459
+ | arrayObject | <code>Object</code> | The array or object to set the property on |
460
+ | dotNotation | <code>string</code> | The path for the property |
461
+
462
+ <a name="module_objectHelpers.dotSet"></a>
463
+
464
+ ### objectHelpers.dotSet(arrayObject, dotNotation, value) <code>Object</code>
465
+ Set a nested property value an object.
466
+
467
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
468
+ **Returns**: <code>Object</code> - The modified object
469
+
470
+ | Param | Type | Default | Description |
471
+ | --- | --- | --- | --- |
472
+ | arrayObject | <code>Object</code> | | The array or object to set the property on |
473
+ | dotNotation | <code>string</code> | | The path for the property |
474
+ | value | <code>\*</code> | <code></code> | The default value to return if the property is not found |
475
+
476
+ <a name="module_objectHelpers.dotNotate"></a>
477
+
478
+ ### objectHelpers.dotNotate(arrayObject, [retainObjects]) <code>DotNotatedObject</code>
479
+ Convert an array or object to a single dimensional associative array with dot notation.
480
+
481
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
482
+ **Returns**: <code>DotNotatedObject</code> - The dot-notated object
483
+
484
+ | Param | Type | Default | Description |
485
+ | --- | --- | --- | --- |
486
+ | arrayObject | <code>Object</code> | | The array or object to dot-notate |
487
+ | [retainObjects] | <code>Array.&lt;DotNotationString&gt;</code> | <code>[]</code> | An array of keys to retain as objects |
488
+
489
+ <a name="module_objectHelpers.dotGet"></a>
490
+
491
+ ### objectHelpers.dotGet(arrayObject, dotNotation, [defaultValue]) <code>\*</code>
492
+ Get a nested property value from an object.
493
+
494
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
495
+ **Returns**: <code>\*</code> - The value of the property
496
+
497
+ | Param | Type | Default | Description |
498
+ | --- | --- | --- | --- |
499
+ | arrayObject | <code>Object</code> | | The array or object to get the property from |
500
+ | dotNotation | <code>string</code> | | The path to the property |
501
+ | [defaultValue] | <code>string</code> \| <code>null</code> | <code>null</code> | The default value to return if the property is not found |
502
+
503
+ <a name="module_objectHelpers.cloneObject"></a>
504
+
505
+ ### objectHelpers.cloneObject(object, [options]) ⇒ <code>Object</code>
506
+ Clone objects for manipulation without data corruption, returns a copy of the provided object.
507
+ NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
508
+ have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
509
+
510
+ **Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
511
+
512
+ | Param | Type | Default | Description |
513
+ | --- | --- | --- | --- |
514
+ | object | <code>Object</code> | | The original object that is being cloned |
515
+ | [options] | <code>Object</code> | <code>{}</code> | |
516
+ | [options.mapLimit] | <code>number</code> | <code>100</code> | Size of temporary reference array used in memory before assessing relevancy. |
517
+ | [options.depthLimit] | <code>number</code> | <code>-1</code> | Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited. |
518
+ | [options.relevancyRange] | <code>number</code> | <code>1000</code> | Total reference map length subtract this range, any relevancy less than that amount at time of evaluation will be removed. |
519
+
520
+ <a name="module_objectHelpers..handleRetainObjects"></a>
521
+
522
+ ### objectHelpers~handleRetainObjects([retainObjects]) <code>function</code>
523
+ Convert an array of keys into a regex, return a function to test if incoming keys match.
524
+
525
+ **Kind**: inner method of [<code>objectHelpers</code>](#module_objectHelpers)
526
+ **Returns**: <code>function</code> - The dot-notated array
527
+
528
+ | Param | Type | Default | Description |
529
+ | --- | --- | --- | --- |
530
+ | [retainObjects] | <code>Array.&lt;DotNotationString&gt;</code> | <code>[]</code> | An array of keys to retain as objects |
531
+
532
+ <a name="module_objectHelpers..performDotNotate"></a>
533
+
534
+ ### objectHelpers~performDotNotate(arrayObject, didRetain, [prepend], [results]) ⇒ <code>DotNotatedObject</code>
535
+ The underlying logic function for converting arrays to dot-notation.
536
+
537
+ **Kind**: inner method of [<code>objectHelpers</code>](#module_objectHelpers)
538
+ **Returns**: <code>DotNotatedObject</code> - The dot-notated object
539
+
540
+ | Param | Type | Default | Description |
541
+ | --- | --- | --- | --- |
542
+ | arrayObject | <code>Object</code> | | The array or object to dot-notate |
543
+ | didRetain | <code>function</code> | | The test function to see if a key should be retained |
544
+ | [prepend] | <code>DotNotationString</code> | <code>&#x27;&#x27;</code> | The path for the property being processed |
545
+ | [results] | <code>DotNotatedObject</code> | <code>{}</code> | The final array to return |
546
+
547
+ <a name="module_numberHelpers"></a>
548
+
549
+ ## numberHelpers
550
+ Some number comparators and random number generators.
551
+
552
+ **Version**: 1.0.0
553
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
554
+
555
+ * [numberHelpers](#module_numberHelpers)
556
+ * [.simplestRatio(...numbers)](#module_numberHelpers.simplestRatio) ⇒ <code>Array.&lt;number&gt;</code>
557
+ * [.randomNumber(range, [offset], [interval])](#module_numberHelpers.randomNumber) ⇒ <code>number</code>
558
+ * [.randomInteger(range, [offset], [interval])](#module_numberHelpers.randomInteger) ⇒ <code>number</code>
559
+ * [.lowestCommonDenominator(...numbers)](#module_numberHelpers.lowestCommonDenominator) <code>number</code>
560
+ * [.leastCommonMultiple(num1, num2)](#module_numberHelpers.leastCommonMultiple) <code>number</code>
561
+ * [.greatestCommonDivisor(num1, num2)](#module_numberHelpers.greatestCommonDivisor) ⇒ <code>number</code>
562
+ * [.compare(val1, val2)](#module_numberHelpers.compare) <code>number</code>
563
+ * [.absoluteMin(num1, num2)](#module_numberHelpers.absoluteMin) ⇒ <code>number</code>
564
+ * [.absoluteMax(num1, num2)](#module_numberHelpers.absoluteMax) <code>number</code>
565
+
566
+ <a name="module_numberHelpers.simplestRatio"></a>
567
+
568
+ ### numberHelpers.simplestRatio(...numbers) <code>Array.&lt;number&gt;</code>
569
+ Reduce several numbers to their simplest form / ratio
570
+
571
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
572
+
573
+ | Param | Type | Description |
574
+ | --- | --- | --- |
575
+ | ...numbers | <code>number</code> | Array of numbers to simplify |
576
+
577
+ <a name="module_numberHelpers.randomNumber"></a>
578
+
579
+ ### numberHelpers.randomNumber(range, [offset], [interval]) <code>number</code>
580
+ Create a single random number within provided range. And with optional offset,
581
+ The distance between the result numbers can be adjusted with interval.
582
+
583
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
584
+
585
+ | Param | Type | Default | Description |
586
+ | --- | --- | --- | --- |
587
+ | range | <code>number</code> | | Choose the breadth of the random number (0-100 would be 100 for range) |
588
+ | [offset] | <code>number</code> | <code>0</code> | Choose the starting number (1-10 would be 1 for offset, 9 for range) |
589
+ | [interval] | <code>number</code> | <code>1</code> | Choose the distance between numbers (~5, ~10, ~15 would be 5 for interval, 1 for offset, 2 for range) |
590
+
591
+ <a name="module_numberHelpers.randomInteger"></a>
592
+
593
+ ### numberHelpers.randomInteger(range, [offset], [interval]) ⇒ <code>number</code>
594
+ Create a single random integer within provide range. And with optional offset,
595
+ The distance between the result numbers can be adjusted with interval.
596
+
597
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
598
+
599
+ | Param | Type | Default | Description |
600
+ | --- | --- | --- | --- |
601
+ | range | <code>number</code> | | Choose the breadth of the random number (0-100 would be 100 for range) |
602
+ | [offset] | <code>number</code> | <code>0</code> | Choose the starting number (1-10 would be 1 for offset, 9 for range) |
603
+ | [interval] | <code>number</code> | <code>1</code> | Choose the distance between numbers (5, 10, 15 would be 5 for interval, 1 for offset, 2 for range) |
604
+
605
+ <a name="module_numberHelpers.lowestCommonDenominator"></a>
606
+
607
+ ### numberHelpers.lowestCommonDenominator(...numbers) ⇒ <code>number</code>
608
+ Find the smallest number that all the given numbers divide into evenly, by reducing them pairwise with
609
+ leastCommonMultiple.
610
+
611
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
612
+
613
+ | Param | Type | Description |
614
+ | --- | --- | --- |
615
+ | ...numbers | <code>number</code> | Two or more numbers to find the lowest common denominator of. |
616
+
617
+ <a name="module_numberHelpers.leastCommonMultiple"></a>
618
+
619
+ ### numberHelpers.leastCommonMultiple(num1, num2) ⇒ <code>number</code>
620
+ Helper for calculating the multiplier that would make each number relative to each other.
621
+
622
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
623
+
624
+ | Param | Type | Description |
625
+ | --- | --- | --- |
626
+ | num1 | <code>number</code> | A number to compare |
627
+ | num2 | <code>number</code> | Another number to be compared against |
628
+
629
+ <a name="module_numberHelpers.greatestCommonDivisor"></a>
630
+
631
+ ### numberHelpers.greatestCommonDivisor(num1, num2) <code>number</code>
632
+ Return the highest number that can be divided into both numbers.
633
+
634
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
635
+
636
+ | Param | Type | Description |
637
+ | --- | --- | --- |
638
+ | num1 | <code>number</code> | First number to assess |
639
+ | num2 | <code>number</code> | Second number to compare for common divisor |
640
+
641
+ <a name="module_numberHelpers.compare"></a>
642
+
643
+ ### numberHelpers.compare(val1, val2) <code>number</code>
644
+ Compare two numbers and return:
645
+ -1 to indicate val1 is less than val2
646
+ 0 to indicate both values are the equal
647
+ 1 to indicate val1 is greater than val2
648
+
649
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
650
+
651
+ | Param | Type | Description |
652
+ | --- | --- | --- |
653
+ | val1 | <code>number</code> | The first number to compare |
654
+ | val2 | <code>number</code> | The second number to compare |
655
+
656
+ <a name="module_numberHelpers.absoluteMin"></a>
657
+
658
+ ### numberHelpers.absoluteMin(num1, num2) ⇒ <code>number</code>
659
+ Helper for returning the absolute min value
660
+
661
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
662
+
663
+ | Param | Type | Description |
664
+ | --- | --- | --- |
665
+ | num1 | <code>number</code> | A number to compare |
666
+ | num2 | <code>number</code> | Another number to be compared against |
667
+
668
+ <a name="module_numberHelpers.absoluteMax"></a>
669
+
670
+ ### numberHelpers.absoluteMax(num1, num2) ⇒ <code>number</code>
671
+ Helper for returning the absolute max value
672
+
673
+ **Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
674
+
675
+ | Param | Type | Description |
676
+ | --- | --- | --- |
677
+ | num1 | <code>number</code> | A number to compare |
678
+ | num2 | <code>number</code> | Another number to be compared against |
679
+
680
+ <a name="module_functionHelpers"></a>
681
+
682
+ ## functionHelpers
683
+ Manage how functions are called with these utilities.
684
+
685
+ **Version**: 1.0.0
686
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
687
+
688
+ * [functionHelpers](#module_functionHelpers)
689
+ * [.trace(label, [useClone])](#module_functionHelpers.trace) <code>function</code>
690
+ * [.relevancyFilter(map, [options])](#module_functionHelpers.relevancyFilter) ⇒ <code>relevanceMap</code>
691
+ * [.queueTimeout([queueManagerHandle])](#module_functionHelpers.queueTimeout) <code>module:functionHelpers~queueTimeoutHandle</code>
692
+ * [.queueManager([queue])](#module_functionHelpers.queueManager) <code>module:functionHelpers~queueManagerHandle</code>
693
+ * [~makeQueuedRunnable(resolve, reject, fn, ...args)](#module_functionHelpers.queueManager..makeQueuedRunnable) ⇒ <code>queuedRunnable</code>
694
+ * [~postRun(result)](#module_functionHelpers.queueManager..postRun) <code>\*</code>
695
+ * [~runNextItem()](#module_functionHelpers.queueManager..runNextItem) ⇒ <code>IteratorYieldResult</code> \| <code>null</code>
696
+ * [~pushAnother(fn, ...args)](#module_functionHelpers.queueManager..pushAnother) ⇒
697
+ * [.preloadParams(fn, params, [unassignedParam])](#module_functionHelpers.preloadParams) ⇒ <code>module:functionHelpers~callWithMissing</code>
698
+ * [.pipe(...fns)](#module_functionHelpers.pipe) ⇒ <code>\*</code>
699
+ * [.onBodyLoad(callback, [reset])](#module_functionHelpers.onBodyLoad) <code>Array.&lt;function()&gt;</code>
700
+ * [.makeBasicQueue([initialQueue])](#module_functionHelpers.makeBasicQueue) ⇒ <code>IsQueue</code>
701
+ * [.delay(time)](#module_functionHelpers.delay) <code>module:functionHelpers~delayHandler</code>
702
+ * [.curry(fn)](#module_functionHelpers.curry) ⇒ <code>function</code> \| <code>\*</code>
703
+ * [.callWithParams(fn, params, [minimum])](#module_functionHelpers.callWithParams) <code>\*</code>
704
+
705
+ <a name="module_functionHelpers.trace"></a>
706
+
707
+ ### functionHelpers.trace(label, [useClone]) <code>function</code>
708
+ Output the value with label to the console and return the value to not interrupt the code - useful for
709
+ inspecting a value mid-pipe/mid-chain without altering the result.
710
+
711
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
712
+
713
+ | Param | Type | Default | Description |
714
+ | --- | --- | --- | --- |
715
+ | label | <code>string</code> | | Pass an identifying label of the value being output. |
716
+ | [useClone] | <code>boolean</code> | <code>true</code> | Determines if the logged data should be a clone of the original to preserve its state at the time of logging (rather than a live reference that may show later mutations). |
717
+
718
+ <a name="module_functionHelpers.relevancyFilter"></a>
719
+
720
+ ### functionHelpers.relevancyFilter(map, [options]) ⇒ <code>relevanceMap</code>
721
+ Remove elements out of relevance range and update the max relevance.
722
+
723
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
724
+
725
+ | Param | Type | Default | Description |
726
+ | --- | --- | --- | --- |
727
+ | map | <code>relevanceMap</code> | | |
728
+ | [options] | <code>Object</code> | <code>{}</code> | |
729
+ | [options.mapLimit] | <code>number</code> | <code>1000</code> | Only filter once the map exceeds this many entries. |
730
+ | [options.relevancyRange] | <code>number</code> | <code>100</code> | How many of the most-recent relevance values to keep. |
731
+
732
+ <a name="module_functionHelpers.queueTimeout"></a>
733
+
734
+ ### functionHelpers.queueTimeout([queueManagerHandle]) ⇒ <code>module:functionHelpers~queueTimeoutHandle</code>
735
+ Manage functions to run sequentially with delays.
736
+
737
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
738
+
739
+ | Param | Type | Default |
740
+ | --- | --- | --- |
741
+ | [queueManagerHandle] | <code>module:functionHelpers~queueManagerHandle</code> | <code></code> |
742
+
743
+ <a name="module_functionHelpers.queueManager"></a>
744
+
745
+ ### functionHelpers.queueManager([queue]) ⇒ <code>module:functionHelpers~queueManagerHandle</code>
746
+ Manage functions to run sequentially.
747
+
748
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
749
+
750
+ | Param | Type | Default | Description |
751
+ | --- | --- | --- | --- |
752
+ | [queue] | <code>IsQueue</code> \| <code>Array</code> | <code></code> | The queue to manage. Pass a plain array to have it converted into a [BasicQueue](#module_arrayHelpers.BasicQueue) automatically, or a custom queue implementing `IsQueue`; omit it (or pass `null`) to have one created for you. |
753
+
754
+
755
+ * [.queueManager([queue])](#module_functionHelpers.queueManager) ⇒ <code>module:functionHelpers~queueManagerHandle</code>
756
+ * [~makeQueuedRunnable(resolve, reject, fn, ...args)](#module_functionHelpers.queueManager..makeQueuedRunnable) <code>queuedRunnable</code>
757
+ * [~postRun(result)](#module_functionHelpers.queueManager..postRun) ⇒ <code>\*</code>
758
+ * [~runNextItem()](#module_functionHelpers.queueManager..runNextItem) <code>IteratorYieldResult</code> \| <code>null</code>
759
+ * [~pushAnother(fn, ...args)](#module_functionHelpers.queueManager..pushAnother) ⇒
760
+
761
+ <a name="module_functionHelpers.queueManager..makeQueuedRunnable"></a>
762
+
763
+ #### queueManager~makeQueuedRunnable(resolve, reject, fn, ...args) ⇒ <code>queuedRunnable</code>
764
+ Convert a function to a queueable object.
765
+
766
+ **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
767
+
768
+ | Param | Type |
769
+ | --- | --- |
770
+ | resolve | <code>Promise.resolve</code> |
771
+ | reject | <code>Promise.reject</code> |
772
+ | fn | <code>function</code> |
773
+ | ...args | <code>\*</code> |
774
+
775
+ <a name="module_functionHelpers.queueManager..postRun"></a>
776
+
777
+ #### queueManager~postRun(result) ⇒ <code>\*</code>
778
+ After an item is run, THEN run this function to reset isRunning
779
+
780
+ **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
781
+
782
+ | Param | Type |
783
+ | --- | --- |
784
+ | result | <code>\*</code> |
785
+
786
+ <a name="module_functionHelpers.queueManager..runNextItem"></a>
787
+
788
+ #### queueManager~runNextItem() ⇒ <code>IteratorYieldResult</code> \| <code>null</code>
789
+ When ready, runs the next queued runnable generator.
790
+
791
+ **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
792
+ <a name="module_functionHelpers.queueManager..pushAnother"></a>
793
+
794
+ #### queueManager~pushAnother(fn, ...args)
795
+ Add a function into the queue to be run when ready.
796
+
797
+ **Kind**: inner method of [<code>queueManager</code>](#module_functionHelpers.queueManager)
798
+ **Returns**: Promise
799
+
800
+ | Param | Type | Description |
801
+ | --- | --- | --- |
802
+ | fn | <code>function</code> | The function to run when ready |
803
+ | ...args | <code>\*</code> | Optional arguments to apply when the function is ready to be run |
804
+
805
+ <a name="module_functionHelpers.preloadParams"></a>
806
+
807
+ ### functionHelpers.preloadParams(fn, params, [unassignedParam]) ⇒ <code>module:functionHelpers~callWithMissing</code>
808
+ Provide an array of parameters to be used with a function, allow the function to be called later
809
+ with the missing parameter.
810
+
811
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
812
+
813
+ | Param | Type | Default | Description |
814
+ | --- | --- | --- | --- |
815
+ | fn | <code>function</code> | | The function to be called |
816
+ | params | <code>Array</code> | | The parameters to preload |
817
+ | [unassignedParam] | <code>number</code> | <code>0</code> | Position of missing parameter (zero indexed) |
818
+
819
+ <a name="module_functionHelpers.pipe"></a>
820
+
821
+ ### functionHelpers.pipe(...fns) ⇒ <code>\*</code>
822
+ Take one or more function with a single parameter and return value.
823
+ Pass a parameter and the value will be transformed by each function then returned.
824
+
825
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
826
+
827
+ | Param | Type | Description |
828
+ | --- | --- | --- |
829
+ | ...fns | <code>function</code> | Takes a series of functions having the same parameter |
830
+
831
+ <a name="module_functionHelpers.onBodyLoad"></a>
832
+
833
+ ### functionHelpers.onBodyLoad(callback, [reset]) ⇒ <code>Array.&lt;function()&gt;</code>
834
+ Prepare functions to be called once the body is available.
835
+
836
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
837
+
838
+ | Param | Type | Default |
839
+ | --- | --- | --- |
840
+ | callback | <code>function</code> | |
841
+ | [reset] | <code>boolean</code> | <code>false</code> |
842
+
843
+ <a name="module_functionHelpers.makeBasicQueue"></a>
844
+
845
+ ### functionHelpers.makeBasicQueue([initialQueue]) ⇒ <code>IsQueue</code>
846
+ Create an instance of a basic queue.
847
+
848
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
849
+
850
+ | Param | Type | Default | Description |
851
+ | --- | --- | --- | --- |
852
+ | [initialQueue] | <code>Array</code> | <code>[]</code> | Items to pre-populate the queue with, in order. |
853
+
854
+ <a name="module_functionHelpers.delay"></a>
855
+
856
+ ### functionHelpers.delay(time) ⇒ <code>module:functionHelpers~delayHandler</code>
857
+ Provide a timeout which returns a promise.
858
+
859
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
860
+
861
+ | Param | Type | Default | Description |
862
+ | --- | --- | --- | --- |
863
+ | time | <code>number</code> | <code>0</code> | Delay in milliseconds |
864
+
865
+ <a name="module_functionHelpers.curry"></a>
866
+
867
+ ### functionHelpers.curry(fn) <code>function</code> \| <code>\*</code>
868
+ Return a curried version of the passed function.
869
+ The returned function expects the same number of arguments minus the ones provided.
870
+ fn is the name of the function being curried.
871
+
872
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
873
+
874
+ | Param | Type | Description |
875
+ | --- | --- | --- |
876
+ | fn | <code>function</code> | Receives a function to be curried |
877
+
878
+ <a name="module_functionHelpers.callWithParams"></a>
879
+
880
+ ### functionHelpers.callWithParams(fn, params, [minimum]) <code>\*</code>
881
+ Given a function, call with the correct number of parameters from an array of possible parameters.
882
+
883
+ **Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
884
+
885
+ | Param | Type | Default | Description |
886
+ | --- | --- | --- | --- |
887
+ | fn | <code>function</code> | | The function to be called |
888
+ | params | <code>Array</code> | | Array of possible function parameters |
889
+ | [minimum] | <code>number</code> | <code>2</code> | Minimum number of parameters to use in the function |
890
+
891
+ <a name="module_objectDescriptors"></a>
892
+
893
+ ## objectDescriptors
894
+ A "descriptor" is a flat, serializable snapshot of an object or array's shape: for each property, its type(s),
895
+ whether it's nullable, and - if the property's own value is itself an object/array - a reference to that nested
896
+ value's own descriptor elsewhere in the same list, rather than nesting descriptors inside descriptors. This flat,
897
+ reference-based structure is what lets these utilities walk deeply nested and even circular object graphs (an
898
+ object that contains itself, directly or indirectly) without infinite recursion, since a value that's already
899
+ been described is simply pointed to again instead of re-described.
900
+
901
+ Start with [describeObjectMap](#module_objectDescriptors.describeObjectMap), which takes any real object or array and produces
902
+ this flat list of descriptors for you - the other functions here (comparing, merging, cloning descriptors) are
903
+ building blocks used internally, or useful once you already have descriptors to work with directly.
904
+
905
+ The concrete use this module has earned its keep on: describing two objects and comparing the results tells
906
+ you whether they're the same shape and values even when they're different references entirely (see
907
+ [sameDescriptor](#module_objectDescriptors.sameDescriptor)/[compareDescriptor](#module_objectDescriptors.compareDescriptor)) - useful
908
+ anywhere you need to check that two objects genuinely match without caring whether they're literally the same
909
+ instance. A descriptor also doubles as a flat, structured summary of an object's shape, which can be handy for
910
+ discussion or assessment purposes (e.g. describing what an object looks like without dumping the whole thing).
911
+
912
+ **Version**: 1.0.0
913
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
914
+
915
+ * [objectDescriptors](#module_objectDescriptors)
916
+ * [.mappedDescriptorMap](#module_objectDescriptors.mappedDescriptorMap) : <code>module:objectDescriptors~descriptorMap</code>
917
+ * [.descriptorMapSample](#module_objectDescriptors.descriptorMapSample) : <code>module:objectDescriptors~descriptorMap</code>
918
+ * [.descriptorDetailSample](#module_objectDescriptors.descriptorDetailSample) : <code>module:objectDescriptors~descriptorDetail</code>
919
+ * [.descriptorSample](#module_objectDescriptors.descriptorSample) : <code>module:objectDescriptors~descriptor</code>
920
+ * [.sameDescriptor(descriptor1, descriptor2)](#module_objectDescriptors.sameDescriptor) <code>boolean</code>
921
+ * [.nextReference(descriptor, currentReference)](#module_objectDescriptors.nextReference) <code>number</code> \| <code>undefined</code>
922
+ * [.describeObjectMap(object, [options])](#module_objectDescriptors.describeObjectMap) ⇒ <code>module:objectDescriptors~descriptorMap</code>
923
+ * [.describeObjectDetail(value, [key], [index])](#module_objectDescriptors.describeObjectDetail) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
924
+ * [.describeObject(object)](#module_objectDescriptors.describeObject) ⇒ <code>module:objectDescriptors~descriptor</code>
925
+ * [.compareDescriptor(descriptor1, descriptor2)](#module_objectDescriptors.compareDescriptor) ⇒ <code>boolean</code>
926
+ * [.cloneDescriptorDetail(originalDetail)](#module_objectDescriptors.cloneDescriptorDetail) <code>module:objectDescriptors~descriptorDetail</code>
927
+ * [.cloneDescriptor(originalMap)](#module_objectDescriptors.cloneDescriptor) ⇒ <code>module:objectDescriptors~descriptor</code>
928
+ * [.checkDescriptorComplete(descriptor)](#module_objectDescriptors.checkDescriptorComplete) <code>module:objectDescriptors~descriptor</code>
929
+ * [.checkClearValues(descriptor, [keepValues])](#module_objectDescriptors.checkClearValues) ⇒ <code>module:objectDescriptors~descriptor</code>
930
+ * [.assignDescriptorDetail(originalDetail, ...details)](#module_objectDescriptors.assignDescriptorDetail) <code>module:objectDescriptors~descriptorDetail</code>
931
+ * [.assignDescriptor(originalMap, ...descriptors)](#module_objectDescriptors.assignDescriptor) <code>module:objectDescriptors~descriptor</code>
932
+
933
+ <a name="module_objectDescriptors.mappedDescriptorMap"></a>
934
+
935
+ ### objectDescriptors.mappedDescriptorMap : <code>module:objectDescriptors~descriptorMap</code>
936
+ A worked example descriptorMap, produced by describing a `descriptor` value itself (i.e. describing the shape of
937
+ a descriptor) - useful as a realistic fixture showing what a multi-entry descriptorMap with actual references
938
+ looks like, since `descriptorSample`/`descriptorMapSample` alone only demonstrate a trivial single-entry case.
939
+
940
+ **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
941
+ <a name="module_objectDescriptors.descriptorMapSample"></a>
942
+
943
+ ### objectDescriptors.descriptorMapSample : <code>module:objectDescriptors~descriptorMap</code>
944
+ **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
945
+ <a name="module_objectDescriptors.descriptorDetailSample"></a>
946
+
947
+ ### objectDescriptors.descriptorDetailSample : <code>module:objectDescriptors~descriptorDetail</code>
948
+ **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
949
+ <a name="module_objectDescriptors.descriptorSample"></a>
950
+
951
+ ### objectDescriptors.descriptorSample : <code>module:objectDescriptors~descriptor</code>
952
+ **Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
953
+ <a name="module_objectDescriptors.sameDescriptor"></a>
954
+
955
+ ### objectDescriptors.sameDescriptor(descriptor1, descriptor2) <code>boolean</code>
956
+ Check if two descriptors describe the exact same underlying values (not just compatible types, like
957
+ [compareDescriptor](#module_objectDescriptors.compareDescriptor) does) - used to detect genuine circular references, where a
958
+ nested value's descriptor turns out to be identical to one of its own ancestors.
959
+
960
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
961
+ **Returns**: <code>boolean</code> - True if every detail's values match at the same position.
962
+
963
+ | Param | Type | Description |
964
+ | --- | --- | --- |
965
+ | descriptor1 | <code>module:objectDescriptors~descriptor</code> | The first descriptor to compare. |
966
+ | descriptor2 | <code>module:objectDescriptors~descriptor</code> | The second descriptor to compare. |
967
+
968
+ <a name="module_objectDescriptors.nextReference"></a>
969
+
970
+ ### objectDescriptors.nextReference(descriptor, currentReference) <code>number</code> \| <code>undefined</code>
971
+ Find the index (within `descriptor.details`) of the next referenced property - after `currentReference` - whose
972
+ own nested object/array still needs its descriptor built. Used to walk through a descriptor's references one at
973
+ a time while building out a descriptorMap.
974
+
975
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
976
+ **Returns**: <code>number</code> \| <code>undefined</code> - The next detail index to process, or `undefined` if none remain.
977
+
978
+ | Param | Type | Description |
979
+ | --- | --- | --- |
980
+ | descriptor | <code>module:objectDescriptors~descriptor</code> | The descriptor whose references to search. |
981
+ | currentReference | <code>number</code> | The `details` index already processed - search continues after this one. |
982
+
983
+ <a name="module_objectDescriptors.describeObjectMap"></a>
984
+
985
+ ### objectDescriptors.describeObjectMap(object, [options]) ⇒ <code>module:objectDescriptors~descriptorMap</code>
986
+ Trace out the entire object including nested objects, producing a flat descriptorMap - see the
987
+ [objectDescriptors](#module_objectDescriptors) module description for what a descriptor represents and why it's flat. This is
988
+ the main entry point into this module: start here to describe a real object/array before comparing, merging, or
989
+ inspecting its structure with the other functions in this module.
990
+
991
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
992
+
993
+ | Param | Type | Default | Description |
994
+ | --- | --- | --- | --- |
995
+ | object | <code>Object</code> \| <code>Array</code> | | The real object or array to describe. |
996
+ | [options] | <code>Object</code> | <code>{}</code> | |
997
+ | [options.mapLimit] | <code>number</code> | <code>1000000000</code> | Stop describing further nested references once the map reaches this many descriptors - a safety limit for extremely large or deeply-referenced structures. |
998
+ | [options.depthLimit] | <code>number</code> | <code>-1</code> | How many levels of nested objects/arrays to describe; `-1` means no limit, `0` describes only the top level, etc. |
999
+ | [options.keepValues] | <code>boolean</code> | <code>false</code> | By default, each detail's actual values are cleared once its descriptor is complete (to save memory) - set true to keep them. |
1000
+
1001
+ **Example**
1002
+ ```js
1003
+ describeObjectMap({ name: 'example', tags: ['a', 'b'] })
1004
+ // [
1005
+ // { index: 0, details: [...], length: 2, keys: ['name', 'tags'], references: [1], isArray: false, complete: true },
1006
+ // { index: 1, details: [...], length: 2, keys: [0], references: [], isArray: true, complete: true }
1007
+ // ]
1008
+ // descriptorMap[0] describes the top-level object; its 'tags' property is a reference (references: [1]) to
1009
+ // descriptorMap[1], which separately describes that nested array. descriptorMap[1]'s own `length` (2) reflects
1010
+ // the array's actual length, but `keys` has only one entry (0) since both elements share the same type
1011
+ // ('string') and are described together by a single, representative descriptorDetail.
1012
+ ```
1013
+ <a name="module_objectDescriptors.describeObjectDetail"></a>
1014
+
1015
+ ### objectDescriptors.describeObjectDetail(value, [key], [index]) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
1016
+ Trace a single property's value and produce the descriptorDetail describing it (type, nullability, whether it
1017
+ references a nested object/array, etc.) - the per-property building block used by
1018
+ [describeObject](#module_objectDescriptors.describeObject).
1019
+
1020
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1021
+
1022
+ | Param | Type | Default | Description |
1023
+ | --- | --- | --- | --- |
1024
+ | value | <code>\*</code> | | The property's value to describe. |
1025
+ | [key] | <code>string</code> \| <code>number</code> | <code>0</code> | The property name (or array index) this value belongs to. |
1026
+ | [index] | <code>number</code> | <code>0</code> | This detail's intended position within its parent descriptor's `details` array. |
1027
+
1028
+ <a name="module_objectDescriptors.describeObject"></a>
1029
+
1030
+ ### objectDescriptors.describeObject(object) ⇒ <code>module:objectDescriptors~descriptor</code>
1031
+ Trace a single object or array (not its nested objects/arrays - see
1032
+ [describeObjectMap](#module_objectDescriptors.describeObjectMap) for that) and return the descriptor which defines its own
1033
+ structure and attributes.
1034
+
1035
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1036
+
1037
+ | Param | Type | Description |
1038
+ | --- | --- | --- |
1039
+ | object | <code>Object</code> \| <code>Array</code> | The object or array to describe. |
1040
+
1041
+ <a name="module_objectDescriptors.compareDescriptor"></a>
1042
+
1043
+ ### objectDescriptors.compareDescriptor(descriptor1, descriptor2) ⇒ <code>boolean</code>
1044
+ Check if two descriptors are the same or similar, in that the smaller one's keys are all present in the larger
1045
+ one and their types line up - used to detect when a newly-described value actually matches a descriptor already
1046
+ in the map, so it can be pointed at instead of creating a duplicate.
1047
+
1048
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1049
+ **Returns**: <code>boolean</code> - True if the descriptors describe a compatible shape.
1050
+
1051
+ | Param | Type | Description |
1052
+ | --- | --- | --- |
1053
+ | descriptor1 | <code>module:objectDescriptors~descriptor</code> | The first descriptor to compare. |
1054
+ | descriptor2 | <code>module:objectDescriptors~descriptor</code> | The second descriptor to compare. |
1055
+
1056
+ <a name="module_objectDescriptors.cloneDescriptorDetail"></a>
1057
+
1058
+ ### objectDescriptors.cloneDescriptorDetail(originalDetail) <code>module:objectDescriptors~descriptorDetail</code>
1059
+ Get a new copy of an existing descriptor detail so that the original will not be mutated.
1060
+
1061
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1062
+ **Returns**: <code>module:objectDescriptors~descriptorDetail</code> - A new, independent copy.
1063
+
1064
+ | Param | Type | Description |
1065
+ | --- | --- | --- |
1066
+ | originalDetail | <code>module:objectDescriptors~descriptorDetail</code> | The detail to copy. |
1067
+
1068
+ <a name="module_objectDescriptors.cloneDescriptor"></a>
1069
+
1070
+ ### objectDescriptors.cloneDescriptor(originalMap) ⇒ <code>module:objectDescriptors~descriptor</code>
1071
+ Make a copy of an object descriptor so that the original will not be mutated.
1072
+
1073
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1074
+ **Returns**: <code>module:objectDescriptors~descriptor</code> - A new, independent copy.
1075
+
1076
+ | Param | Type | Description |
1077
+ | --- | --- | --- |
1078
+ | originalMap | <code>module:objectDescriptors~descriptor</code> | The descriptor to copy. |
1079
+
1080
+ <a name="module_objectDescriptors.checkDescriptorComplete"></a>
1081
+
1082
+ ### objectDescriptors.checkDescriptorComplete(descriptor) <code>module:objectDescriptors~descriptor</code>
1083
+ Check if every property this descriptor references (i.e. every nested object/array it points to) has actually
1084
+ had its own descriptor built yet, and set the descriptor's `complete` flag to true if so.
1085
+
1086
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1087
+ **Returns**: <code>module:objectDescriptors~descriptor</code> - The same descriptor, with `complete` updated.
1088
+
1089
+ | Param | Type | Description |
1090
+ | --- | --- | --- |
1091
+ | descriptor | <code>module:objectDescriptors~descriptor</code> | The descriptor to check. |
1092
+
1093
+ <a name="module_objectDescriptors.checkClearValues"></a>
1094
+
1095
+ ### objectDescriptors.checkClearValues(descriptor, [keepValues]) ⇒ <code>module:objectDescriptors~descriptor</code>
1096
+ Once a descriptor is complete (all its references have been resolved), its details' actual `value` arrays are no
1097
+ longer needed to build the descriptor further - clear them to save memory, unless `keepValues` says otherwise.
1098
+
1099
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1100
+ **Returns**: <code>module:objectDescriptors~descriptor</code> - The same descriptor, with `details[].value` cleared if applicable.
1101
+
1102
+ | Param | Type | Default | Description |
1103
+ | --- | --- | --- | --- |
1104
+ | descriptor | <code>module:objectDescriptors~descriptor</code> | | The descriptor to check. |
1105
+ | [keepValues] | <code>boolean</code> | <code>false</code> | Set true to keep the values even once the descriptor is complete. |
1106
+
1107
+ <a name="module_objectDescriptors.assignDescriptorDetail"></a>
1108
+
1109
+ ### objectDescriptors.assignDescriptorDetail(originalDetail, ...details) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
1110
+ Assign properties from other details onto an existing detail, widening it (e.g. combining `type`/`value` arrays,
1111
+ OR-ing boolean flags like `nullable`/`optional`) rather than overwriting it - the per-property counterpart to
1112
+ [assignDescriptor](#module_objectDescriptors.assignDescriptor).
1113
+
1114
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1115
+ **Returns**: <code>module:objectDescriptors~descriptorDetail</code> - A new detail representing the merge of all of the above.
1116
+
1117
+ | Param | Type | Description |
1118
+ | --- | --- | --- |
1119
+ | originalDetail | <code>module:objectDescriptors~descriptorDetail</code> | The base detail to merge onto (not mutated - a clone is merged and returned). |
1120
+ | ...details | <code>module:objectDescriptors~descriptorDetail</code> | One or more further details to merge in. |
1121
+
1122
+ <a name="module_objectDescriptors.assignDescriptor"></a>
1123
+
1124
+ ### objectDescriptors.assignDescriptor(originalMap, ...descriptors) ⇒ <code>module:objectDescriptors~descriptor</code>
1125
+ Apply one or more descriptors to an existing descriptor so that they represent a merged version of the descriptors.
1126
+ Used to widen a descriptor as more differently-shaped objects are described into it (e.g. array elements of
1127
+ different types), rather than replacing it outright.
1128
+
1129
+ **Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
1130
+ **Returns**: <code>module:objectDescriptors~descriptor</code> - A new descriptor representing the merge of all of the above.
1131
+
1132
+ | Param | Type | Description |
1133
+ | --- | --- | --- |
1134
+ | originalMap | <code>module:objectDescriptors~descriptor</code> | The base descriptor to merge onto (not mutated - a clone is merged and returned). |
1135
+ | ...descriptors | <code>module:objectDescriptors~descriptor</code> | One or more further descriptors to merge in. |
1136
+
1137
+ <a name="module_arrayHelpers"></a>
1138
+
1139
+ ## arrayHelpers
1140
+ Utilities for building, merging, deduplicating and comparing arrays, plus a basic FIFO queue (BasicQueue) for
1141
+ use with functionHelpers' queueManager/queueTimeout.
1142
+
1143
+ **Version**: 1.0.0
1144
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
1145
+
1146
+ * [arrayHelpers](#module_arrayHelpers)
1147
+ * [.BasicQueue](#module_arrayHelpers.BasicQueue)
1148
+ * [new BasicQueue([innerList])](#new_module_arrayHelpers.BasicQueue_new)
1149
+ * [.dequeue()](#module_arrayHelpers.BasicQueue+dequeue) ⇒ <code>queuedItem</code> \| <code>\*</code>
1150
+ * [.empty()](#module_arrayHelpers.BasicQueue+empty) ⇒ <code>boolean</code>
1151
+ * [.enqueue(data)](#module_arrayHelpers.BasicQueue+enqueue) <code>BasicQueue</code>
1152
+ * [.peek()](#module_arrayHelpers.BasicQueue+peek) <code>queuedItem</code> \| <code>\*</code>
1153
+ * [.size()](#module_arrayHelpers.BasicQueue+size) <code>number</code>
1154
+ * [.uniqueArray(array)](#module_arrayHelpers.uniqueArray) <code>Array</code>
1155
+ * [.mergeArrays(...arrays)](#module_arrayHelpers.mergeArrays) <code>Array</code>
1156
+ * [.compareArrays(...arrays)](#module_arrayHelpers.compareArrays) <code>Array.&lt;module:arrayHelpers~compareArrayResult&gt;</code>
1157
+ * [.buildArrayOfReferences(item, length)](#module_arrayHelpers.buildArrayOfReferences) <code>Array.&lt;\*&gt;</code>
1158
+ * [.buildArray(item, length)](#module_arrayHelpers.buildArray) <code>Array.&lt;\*&gt;</code>
1159
+ * [.addUniqueToArray(item, array)](#module_arrayHelpers.addUniqueToArray) <code>Array</code>
1160
+
1161
+ <a name="module_arrayHelpers.BasicQueue"></a>
1162
+
1163
+ ### arrayHelpers.BasicQueue
1164
+ Class BasicQueue is a functional example of a queue to be used with queueManager.
1165
+
1166
+ **Kind**: static class of [<code>arrayHelpers</code>](#module_arrayHelpers)
1167
+
1168
+ * [.BasicQueue](#module_arrayHelpers.BasicQueue)
1169
+ * [new BasicQueue([innerList])](#new_module_arrayHelpers.BasicQueue_new)
1170
+ * [.dequeue()](#module_arrayHelpers.BasicQueue+dequeue) <code>queuedItem</code> \| <code>\*</code>
1171
+ * [.empty()](#module_arrayHelpers.BasicQueue+empty) ⇒ <code>boolean</code>
1172
+ * [.enqueue(data)](#module_arrayHelpers.BasicQueue+enqueue) <code>BasicQueue</code>
1173
+ * [.peek()](#module_arrayHelpers.BasicQueue+peek) <code>queuedItem</code> \| <code>\*</code>
1174
+ * [.size()](#module_arrayHelpers.BasicQueue+size) ⇒ <code>number</code>
1175
+
1176
+ <a name="new_module_arrayHelpers.BasicQueue_new"></a>
1177
+
1178
+ #### new BasicQueue([innerList])
1179
+
1180
+ | Param | Type | Default | Description |
1181
+ | --- | --- | --- | --- |
1182
+ | [innerList] | <code>Array</code> | <code>[]</code> | Items to pre-populate the queue with, in order. |
1183
+
1184
+ <a name="module_arrayHelpers.BasicQueue+dequeue"></a>
1185
+
1186
+ #### basicQueue.dequeue() ⇒ <code>queuedItem</code> \| <code>\*</code>
1187
+ Remove and return the next item in the queue
1188
+
1189
+ **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1190
+ <a name="module_arrayHelpers.BasicQueue+empty"></a>
1191
+
1192
+ #### basicQueue.empty() ⇒ <code>boolean</code>
1193
+ Check if the queue is empty
1194
+
1195
+ **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1196
+ <a name="module_arrayHelpers.BasicQueue+enqueue"></a>
1197
+
1198
+ #### basicQueue.enqueue(data) ⇒ <code>BasicQueue</code>
1199
+ Add an item to the end of the queue
1200
+
1201
+ **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1202
+
1203
+ | Param | Type |
1204
+ | --- | --- |
1205
+ | data | <code>queuedItem</code> \| <code>\*</code> |
1206
+
1207
+ <a name="module_arrayHelpers.BasicQueue+peek"></a>
1208
+
1209
+ #### basicQueue.peek() ⇒ <code>queuedItem</code> \| <code>\*</code>
1210
+ Retrieve the next item from the queue
1211
+
1212
+ **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1213
+ <a name="module_arrayHelpers.BasicQueue+size"></a>
1214
+
1215
+ #### basicQueue.size() <code>number</code>
1216
+ Get the quantity of items in the queue
1217
+
1218
+ **Kind**: instance method of [<code>BasicQueue</code>](#module_arrayHelpers.BasicQueue)
1219
+ <a name="module_arrayHelpers.uniqueArray"></a>
1220
+
1221
+ ### arrayHelpers.uniqueArray(array) <code>Array</code>
1222
+ Remove duplicate values from an array. uniqueArray
1223
+
1224
+ **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1225
+
1226
+ | Param | Type | Description |
1227
+ | --- | --- | --- |
1228
+ | array | <code>Array</code> | The array to make unique |
1229
+
1230
+ <a name="module_arrayHelpers.mergeArrays"></a>
1231
+
1232
+ ### arrayHelpers.mergeArrays(...arrays) <code>Array</code>
1233
+ Take multiple arrays and then filter all these into one unique array.
1234
+
1235
+ **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1236
+
1237
+ | Param | Type | Description |
1238
+ | --- | --- | --- |
1239
+ | ...arrays | <code>Array</code> | Provide multiple arrays to create one unique array |
1240
+
1241
+ <a name="module_arrayHelpers.compareArrays"></a>
1242
+
1243
+ ### arrayHelpers.compareArrays(...arrays) ⇒ <code>Array.&lt;module:arrayHelpers~compareArrayResult&gt;</code>
1244
+ Compare two Arrays and return the Object where the value for each property is as follows:
1245
+ -1 to indicate val1 is less than val2
1246
+ 0 to indicate both values are the equal
1247
+ 1 to indicate val1 is greater than val2
1248
+ The returned Object uses the element values as the property names
1249
+ This functions works by first creating a concatenated array of all unique values. Then for each unique values,
1250
+ convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
1251
+ Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
1252
+ 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
1253
+ or more.
1254
+
1255
+ **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1256
+
1257
+ | Param | Type | Description |
1258
+ | --- | --- | --- |
1259
+ | ...arrays | <code>Array</code> | The arrays to compare |
1260
+
1261
+ **Example**
1262
+ ```js
1263
+ // example of input and resulting output
1264
+ compareArrays(
1265
+ ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
1266
+ ['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
1267
+ )
1268
+ // unique array
1269
+ ['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
1270
+ // result object
1271
+ [
1272
+ {
1273
+ value: 'match1',
1274
+ keys: [[0], [0]],
1275
+ result: [0, 0]
1276
+ },
1277
+ {
1278
+ value: 'firstMismatch1',
1279
+ keys: [[1], []],
1280
+ result: [1, -1]
1281
+ },
1282
+ {
1283
+ value: 'match2',
1284
+ keys: [[2], [1]],
1285
+ result: [0, 0]
1286
+ },
1287
+ {
1288
+ value: 'firstMismatch2',
1289
+ keys: [[3], []],
1290
+ result: [1, -1]
1291
+ },
1292
+ {
1293
+ value: 'badMatch1',
1294
+ keys: [[4], [3, 4]],
1295
+ result: [0, 0]
1296
+ },
1297
+ {
1298
+ value: 'secondMismatch1',
1299
+ keys: [[], [2]],
1300
+ result: [-1, 1]
1301
+ }
1302
+ ]
1303
+ ```
1304
+ <a name="module_arrayHelpers.buildArrayOfReferences"></a>
1305
+
1306
+ ### arrayHelpers.buildArrayOfReferences(item, length) ⇒ <code>Array.&lt;\*&gt;</code>
1307
+ Leverage buildArrayBase to generate an array filled with references to the provided item.
1308
+ The length defines how long the array should be.
1309
+
1310
+ **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1311
+
1312
+ | Param | Type | Description |
1313
+ | --- | --- | --- |
1314
+ | item | <code>\*</code> | The item to be used for each array element |
1315
+ | length | <code>number</code> | The desired length of the array |
1316
+
1317
+ <a name="module_arrayHelpers.buildArray"></a>
1318
+
1319
+ ### arrayHelpers.buildArray(item, length) ⇒ <code>Array.&lt;\*&gt;</code>
1320
+ Leverage buildArrayBase to generate an array filled with a copy of the provided item.
1321
+ The length defines how long the array should be.
1322
+
1323
+ **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1324
+
1325
+ | Param | Type | Description |
1326
+ | --- | --- | --- |
1327
+ | item | <code>\*</code> | The item to be used for each array element |
1328
+ | length | <code>number</code> | The desired length of the array |
1329
+
1330
+ <a name="module_arrayHelpers.addUniqueToArray"></a>
1331
+
1332
+ ### arrayHelpers.addUniqueToArray(item, array) ⇒ <code>Array</code>
1333
+ Having an array and a potential new array element, check if the element is in the array, if not append to array.
1334
+
1335
+ **Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
1336
+
1337
+ | Param | Type | Description |
1338
+ | --- | --- | --- |
1339
+ | item | <code>\*</code> | An potential array element, possibly a DomItem |
1340
+ | array | <code>Array</code> | An array where an element may be appended. |
1341
+