si-funciona 1.1.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +234 -327
- package/browser/siFunciona.js +2343 -1835
- package/browser/siFunciona.min.js +1 -1
- package/dist/helpers/arrays/addUniqueToArray.js +7 -7
- package/dist/helpers/arrays/buildArray.js +8 -8
- package/dist/helpers/arrays/buildArrayOfReferences.js +8 -8
- package/dist/helpers/arrays/compareArrays.js +57 -88
- package/dist/helpers/arrays/mergeArrays.js +6 -6
- package/dist/helpers/arrays/uniqueArray.js +6 -6
- package/dist/helpers/arrays.js +13 -13
- package/dist/helpers/arrays.min.js +1 -1
- package/dist/helpers/descriptors/assignDescriptor.js +9 -9
- package/dist/helpers/descriptors/assignDescriptor.min.js +1 -1
- package/dist/helpers/descriptors/assignDescriptorDetail.js +7 -7
- package/dist/helpers/descriptors/checkClearValues.js +7 -7
- package/dist/helpers/descriptors/checkDescriptorComplete.js +6 -6
- package/dist/helpers/descriptors/cloneDescriptor.js +13 -6
- package/dist/helpers/descriptors/cloneDescriptorDetail.js +7 -6
- package/dist/helpers/descriptors/compareDescriptor.js +7 -7
- package/dist/helpers/descriptors/describeObject.js +7 -6
- package/dist/helpers/descriptors/describeObjectDetail.js +8 -8
- package/dist/helpers/descriptors/describeObjectMap.js +13 -14
- package/dist/helpers/descriptors/describeObjectMap.min.js +1 -1
- package/dist/helpers/descriptors/nextReference.js +7 -7
- package/dist/helpers/descriptors/sameDescriptor.js +7 -7
- package/dist/helpers/descriptors/samples/descriptor.js +3 -14
- package/dist/helpers/descriptors/samples/descriptorDetail.js +3 -19
- package/dist/helpers/descriptors/samples/descriptorMap.js +3 -7
- package/dist/helpers/descriptors/samples/mappedDescriptorMap.js +3 -3
- package/dist/helpers/descriptors.js +19 -19
- package/dist/helpers/descriptors.min.js +1 -1
- package/dist/helpers/functions/callWithParams.js +8 -8
- package/dist/helpers/functions/curry.js +8 -8
- package/dist/helpers/functions/delay.js +6 -13
- package/dist/helpers/functions/onBodyLoad.js +36 -10
- package/dist/helpers/functions/onBodyLoad.min.js +1 -1
- package/dist/helpers/functions/pipe.js +7 -7
- package/dist/helpers/functions/preloadParams.js +9 -16
- package/dist/helpers/functions/queueManager.js +6 -14
- package/dist/helpers/functions/queueTimeout.js +6 -15
- package/dist/helpers/functions/relevancyFilter.js +0 -12
- package/dist/helpers/functions/trace.js +7 -7
- package/dist/helpers/functions.js +17 -17
- package/dist/helpers/functions.min.js +1 -1
- package/dist/helpers/numbers/absoluteMax.js +7 -7
- package/dist/helpers/numbers/absoluteMin.js +7 -7
- package/dist/helpers/numbers/compare.js +10 -10
- package/dist/helpers/numbers/randomInteger.js +10 -10
- package/dist/helpers/numbers/randomNumber.js +10 -10
- package/dist/helpers/numbers.js +12 -12
- package/dist/helpers/numbers.min.js +1 -1
- package/dist/helpers/objects/cloneObject.js +12 -12
- package/dist/helpers/objects/dotGet.js +8 -2
- package/dist/helpers/objects/dotGet.min.js +1 -1
- package/dist/helpers/objects/dotNotate.js +6 -16
- package/dist/helpers/objects/dotNotate.min.js +1 -1
- package/dist/helpers/objects/dotSet.js +8 -2
- package/dist/helpers/objects/dotSet.min.js +1 -1
- package/dist/helpers/objects/dotUnset.js +8 -2
- package/dist/helpers/objects/emptyObject.js +6 -6
- package/dist/helpers/objects/filterObject.js +10 -20
- package/dist/helpers/objects/isCloneable.js +6 -6
- package/dist/helpers/objects/isInstanceObject.js +6 -6
- package/dist/helpers/objects/isObject.js +6 -6
- package/dist/helpers/objects/mapObject.js +10 -19
- package/dist/helpers/objects/mergeObjects.js +7 -7
- package/dist/helpers/objects/mergeObjectsBase.js +18 -25
- package/dist/helpers/objects/mergeObjectsBase.min.js +1 -1
- package/dist/helpers/objects/mergeObjectsMutable.js +7 -7
- package/dist/helpers/objects/objectKeys.js +8 -8
- package/dist/helpers/objects/objectValues.js +8 -8
- package/dist/helpers/objects/reduceObject.js +12 -24
- package/dist/helpers/objects/setAndReturnValue.js +8 -8
- package/dist/helpers/objects/setValue.js +10 -9
- package/dist/helpers/objects.js +26 -26
- package/dist/helpers/objects.min.js +1 -1
- package/dist/helpers/strings/camelCase.js +8 -8
- package/dist/helpers/strings/camelCase.min.js +1 -1
- package/dist/helpers/strings/kabobCase.js +7 -7
- package/dist/helpers/strings/kabobCase.min.js +1 -1
- package/dist/helpers/strings/snakeCase.js +7 -7
- package/dist/helpers/strings/snakeCase.min.js +1 -1
- package/dist/helpers/strings/strAfter.js +8 -0
- package/dist/helpers/strings/strAfterLast.js +8 -0
- package/dist/helpers/strings/strBefore.js +8 -0
- package/dist/helpers/strings/strBeforeLast.js +8 -0
- package/dist/helpers/strings/titleCase.js +8 -8
- package/dist/helpers/strings/titleCase.min.js +1 -1
- package/dist/helpers/strings/ucFirst.js +6 -6
- package/dist/helpers/strings/words.js +6 -6
- package/dist/helpers/strings.js +17 -17
- package/dist/helpers/strings.min.js +1 -1
- package/dist/main.js +19 -14
- package/dist/main.min.js +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<dl>
|
|
8
8
|
<dt><a href="#module_siFunciona">siFunciona</a></dt>
|
|
9
|
-
<dd><p>All
|
|
9
|
+
<dd><p>All the siFunciona system functions for stringing together functions and simplifying logic.</p>
|
|
10
10
|
</dd>
|
|
11
11
|
<dt><a href="#module_stringHelpers">stringHelpers</a></dt>
|
|
12
12
|
<dd><p>Manage how strings are manipulated with these utilities.</p>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<a name="module_siFunciona"></a>
|
|
32
32
|
|
|
33
33
|
## siFunciona
|
|
34
|
-
All
|
|
34
|
+
All the siFunciona system functions for stringing together functions and simplifying logic.
|
|
35
35
|
|
|
36
36
|
**Version**: 1.0.0
|
|
37
37
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
@@ -47,6 +47,10 @@ Manage how strings are manipulated with these utilities.
|
|
|
47
47
|
* [.words(str)](#module_stringHelpers.words) ⇒ <code>array</code>
|
|
48
48
|
* [.ucFirst(str)](#module_stringHelpers.ucFirst) ⇒ <code>string</code>
|
|
49
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>
|
|
50
54
|
* [.snakeCase(str)](#module_stringHelpers.snakeCase) ⇒ <code>string</code>
|
|
51
55
|
* [.kabobCase(str)](#module_stringHelpers.kabobCase) ⇒ <code>string</code>
|
|
52
56
|
* [.camelCase(str)](#module_stringHelpers.camelCase) ⇒ <code>string</code>
|
|
@@ -84,6 +88,54 @@ Given a string in kebab-case, snake_case, camelCase or 'Sentence case', convert
|
|
|
84
88
|
| --- | --- |
|
|
85
89
|
| str | <code>string</code> |
|
|
86
90
|
|
|
91
|
+
<a name="module_stringHelpers.strBeforeLast"></a>
|
|
92
|
+
|
|
93
|
+
### stringHelpers.strBeforeLast(str, search) ⇒ <code>string</code>
|
|
94
|
+
Retrieve the string part after the last search match.
|
|
95
|
+
|
|
96
|
+
**Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
|
|
97
|
+
|
|
98
|
+
| Param | Type |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| str | <code>string</code> |
|
|
101
|
+
| search | <code>string</code> |
|
|
102
|
+
|
|
103
|
+
<a name="module_stringHelpers.strBefore"></a>
|
|
104
|
+
|
|
105
|
+
### stringHelpers.strBefore(str, search) ⇒ <code>string</code>
|
|
106
|
+
Retrieve the string part before the search match.
|
|
107
|
+
|
|
108
|
+
**Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
|
|
109
|
+
|
|
110
|
+
| Param | Type |
|
|
111
|
+
| --- | --- |
|
|
112
|
+
| str | <code>string</code> |
|
|
113
|
+
| search | <code>string</code> |
|
|
114
|
+
|
|
115
|
+
<a name="module_stringHelpers.strAfterLast"></a>
|
|
116
|
+
|
|
117
|
+
### stringHelpers.strAfterLast(str, search) ⇒ <code>string</code>
|
|
118
|
+
Retrieve the string part after the last search match.
|
|
119
|
+
|
|
120
|
+
**Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
|
|
121
|
+
|
|
122
|
+
| Param | Type |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| str | <code>string</code> |
|
|
125
|
+
| search | <code>string</code> |
|
|
126
|
+
|
|
127
|
+
<a name="module_stringHelpers.strAfter"></a>
|
|
128
|
+
|
|
129
|
+
### stringHelpers.strAfter(str, search) ⇒ <code>string</code>
|
|
130
|
+
Retrieve the string part after the search match.
|
|
131
|
+
|
|
132
|
+
**Kind**: static method of [<code>stringHelpers</code>](#module_stringHelpers)
|
|
133
|
+
|
|
134
|
+
| Param | Type |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| str | <code>string</code> |
|
|
137
|
+
| search | <code>string</code> |
|
|
138
|
+
|
|
87
139
|
<a name="module_stringHelpers.snakeCase"></a>
|
|
88
140
|
|
|
89
141
|
### stringHelpers.snakeCase(str) ⇒ <code>string</code>
|
|
@@ -129,11 +181,11 @@ Simplify working with object by providing array-like parsing. Also, provides clo
|
|
|
129
181
|
* _static_
|
|
130
182
|
* [.setValue(key, value, item)](#module_objectHelpers.setValue) ⇒ <code>Object</code> \| <code>Array</code>
|
|
131
183
|
* [.setAndReturnValue(item, key, value)](#module_objectHelpers.setAndReturnValue) ⇒ <code>\*</code>
|
|
132
|
-
* [.reduceObject(obj, fn, [initialValue])](#module_objectHelpers.reduceObject) ⇒ <code
|
|
184
|
+
* [.reduceObject(obj, fn, [initialValue])](#module_objectHelpers.reduceObject) ⇒ <code>\*</code>
|
|
133
185
|
* [.objectValues(object, [includeInherited])](#module_objectHelpers.objectValues) ⇒ <code>Array</code>
|
|
134
186
|
* [.objectKeys(object, [includeInherited])](#module_objectHelpers.objectKeys) ⇒ <code>Array.<(string\|number)></code>
|
|
135
187
|
* [.mergeObjectsMutable(...objects)](#module_objectHelpers.mergeObjectsMutable) ⇒ <code>\*</code>
|
|
136
|
-
* [.mergeObjectsBase([options])](#module_objectHelpers.mergeObjectsBase) ⇒
|
|
188
|
+
* [.mergeObjectsBase([options])](#module_objectHelpers.mergeObjectsBase) ⇒ <code>module:objectHelpers~mergeObjectsCallback</code> \| <code>mergeObjectsCallback</code>
|
|
137
189
|
* [.mergeObjects(...objects)](#module_objectHelpers.mergeObjects) ⇒ <code>\*</code>
|
|
138
190
|
* [.mapObject(obj, fn, [thisArg])](#module_objectHelpers.mapObject) ⇒ <code>Object</code> \| <code>Array</code>
|
|
139
191
|
* [.isObject(object)](#module_objectHelpers.isObject) ⇒ <code>boolean</code>
|
|
@@ -146,20 +198,15 @@ Simplify working with object by providing array-like parsing. Also, provides clo
|
|
|
146
198
|
* [.dotNotate(arrayObject, [retainObjects])](#module_objectHelpers.dotNotate) ⇒ <code>DotNotatedObject</code>
|
|
147
199
|
* [.dotGet(arrayObject, dotNotation, [defaultValue])](#module_objectHelpers.dotGet) ⇒ <code>\*</code>
|
|
148
200
|
* [.cloneObject(object, [options])](#module_objectHelpers.cloneObject) ⇒ <code>Object</code>
|
|
149
|
-
* [.DotNotationString](#module_objectHelpers.DotNotationString) : <code>string</code>
|
|
150
|
-
* [.DotNotatedObject](#module_objectHelpers.DotNotatedObject) : <code>Object.<DotNotationString, \*></code>
|
|
151
201
|
* _inner_
|
|
152
202
|
* [~handleRetainObjects([retainObjects])](#module_objectHelpers..handleRetainObjects) ⇒ <code>function</code>
|
|
153
203
|
* [~performDotNotate(arrayObject, didRetain, [prepend], [results])](#module_objectHelpers..performDotNotate) ⇒ <code>DotNotatedObject</code>
|
|
154
|
-
* [~reduceCallback](#module_objectHelpers..reduceCallback) ⇒ <code>\*</code>
|
|
155
|
-
* [~mergeObjectsCallback](#module_objectHelpers..mergeObjectsCallback) ⇒ <code>\*</code>
|
|
156
|
-
* [~mapCallback](#module_objectHelpers..mapCallback) ⇒ <code>\*</code>
|
|
157
|
-
* [~filterCallback](#module_objectHelpers..filterCallback) ⇒ <code>boolean</code>
|
|
158
204
|
|
|
159
205
|
<a name="module_objectHelpers.setValue"></a>
|
|
160
206
|
|
|
161
207
|
### objectHelpers.setValue(key, value, item) ⇒ <code>Object</code> \| <code>Array</code>
|
|
162
|
-
Set a value on an item, then return the item.
|
|
208
|
+
Set a value on an item, then return the item.
|
|
209
|
+
NOTE: Argument order designed for usage with pipe
|
|
163
210
|
|
|
164
211
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
165
212
|
|
|
@@ -184,21 +231,24 @@ Set a value on an item, then return the value
|
|
|
184
231
|
|
|
185
232
|
<a name="module_objectHelpers.reduceObject"></a>
|
|
186
233
|
|
|
187
|
-
### objectHelpers.reduceObject(obj, fn, [initialValue]) ⇒ <code
|
|
188
|
-
This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
|
|
234
|
+
### objectHelpers.reduceObject(obj, fn, [initialValue]) ⇒ <code>\*</code>
|
|
235
|
+
This function is intended to replicate behaviour of the Array.reduce() function but for Objects.
|
|
236
|
+
If an array is passed in instead then it will perform standard reduce(). It is recommended to
|
|
237
|
+
always use the standard reduce() function when it is known that the object is actually an array.
|
|
189
238
|
|
|
190
239
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
191
240
|
|
|
192
241
|
| Param | Type | Description |
|
|
193
242
|
| --- | --- | --- |
|
|
194
243
|
| obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be filtered |
|
|
195
|
-
| fn |
|
|
244
|
+
| fn | <code>module:objectHelpers~reduceCallback</code> \| <code>function</code> \| <code>reduceCallback</code> | The function to be processed for each filtered property |
|
|
196
245
|
| [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. |
|
|
197
246
|
|
|
198
247
|
<a name="module_objectHelpers.objectValues"></a>
|
|
199
248
|
|
|
200
249
|
### objectHelpers.objectValues(object, [includeInherited]) ⇒ <code>Array</code>
|
|
201
|
-
Get an array of values from any object or array. Will return empty array when invalid or there are no values.
|
|
250
|
+
Get an array of values from any object or array. Will return empty array when invalid or there are no values.
|
|
251
|
+
Optional flag will include the inherited values from prototype chain when set.
|
|
202
252
|
|
|
203
253
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
204
254
|
|
|
@@ -210,7 +260,8 @@ Get an array of values from any object or array. Will return empty array when in
|
|
|
210
260
|
<a name="module_objectHelpers.objectKeys"></a>
|
|
211
261
|
|
|
212
262
|
### objectHelpers.objectKeys(object, [includeInherited]) ⇒ <code>Array.<(string\|number)></code>
|
|
213
|
-
Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
|
|
263
|
+
Get an array of keys from any object or array. Will return empty array when invalid or there are no keys.
|
|
264
|
+
Optional flag will include the inherited keys from prototype chain when set.
|
|
214
265
|
|
|
215
266
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
216
267
|
|
|
@@ -225,7 +276,7 @@ Get an array of keys from any object or array. Will return empty array when inva
|
|
|
225
276
|
Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
|
|
226
277
|
|
|
227
278
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
228
|
-
**See**: [mergeObjectsCallback](
|
|
279
|
+
**See**: [module:objectHelpers~mergeObjectsCallback](module:objectHelpers~mergeObjectsCallback)
|
|
229
280
|
|
|
230
281
|
| Param | Type | Description |
|
|
231
282
|
| --- | --- | --- |
|
|
@@ -233,8 +284,11 @@ Uses mergeObjectsBase deep merge objects and arrays, merge by reference.
|
|
|
233
284
|
|
|
234
285
|
<a name="module_objectHelpers.mergeObjectsBase"></a>
|
|
235
286
|
|
|
236
|
-
### objectHelpers.mergeObjectsBase([options]) ⇒
|
|
237
|
-
Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
|
|
287
|
+
### objectHelpers.mergeObjectsBase([options]) ⇒ <code>module:objectHelpers~mergeObjectsCallback</code> \| <code>mergeObjectsCallback</code>
|
|
288
|
+
Perform a deep merge of objects. This will return a function that will combine all objects and sub-objects.
|
|
289
|
+
Objects having the same attributes will overwrite from last object to first.
|
|
290
|
+
NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
|
|
291
|
+
have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
|
|
238
292
|
|
|
239
293
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
240
294
|
|
|
@@ -253,7 +307,7 @@ Perform a deep merge of objects. This will return a function that will combine a
|
|
|
253
307
|
Uses mergeObjectsBase deep merge objects and arrays, merge by value.
|
|
254
308
|
|
|
255
309
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
256
|
-
**See**: [mergeObjectsCallback](
|
|
310
|
+
**See**: [module:objectHelpers~mergeObjectsCallback](module:objectHelpers~mergeObjectsCallback)
|
|
257
311
|
|
|
258
312
|
| Param | Type | Description |
|
|
259
313
|
| --- | --- | --- |
|
|
@@ -262,14 +316,16 @@ Uses mergeObjectsBase deep merge objects and arrays, merge by value.
|
|
|
262
316
|
<a name="module_objectHelpers.mapObject"></a>
|
|
263
317
|
|
|
264
318
|
### objectHelpers.mapObject(obj, fn, [thisArg]) ⇒ <code>Object</code> \| <code>Array</code>
|
|
265
|
-
This function is intended to replicate behaviour of the Array.map() function but for Objects.
|
|
319
|
+
This function is intended to replicate behaviour of the Array.map() function but for Objects.
|
|
320
|
+
If an array is passed in instead then it will perform standard map(). It is recommended to
|
|
321
|
+
always use the standard map() function when it is known that the object is actually an array.
|
|
266
322
|
|
|
267
323
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
268
324
|
|
|
269
325
|
| Param | Type | Description |
|
|
270
326
|
| --- | --- | --- |
|
|
271
327
|
| obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be mapped |
|
|
272
|
-
| fn |
|
|
328
|
+
| fn | <code>module:objectHelpers~mapCallback</code> \| <code>function</code> | The function to be processed for each mapped property |
|
|
273
329
|
| [thisArg] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as this when executing callback. |
|
|
274
330
|
|
|
275
331
|
<a name="module_objectHelpers.isObject"></a>
|
|
@@ -308,14 +364,16 @@ Determine if the value is a reference instance
|
|
|
308
364
|
<a name="module_objectHelpers.filterObject"></a>
|
|
309
365
|
|
|
310
366
|
### objectHelpers.filterObject(obj, fn, [thisArg]) ⇒ <code>Object</code> \| <code>Array</code>
|
|
311
|
-
This function is intended to replicate behaviour of the Array.filter() function but for Objects.
|
|
367
|
+
This function is intended to replicate behaviour of the Array.filter() function but for Objects.
|
|
368
|
+
If an array is passed in instead then it will perform standard filter(). It is recommended to
|
|
369
|
+
always use the standard filter() function when it is known that the object is actually an array.
|
|
312
370
|
|
|
313
371
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
314
372
|
|
|
315
373
|
| Param | Type | Description |
|
|
316
374
|
| --- | --- | --- |
|
|
317
375
|
| obj | <code>Object</code> \| <code>Array</code> | The Object (or Array) to be filtered |
|
|
318
|
-
| fn |
|
|
376
|
+
| fn | <code>module:objectHelpers~filterCallback</code> \| <code>function</code> | The function to be processed for each filtered property |
|
|
319
377
|
| [thisArg] | <code>Object</code> \| <code>Array</code> | Optional. Value to use as this when executing callback. |
|
|
320
378
|
|
|
321
379
|
<a name="module_objectHelpers.emptyObject"></a>
|
|
@@ -350,11 +408,11 @@ Set a nested property value an object.
|
|
|
350
408
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
351
409
|
**Returns**: <code>Object</code> - The modified object
|
|
352
410
|
|
|
353
|
-
| Param | Type |
|
|
354
|
-
| --- | --- | --- |
|
|
355
|
-
| arrayObject | <code>Object</code> |
|
|
356
|
-
| dotNotation | <code>string</code> |
|
|
357
|
-
| value | <code>\*</code> |
|
|
411
|
+
| Param | Type | Description |
|
|
412
|
+
| --- | --- | --- |
|
|
413
|
+
| arrayObject | <code>Object</code> | The array or object to set the property on |
|
|
414
|
+
| dotNotation | <code>string</code> | The path for the property |
|
|
415
|
+
| value | <code>\*</code> | The default value to return if the property is not found |
|
|
358
416
|
|
|
359
417
|
<a name="module_objectHelpers.dotNotate"></a>
|
|
360
418
|
|
|
@@ -386,7 +444,9 @@ Get a nested property value from an object.
|
|
|
386
444
|
<a name="module_objectHelpers.cloneObject"></a>
|
|
387
445
|
|
|
388
446
|
### objectHelpers.cloneObject(object, [options]) ⇒ <code>Object</code>
|
|
389
|
-
Clone objects for manipulation without data corruption, returns a copy of the provided object.
|
|
447
|
+
Clone objects for manipulation without data corruption, returns a copy of the provided object.
|
|
448
|
+
NOTE: Use the mapLimit and relevancyRange to resolve "too much recursion" when the object is large and is known to
|
|
449
|
+
have circular references. A high mapLimit may lead to heavy memory usage and slow performance.
|
|
390
450
|
|
|
391
451
|
**Kind**: static method of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
392
452
|
|
|
@@ -398,22 +458,6 @@ Clone objects for manipulation without data corruption, returns a copy of the pr
|
|
|
398
458
|
| [options.depthLimit] | <code>number</code> | <code>-1</code> | Control how many nested levels deep will be used, -1 = no limit, >-1 = nth level limited. |
|
|
399
459
|
| [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. |
|
|
400
460
|
|
|
401
|
-
<a name="module_objectHelpers.DotNotationString"></a>
|
|
402
|
-
|
|
403
|
-
### objectHelpers.DotNotationString : <code>string</code>
|
|
404
|
-
A string representing the full-path to a property in an object. Each depth of the path is separated by a period.
|
|
405
|
-
|
|
406
|
-
**Kind**: static typedef of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
407
|
-
**Example**
|
|
408
|
-
```js
|
|
409
|
-
'a.b.c'
|
|
410
|
-
```
|
|
411
|
-
<a name="module_objectHelpers.DotNotatedObject"></a>
|
|
412
|
-
|
|
413
|
-
### objectHelpers.DotNotatedObject : <code>Object.<DotNotationString, \*></code>
|
|
414
|
-
An array or object where all properties have been flatted and keyed by a dot-notated string.
|
|
415
|
-
|
|
416
|
-
**Kind**: static typedef of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
417
461
|
<a name="module_objectHelpers..handleRetainObjects"></a>
|
|
418
462
|
|
|
419
463
|
### objectHelpers~handleRetainObjects([retainObjects]) ⇒ <code>function</code>
|
|
@@ -441,57 +485,6 @@ The underlying logic function for converting arrays to dot-notation.
|
|
|
441
485
|
| [prepend] | <code>DotNotationString</code> | <code>''</code> | The path for the property being processed |
|
|
442
486
|
| [results] | <code>DotNotatedObject</code> | <code>{}</code> | The final array to return |
|
|
443
487
|
|
|
444
|
-
<a name="module_objectHelpers..reduceCallback"></a>
|
|
445
|
-
|
|
446
|
-
### objectHelpers~reduceCallback ⇒ <code>\*</code>
|
|
447
|
-
Function to execute on each property in the object, taking four arguments
|
|
448
|
-
|
|
449
|
-
**Kind**: inner typedef of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
450
|
-
|
|
451
|
-
| Param | Type | Default | Description |
|
|
452
|
-
| --- | --- | --- | --- |
|
|
453
|
-
| [accumulator] | <code>\*</code> | <code>{}</code> | The accumulator accumulates the callback's return values; it is the accumulated value previously returned in the last invocation of the callback, or initialValue, if supplied (see below). |
|
|
454
|
-
| [currentProperty] | <code>\*</code> | <code>{}</code> | The current property being processed in the object. |
|
|
455
|
-
| [currentIndex] | <code>string</code> | <code>0</code> | The index of the current element being processed in the array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise. |
|
|
456
|
-
| [object] | <code>Object</code> \| <code>Array</code> | <code>{}</code> | The object reduce was called upon. |
|
|
457
|
-
|
|
458
|
-
<a name="module_objectHelpers..mergeObjectsCallback"></a>
|
|
459
|
-
|
|
460
|
-
### objectHelpers~mergeObjectsCallback ⇒ <code>\*</code>
|
|
461
|
-
Function that takes one or more objects and combines them into one.
|
|
462
|
-
|
|
463
|
-
**Kind**: inner typedef of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
464
|
-
|
|
465
|
-
| Param | Type | Description |
|
|
466
|
-
| --- | --- | --- |
|
|
467
|
-
| ...objects | <code>Object</code> | Provide a list of objects which will be merged starting from the end up into the first |
|
|
468
|
-
|
|
469
|
-
<a name="module_objectHelpers..mapCallback"></a>
|
|
470
|
-
|
|
471
|
-
### objectHelpers~mapCallback ⇒ <code>\*</code>
|
|
472
|
-
Function that produces a property of the new Object, taking three arguments
|
|
473
|
-
|
|
474
|
-
**Kind**: inner typedef of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
475
|
-
|
|
476
|
-
| Param | Type | Description |
|
|
477
|
-
| --- | --- | --- |
|
|
478
|
-
| currentProperty | <code>\*</code> | The current property being processed in the object. |
|
|
479
|
-
| [currentIndex] | <code>string</code> | The property name of the current property being processed in the object. |
|
|
480
|
-
| [object] | <code>Object</code> \| <code>Array</code> | The object map was called upon. |
|
|
481
|
-
|
|
482
|
-
<a name="module_objectHelpers..filterCallback"></a>
|
|
483
|
-
|
|
484
|
-
### objectHelpers~filterCallback ⇒ <code>boolean</code>
|
|
485
|
-
Function is a predicate, to test each property value of the object. Return true to keep the element, false
|
|
486
|
-
|
|
487
|
-
**Kind**: inner typedef of [<code>objectHelpers</code>](#module_objectHelpers)
|
|
488
|
-
|
|
489
|
-
| Param | Type | Description |
|
|
490
|
-
| --- | --- | --- |
|
|
491
|
-
| currentProperty | <code>\*</code> | The current property being processed in the object. |
|
|
492
|
-
| [currentIndex] | <code>string</code> | The property name of the current property being processed in the object. |
|
|
493
|
-
| [object] | <code>Object</code> \| <code>Array</code> | The object filter was called upon. |
|
|
494
|
-
|
|
495
488
|
<a name="module_numberHelpers"></a>
|
|
496
489
|
|
|
497
490
|
## numberHelpers
|
|
@@ -510,7 +503,8 @@ Some number comparators and random number generators.
|
|
|
510
503
|
<a name="module_numberHelpers.randomNumber"></a>
|
|
511
504
|
|
|
512
505
|
### numberHelpers.randomNumber(range, [offset], [interval]) ⇒ <code>number</code>
|
|
513
|
-
Create a single random number within provided range. And with optional offset,
|
|
506
|
+
Create a single random number within provided range. And with optional offset,
|
|
507
|
+
The distance between the result numbers can be adjusted with interval.
|
|
514
508
|
|
|
515
509
|
**Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
|
|
516
510
|
|
|
@@ -523,7 +517,8 @@ Create a single random number within provided range. And with optional offset,
|
|
|
523
517
|
<a name="module_numberHelpers.randomInteger"></a>
|
|
524
518
|
|
|
525
519
|
### numberHelpers.randomInteger(range, [offset], [interval]) ⇒ <code>number</code>
|
|
526
|
-
Create a single random integer within provide range. And with optional offset,
|
|
520
|
+
Create a single random integer within provide range. And with optional offset,
|
|
521
|
+
The distance between the result numbers can be adjusted with interval.
|
|
527
522
|
|
|
528
523
|
**Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
|
|
529
524
|
|
|
@@ -536,7 +531,10 @@ Create a single random integer within provide range. And with optional offset,
|
|
|
536
531
|
<a name="module_numberHelpers.compare"></a>
|
|
537
532
|
|
|
538
533
|
### numberHelpers.compare(val1, val2) ⇒ <code>number</code>
|
|
539
|
-
Compare two numbers and return:
|
|
540
|
-
1 to indicate val1 is less than val2
|
|
534
|
+
Compare two numbers and return:
|
|
535
|
+
-1 to indicate val1 is less than val2
|
|
536
|
+
0 to indicate both values are the equal
|
|
537
|
+
1 to indicate val1 is greater than val2
|
|
541
538
|
|
|
542
539
|
**Kind**: static method of [<code>numberHelpers</code>](#module_numberHelpers)
|
|
543
540
|
|
|
@@ -578,36 +576,28 @@ Manage how functions are called with these utilities.
|
|
|
578
576
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
579
577
|
|
|
580
578
|
* [functionHelpers](#module_functionHelpers)
|
|
581
|
-
*
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
* [.callWithParams(fn, params, [minimum])](#module_functionHelpers.callWithParams) ⇒ <code>\*</code>
|
|
592
|
-
* [.relevanceObject](#module_functionHelpers.relevanceObject) : <code>Object</code>
|
|
593
|
-
* [.relevanceMap](#module_functionHelpers.relevanceMap) : <code>Array.<relevanceObject></code>
|
|
594
|
-
* _inner_
|
|
595
|
-
* [~queueTimeoutHandle](#module_functionHelpers..queueTimeoutHandle) ⇒ <code>Promise</code>
|
|
596
|
-
* [~queueManagerHandle](#module_functionHelpers..queueManagerHandle) ⇒ <code>Promise</code>
|
|
597
|
-
* [~callWithMissing](#module_functionHelpers..callWithMissing) ⇒ <code>\*</code>
|
|
598
|
-
* [~delayHandler](#module_functionHelpers..delayHandler) : <code>Object</code>
|
|
579
|
+
* [.trace(label, useClone)](#module_functionHelpers.trace) ⇒ <code>function</code>
|
|
580
|
+
* [.relevancyFilter(map, [options])](#module_functionHelpers.relevancyFilter) ⇒ <code>relevanceMap</code>
|
|
581
|
+
* [.queueTimeout([queueManagerHandle])](#module_functionHelpers.queueTimeout) ⇒ <code>module:functionHelpers~queueTimeoutHandle</code>
|
|
582
|
+
* [.queueManager([queue])](#module_functionHelpers.queueManager) ⇒ <code>module:functionHelpers~queueManagerHandle</code>
|
|
583
|
+
* [.preloadParams(fn, params, [unassignedParam])](#module_functionHelpers.preloadParams) ⇒ <code>module:functionHelpers~callWithMissing</code>
|
|
584
|
+
* [.pipe(...fns)](#module_functionHelpers.pipe) ⇒ <code>\*</code>
|
|
585
|
+
* [.onBodyLoad(callback, [reset])](#module_functionHelpers.onBodyLoad) ⇒ <code>Array.<function()></code>
|
|
586
|
+
* [.delay(time)](#module_functionHelpers.delay) ⇒ <code>module:functionHelpers~delayHandler</code>
|
|
587
|
+
* [.curry(fn)](#module_functionHelpers.curry) ⇒ <code>function</code> \| <code>\*</code>
|
|
588
|
+
* [.callWithParams(fn, params, [minimum])](#module_functionHelpers.callWithParams) ⇒ <code>\*</code>
|
|
599
589
|
|
|
600
590
|
<a name="module_functionHelpers.trace"></a>
|
|
601
591
|
|
|
602
592
|
### functionHelpers.trace(label, useClone) ⇒ <code>function</code>
|
|
603
|
-
Output the
|
|
593
|
+
Output the value with label to the console and return the value to not interrupt the code.
|
|
604
594
|
|
|
605
595
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
606
596
|
|
|
607
|
-
| Param | Type |
|
|
608
|
-
| --- | --- | --- |
|
|
609
|
-
| label | <code>string</code> |
|
|
610
|
-
| useClone | |
|
|
597
|
+
| Param | Type | Description |
|
|
598
|
+
| --- | --- | --- |
|
|
599
|
+
| label | <code>string</code> | Pass an identifying label of the value being output. |
|
|
600
|
+
| useClone | | Determines if the logged data should be a clone of the original to preserve state. |
|
|
611
601
|
|
|
612
602
|
<a name="module_functionHelpers.relevancyFilter"></a>
|
|
613
603
|
|
|
@@ -625,18 +615,18 @@ Remove elements out of relevance range and update the max relevance.
|
|
|
625
615
|
|
|
626
616
|
<a name="module_functionHelpers.queueTimeout"></a>
|
|
627
617
|
|
|
628
|
-
### functionHelpers.queueTimeout([queueManagerHandle]) ⇒
|
|
618
|
+
### functionHelpers.queueTimeout([queueManagerHandle]) ⇒ <code>module:functionHelpers~queueTimeoutHandle</code>
|
|
629
619
|
Manage functions to run sequentially with delays.
|
|
630
620
|
|
|
631
621
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
632
622
|
|
|
633
623
|
| Param | Type | Default |
|
|
634
624
|
| --- | --- | --- |
|
|
635
|
-
| [queueManagerHandle] |
|
|
625
|
+
| [queueManagerHandle] | <code>module:functionHelpers~queueManagerHandle</code> | <code></code> |
|
|
636
626
|
|
|
637
627
|
<a name="module_functionHelpers.queueManager"></a>
|
|
638
628
|
|
|
639
|
-
### functionHelpers.queueManager([queue]) ⇒
|
|
629
|
+
### functionHelpers.queueManager([queue]) ⇒ <code>module:functionHelpers~queueManagerHandle</code>
|
|
640
630
|
Manage functions to run sequentially.
|
|
641
631
|
|
|
642
632
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
@@ -647,8 +637,9 @@ Manage functions to run sequentially.
|
|
|
647
637
|
|
|
648
638
|
<a name="module_functionHelpers.preloadParams"></a>
|
|
649
639
|
|
|
650
|
-
### functionHelpers.preloadParams(fn, params, [unassignedParam]) ⇒
|
|
651
|
-
Provide an array of parameters to be used with a function, allow the function to be called later
|
|
640
|
+
### functionHelpers.preloadParams(fn, params, [unassignedParam]) ⇒ <code>module:functionHelpers~callWithMissing</code>
|
|
641
|
+
Provide an array of parameters to be used with a function, allow the function to be called later
|
|
642
|
+
with the missing parameter.
|
|
652
643
|
|
|
653
644
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
654
645
|
|
|
@@ -661,7 +652,8 @@ Provide an array of parameters to be used with a function, allow the function to
|
|
|
661
652
|
<a name="module_functionHelpers.pipe"></a>
|
|
662
653
|
|
|
663
654
|
### functionHelpers.pipe(...fns) ⇒ <code>\*</code>
|
|
664
|
-
Take one or more function with a single parameter and return value.
|
|
655
|
+
Take one or more function with a single parameter and return value.
|
|
656
|
+
Pass a parameter and the value will be transformed by each function then returned.
|
|
665
657
|
|
|
666
658
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
667
659
|
|
|
@@ -683,19 +675,21 @@ Prepare functions to be called once the body is available.
|
|
|
683
675
|
|
|
684
676
|
<a name="module_functionHelpers.delay"></a>
|
|
685
677
|
|
|
686
|
-
### functionHelpers.delay(time) ⇒
|
|
678
|
+
### functionHelpers.delay(time) ⇒ <code>module:functionHelpers~delayHandler</code>
|
|
687
679
|
Provide a timeout which returns a promise.
|
|
688
680
|
|
|
689
681
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
690
682
|
|
|
691
|
-
| Param | Type |
|
|
692
|
-
| --- | --- | --- |
|
|
693
|
-
| time | <code>number</code> |
|
|
683
|
+
| Param | Type | Description |
|
|
684
|
+
| --- | --- | --- |
|
|
685
|
+
| time | <code>number</code> | Delay in milliseconds |
|
|
694
686
|
|
|
695
687
|
<a name="module_functionHelpers.curry"></a>
|
|
696
688
|
|
|
697
689
|
### functionHelpers.curry(fn) ⇒ <code>function</code> \| <code>\*</code>
|
|
698
|
-
Return a curried version of the passed function.
|
|
690
|
+
Return a curried version of the passed function.
|
|
691
|
+
The returned function expects the same number of arguments minus the ones provided.
|
|
692
|
+
fn is the name of the function being curried.
|
|
699
693
|
|
|
700
694
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
701
695
|
|
|
@@ -706,7 +700,7 @@ Return a curried version of the passed function.
|
|
|
706
700
|
<a name="module_functionHelpers.callWithParams"></a>
|
|
707
701
|
|
|
708
702
|
### functionHelpers.callWithParams(fn, params, [minimum]) ⇒ <code>\*</code>
|
|
709
|
-
Given a function, call with the correct number of
|
|
703
|
+
Given a function, call with the correct number of parameters from an array of possible parameters.
|
|
710
704
|
|
|
711
705
|
**Kind**: static method of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
712
706
|
|
|
@@ -714,74 +708,7 @@ Given a function, call with the correct number of paramters from an array of pos
|
|
|
714
708
|
| --- | --- | --- | --- |
|
|
715
709
|
| fn | <code>function</code> | | The function to be called |
|
|
716
710
|
| params | <code>Array</code> | | Array of possible function parameters |
|
|
717
|
-
| [minimum] | <code>number</code> | <code>2</code> |
|
|
718
|
-
|
|
719
|
-
<a name="module_functionHelpers.relevanceObject"></a>
|
|
720
|
-
|
|
721
|
-
### functionHelpers.relevanceObject : <code>Object</code>
|
|
722
|
-
An object having an integer valued property named 'relevance'.
|
|
723
|
-
|
|
724
|
-
**Kind**: static typedef of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
725
|
-
**Properties**
|
|
726
|
-
|
|
727
|
-
| Name | Type |
|
|
728
|
-
| --- | --- |
|
|
729
|
-
| relevance | <code>int</code> |
|
|
730
|
-
|
|
731
|
-
<a name="module_functionHelpers.relevanceMap"></a>
|
|
732
|
-
|
|
733
|
-
### functionHelpers.relevanceMap : <code>Array.<relevanceObject></code>
|
|
734
|
-
A map of relevanceObjects which can be manipulated to filter results.
|
|
735
|
-
|
|
736
|
-
**Kind**: static typedef of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
737
|
-
<a name="module_functionHelpers..queueTimeoutHandle"></a>
|
|
738
|
-
|
|
739
|
-
### functionHelpers~queueTimeoutHandle ⇒ <code>Promise</code>
|
|
740
|
-
Run Timeout functions one after the otherin queue.
|
|
741
|
-
|
|
742
|
-
**Kind**: inner typedef of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
743
|
-
|
|
744
|
-
| Param | Type | Description |
|
|
745
|
-
| --- | --- | --- |
|
|
746
|
-
| fn | <code>function</code> | A callback function to be performed at some time in the future. |
|
|
747
|
-
| time | <code>number</code> | The time in milliseconds to delay. |
|
|
748
|
-
| ...args | <code>\*</code> | Arguments to be passed to the callback once it is implemented. |
|
|
749
|
-
|
|
750
|
-
<a name="module_functionHelpers..queueManagerHandle"></a>
|
|
751
|
-
|
|
752
|
-
### functionHelpers~queueManagerHandle ⇒ <code>Promise</code>
|
|
753
|
-
Each time queue handle is called the passed function is added to the queue to be called when ready.
|
|
754
|
-
|
|
755
|
-
**Kind**: inner typedef of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
756
|
-
|
|
757
|
-
| Param | Type | Description |
|
|
758
|
-
| --- | --- | --- |
|
|
759
|
-
| fn | <code>function</code> | A function to enqueue |
|
|
760
|
-
| ...args | <code>\*</code> | Arguments to be passed to the function once it is ready |
|
|
761
|
-
|
|
762
|
-
<a name="module_functionHelpers..callWithMissing"></a>
|
|
763
|
-
|
|
764
|
-
### functionHelpers~callWithMissing ⇒ <code>\*</code>
|
|
765
|
-
The return function which takes the missing parameter in order to call the preloaded function.
|
|
766
|
-
|
|
767
|
-
**Kind**: inner typedef of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
768
|
-
|
|
769
|
-
| Param | Type | Description |
|
|
770
|
-
| --- | --- | --- |
|
|
771
|
-
| missing | <code>\*</code> | The missing parameter to be applied |
|
|
772
|
-
|
|
773
|
-
<a name="module_functionHelpers..delayHandler"></a>
|
|
774
|
-
|
|
775
|
-
### functionHelpers~delayHandler : <code>Object</code>
|
|
776
|
-
Provide a way to cancel a request or attach a resolve event.
|
|
777
|
-
|
|
778
|
-
**Kind**: inner typedef of [<code>functionHelpers</code>](#module_functionHelpers)
|
|
779
|
-
**Properties**
|
|
780
|
-
|
|
781
|
-
| Name | Type |
|
|
782
|
-
| --- | --- |
|
|
783
|
-
| resolver | <code>Promise</code> |
|
|
784
|
-
| cancel | <code>function</code> |
|
|
711
|
+
| [minimum] | <code>number</code> | <code>2</code> | Minimum number of parameters to use in the function |
|
|
785
712
|
|
|
786
713
|
<a name="module_objectDescriptors"></a>
|
|
787
714
|
|
|
@@ -792,43 +719,38 @@ Create a format to standardize every object into a specific template.
|
|
|
792
719
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
793
720
|
|
|
794
721
|
* [objectDescriptors](#module_objectDescriptors)
|
|
795
|
-
*
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
* [.assignDescriptor(originalMap, ...descriptors)](#module_objectDescriptors.assignDescriptor) ⇒ [<code>descriptor</code>](#module_objectDescriptors..descriptor)
|
|
812
|
-
* _inner_
|
|
813
|
-
* [~descriptorMap](#module_objectDescriptors..descriptorMap) : [<code>Array.<descriptor></code>](#module_objectDescriptors..descriptor)
|
|
814
|
-
* [~descriptorDetail](#module_objectDescriptors..descriptorDetail) : <code>Object</code>
|
|
815
|
-
* [~descriptor](#module_objectDescriptors..descriptor) : <code>Object</code>
|
|
722
|
+
* [.mappedDescriptorMap](#module_objectDescriptors.mappedDescriptorMap) : <code>module:objectDescriptors~descriptorMap</code>
|
|
723
|
+
* [.descriptorMapSample](#module_objectDescriptors.descriptorMapSample) : <code>module:objectDescriptors~descriptorMap</code>
|
|
724
|
+
* [.descriptorDetailSample](#module_objectDescriptors.descriptorDetailSample) : <code>module:objectDescriptors~descriptorDetail</code>
|
|
725
|
+
* [.descriptorSample](#module_objectDescriptors.descriptorSample) : <code>module:objectDescriptors~descriptor</code>
|
|
726
|
+
* [.sameDescriptor(descriptor1, descriptor2)](#module_objectDescriptors.sameDescriptor) ⇒ <code>boolean</code>
|
|
727
|
+
* [.nextReference(descriptor, currentReference)](#module_objectDescriptors.nextReference) ⇒ <code>number</code> \| <code>undefined</code>
|
|
728
|
+
* [.describeObjectMap(object, [options])](#module_objectDescriptors.describeObjectMap) ⇒ <code>module:objectDescriptors~descriptorMap</code>
|
|
729
|
+
* [.describeObjectDetail(value, [key], [index])](#module_objectDescriptors.describeObjectDetail) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
|
|
730
|
+
* [.describeObject(object)](#module_objectDescriptors.describeObject) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
731
|
+
* [.compareDescriptor(descriptor1, descriptor2)](#module_objectDescriptors.compareDescriptor) ⇒ <code>boolean</code>
|
|
732
|
+
* [.cloneDescriptorDetail(originalDetail)](#module_objectDescriptors.cloneDescriptorDetail) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
|
|
733
|
+
* [.cloneDescriptor(originalMap)](#module_objectDescriptors.cloneDescriptor) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
734
|
+
* [.checkDescriptorComplete(descriptor)](#module_objectDescriptors.checkDescriptorComplete) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
735
|
+
* [.checkClearValues(descriptor, [keepValues])](#module_objectDescriptors.checkClearValues) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
736
|
+
* [.assignDescriptorDetail(originalDetail, ...details)](#module_objectDescriptors.assignDescriptorDetail) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
|
|
737
|
+
* [.assignDescriptor(originalMap, ...descriptors)](#module_objectDescriptors.assignDescriptor) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
816
738
|
|
|
817
739
|
<a name="module_objectDescriptors.mappedDescriptorMap"></a>
|
|
818
740
|
|
|
819
|
-
### objectDescriptors.mappedDescriptorMap :
|
|
741
|
+
### objectDescriptors.mappedDescriptorMap : <code>module:objectDescriptors~descriptorMap</code>
|
|
820
742
|
**Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
821
743
|
<a name="module_objectDescriptors.descriptorMapSample"></a>
|
|
822
744
|
|
|
823
|
-
### objectDescriptors.descriptorMapSample :
|
|
745
|
+
### objectDescriptors.descriptorMapSample : <code>module:objectDescriptors~descriptorMap</code>
|
|
824
746
|
**Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
825
747
|
<a name="module_objectDescriptors.descriptorDetailSample"></a>
|
|
826
748
|
|
|
827
|
-
### objectDescriptors.descriptorDetailSample :
|
|
749
|
+
### objectDescriptors.descriptorDetailSample : <code>module:objectDescriptors~descriptorDetail</code>
|
|
828
750
|
**Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
829
751
|
<a name="module_objectDescriptors.descriptorSample"></a>
|
|
830
752
|
|
|
831
|
-
### objectDescriptors.descriptorSample :
|
|
753
|
+
### objectDescriptors.descriptorSample : <code>module:objectDescriptors~descriptor</code>
|
|
832
754
|
**Kind**: static constant of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
833
755
|
<a name="module_objectDescriptors.sameDescriptor"></a>
|
|
834
756
|
|
|
@@ -839,8 +761,8 @@ Check if the two descriptors are the same.
|
|
|
839
761
|
|
|
840
762
|
| Param | Type |
|
|
841
763
|
| --- | --- |
|
|
842
|
-
| descriptor1 |
|
|
843
|
-
| descriptor2 |
|
|
764
|
+
| descriptor1 | <code>module:objectDescriptors~descriptor</code> |
|
|
765
|
+
| descriptor2 | <code>module:objectDescriptors~descriptor</code> |
|
|
844
766
|
|
|
845
767
|
<a name="module_objectDescriptors.nextReference"></a>
|
|
846
768
|
|
|
@@ -851,12 +773,12 @@ Find the index of the next module:objectDescriptors.descriptorDetail to build a
|
|
|
851
773
|
|
|
852
774
|
| Param | Type |
|
|
853
775
|
| --- | --- |
|
|
854
|
-
| descriptor |
|
|
776
|
+
| descriptor | <code>module:objectDescriptors~descriptor</code> |
|
|
855
777
|
| currentReference | <code>number</code> |
|
|
856
778
|
|
|
857
779
|
<a name="module_objectDescriptors.describeObjectMap"></a>
|
|
858
780
|
|
|
859
|
-
### objectDescriptors.describeObjectMap(object, [options]) ⇒
|
|
781
|
+
### objectDescriptors.describeObjectMap(object, [options]) ⇒ <code>module:objectDescriptors~descriptorMap</code>
|
|
860
782
|
Trace out the entire object including nested objects.
|
|
861
783
|
|
|
862
784
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
@@ -871,7 +793,7 @@ Trace out the entire object including nested objects.
|
|
|
871
793
|
|
|
872
794
|
<a name="module_objectDescriptors.describeObjectDetail"></a>
|
|
873
795
|
|
|
874
|
-
### objectDescriptors.describeObjectDetail(value, [key], [index]) ⇒
|
|
796
|
+
### objectDescriptors.describeObjectDetail(value, [key], [index]) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
|
|
875
797
|
Trace an object's attribute and provide details about it.
|
|
876
798
|
|
|
877
799
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
@@ -884,7 +806,7 @@ Trace an object's attribute and provide details about it.
|
|
|
884
806
|
|
|
885
807
|
<a name="module_objectDescriptors.describeObject"></a>
|
|
886
808
|
|
|
887
|
-
### objectDescriptors.describeObject(object) ⇒
|
|
809
|
+
### objectDescriptors.describeObject(object) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
888
810
|
Trace an object and return the descriptor which defines the object's structure and attributes.
|
|
889
811
|
|
|
890
812
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
@@ -902,117 +824,77 @@ Check if two descriptors are the same or similar in that they have similar keys
|
|
|
902
824
|
|
|
903
825
|
| Param | Type |
|
|
904
826
|
| --- | --- |
|
|
905
|
-
| descriptor1 |
|
|
906
|
-
| descriptor2 |
|
|
827
|
+
| descriptor1 | <code>module:objectDescriptors~descriptor</code> |
|
|
828
|
+
| descriptor2 | <code>module:objectDescriptors~descriptor</code> |
|
|
907
829
|
|
|
908
830
|
<a name="module_objectDescriptors.cloneDescriptorDetail"></a>
|
|
909
831
|
|
|
910
|
-
### objectDescriptors.cloneDescriptorDetail(originalDetail) ⇒
|
|
832
|
+
### objectDescriptors.cloneDescriptorDetail(originalDetail) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
|
|
911
833
|
Get a new copy of an existing Descriptor Detail
|
|
912
834
|
|
|
913
835
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
914
836
|
|
|
915
837
|
| Param | Type |
|
|
916
838
|
| --- | --- |
|
|
917
|
-
| originalDetail |
|
|
839
|
+
| originalDetail | <code>module:objectDescriptors~descriptorDetail</code> |
|
|
918
840
|
|
|
919
841
|
<a name="module_objectDescriptors.cloneDescriptor"></a>
|
|
920
842
|
|
|
921
|
-
### objectDescriptors.cloneDescriptor(originalMap) ⇒
|
|
843
|
+
### objectDescriptors.cloneDescriptor(originalMap) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
922
844
|
Make a copy of an object descriptor so that the original will not be mutated.
|
|
923
845
|
|
|
924
846
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
925
847
|
|
|
926
848
|
| Param | Type |
|
|
927
849
|
| --- | --- |
|
|
928
|
-
| originalMap |
|
|
850
|
+
| originalMap | <code>module:objectDescriptors~descriptor</code> |
|
|
929
851
|
|
|
930
852
|
<a name="module_objectDescriptors.checkDescriptorComplete"></a>
|
|
931
853
|
|
|
932
|
-
### objectDescriptors.checkDescriptorComplete(descriptor) ⇒
|
|
854
|
+
### objectDescriptors.checkDescriptorComplete(descriptor) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
933
855
|
Check if the descriptors references have all been built and set complete to true if they have.
|
|
934
856
|
|
|
935
857
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
936
858
|
|
|
937
859
|
| Param | Type |
|
|
938
860
|
| --- | --- |
|
|
939
|
-
| descriptor |
|
|
861
|
+
| descriptor | <code>module:objectDescriptors~descriptor</code> |
|
|
940
862
|
|
|
941
863
|
<a name="module_objectDescriptors.checkClearValues"></a>
|
|
942
864
|
|
|
943
|
-
### objectDescriptors.checkClearValues(descriptor, [keepValues]) ⇒
|
|
865
|
+
### objectDescriptors.checkClearValues(descriptor, [keepValues]) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
944
866
|
Check if we should clear the values on this descriptor
|
|
945
867
|
|
|
946
868
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
947
869
|
|
|
948
870
|
| Param | Type | Default |
|
|
949
871
|
| --- | --- | --- |
|
|
950
|
-
| descriptor |
|
|
872
|
+
| descriptor | <code>module:objectDescriptors~descriptor</code> | |
|
|
951
873
|
| [keepValues] | <code>boolean</code> | <code>false</code> |
|
|
952
874
|
|
|
953
875
|
<a name="module_objectDescriptors.assignDescriptorDetail"></a>
|
|
954
876
|
|
|
955
|
-
### objectDescriptors.assignDescriptorDetail(originalDetail, ...details) ⇒
|
|
877
|
+
### objectDescriptors.assignDescriptorDetail(originalDetail, ...details) ⇒ <code>module:objectDescriptors~descriptorDetail</code>
|
|
956
878
|
Assign properties from other details onto an existing detail.
|
|
957
879
|
|
|
958
880
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
959
881
|
|
|
960
882
|
| Param | Type |
|
|
961
883
|
| --- | --- |
|
|
962
|
-
| originalDetail |
|
|
963
|
-
| ...details |
|
|
884
|
+
| originalDetail | <code>module:objectDescriptors~descriptorDetail</code> |
|
|
885
|
+
| ...details | <code>module:objectDescriptors~descriptorDetail</code> |
|
|
964
886
|
|
|
965
887
|
<a name="module_objectDescriptors.assignDescriptor"></a>
|
|
966
888
|
|
|
967
|
-
### objectDescriptors.assignDescriptor(originalMap, ...descriptors) ⇒
|
|
889
|
+
### objectDescriptors.assignDescriptor(originalMap, ...descriptors) ⇒ <code>module:objectDescriptors~descriptor</code>
|
|
968
890
|
Apply one or more descriptors to an existing descriptor so that they represent a merged version of the descriptors.
|
|
969
891
|
|
|
970
892
|
**Kind**: static method of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
971
893
|
|
|
972
894
|
| Param | Type |
|
|
973
895
|
| --- | --- |
|
|
974
|
-
| originalMap |
|
|
975
|
-
| ...descriptors |
|
|
976
|
-
|
|
977
|
-
<a name="module_objectDescriptors..descriptorMap"></a>
|
|
978
|
-
|
|
979
|
-
### objectDescriptors~descriptorMap : [<code>Array.<descriptor></code>](#module_objectDescriptors..descriptor)
|
|
980
|
-
**Kind**: inner typedef of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
981
|
-
<a name="module_objectDescriptors..descriptorDetail"></a>
|
|
982
|
-
|
|
983
|
-
### objectDescriptors~descriptorDetail : <code>Object</code>
|
|
984
|
-
**Kind**: inner typedef of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
985
|
-
**Properties**
|
|
986
|
-
|
|
987
|
-
| Name | Type |
|
|
988
|
-
| --- | --- |
|
|
989
|
-
| index | <code>number</code> |
|
|
990
|
-
| key | <code>string</code> \| <code>number</code> |
|
|
991
|
-
| type | <code>Array.<string></code> |
|
|
992
|
-
| value | <code>Array</code> |
|
|
993
|
-
| nullable | <code>boolean</code> |
|
|
994
|
-
| optional | <code>boolean</code> |
|
|
995
|
-
| circular | <code>boolean</code> |
|
|
996
|
-
| isReference | <code>boolean</code> |
|
|
997
|
-
| isInstance | <code>boolean</code> |
|
|
998
|
-
| arrayReference | <code>null</code> \| <code>number</code> |
|
|
999
|
-
| objectReference | <code>null</code> \| <code>number</code> |
|
|
1000
|
-
|
|
1001
|
-
<a name="module_objectDescriptors..descriptor"></a>
|
|
1002
|
-
|
|
1003
|
-
### objectDescriptors~descriptor : <code>Object</code>
|
|
1004
|
-
**Kind**: inner typedef of [<code>objectDescriptors</code>](#module_objectDescriptors)
|
|
1005
|
-
**Properties**
|
|
1006
|
-
|
|
1007
|
-
| Name | Type |
|
|
1008
|
-
| --- | --- |
|
|
1009
|
-
| index | <code>number</code> |
|
|
1010
|
-
| details | [<code>Array.<descriptorDetail></code>](#module_objectDescriptors..descriptorDetail) |
|
|
1011
|
-
| length | <code>number</code> |
|
|
1012
|
-
| keys | <code>Array.<(string\|number)></code> |
|
|
1013
|
-
| references | <code>Array.<number></code> |
|
|
1014
|
-
| isArray | <code>boolean</code> |
|
|
1015
|
-
| complete | <code>boolean</code> |
|
|
896
|
+
| originalMap | <code>module:objectDescriptors~descriptor</code> |
|
|
897
|
+
| ...descriptors | <code>module:objectDescriptors~descriptor</code> |
|
|
1016
898
|
|
|
1017
899
|
<a name="module_arrayHelpers"></a>
|
|
1018
900
|
|
|
@@ -1023,15 +905,12 @@ Some simple utility functions for generating arrays or performing work on arrays
|
|
|
1023
905
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
1024
906
|
|
|
1025
907
|
* [arrayHelpers](#module_arrayHelpers)
|
|
1026
|
-
*
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
* [.addUniqueToArray(item, array)](#module_arrayHelpers.addUniqueToArray) ⇒ <code>Array</code> \| <code>Buffer</code> \| <code>\*</code> \| <code>string</code>
|
|
1033
|
-
* _inner_
|
|
1034
|
-
* [~compareArrayResult](#module_arrayHelpers..compareArrayResult) : <code>Object.<string, (string\|Array.<number>)></code>
|
|
908
|
+
* [.uniqueArray(array)](#module_arrayHelpers.uniqueArray) ⇒ <code>Array</code>
|
|
909
|
+
* [.mergeArrays(...arrays)](#module_arrayHelpers.mergeArrays) ⇒ <code>Array</code>
|
|
910
|
+
* [.compareArrays(...arrays)](#module_arrayHelpers.compareArrays) ⇒ <code>Array.<module:arrayHelpers~compareArrayResult></code>
|
|
911
|
+
* [.buildArrayOfReferences(item, length)](#module_arrayHelpers.buildArrayOfReferences) ⇒ <code>Array.<\*></code>
|
|
912
|
+
* [.buildArray(item, length)](#module_arrayHelpers.buildArray) ⇒ <code>Array.<\*></code>
|
|
913
|
+
* [.addUniqueToArray(item, array)](#module_arrayHelpers.addUniqueToArray) ⇒ <code>Array</code>
|
|
1035
914
|
|
|
1036
915
|
<a name="module_arrayHelpers.uniqueArray"></a>
|
|
1037
916
|
|
|
@@ -1057,8 +936,17 @@ Take multiple arrays and then filter all these into one unique array.
|
|
|
1057
936
|
|
|
1058
937
|
<a name="module_arrayHelpers.compareArrays"></a>
|
|
1059
938
|
|
|
1060
|
-
### arrayHelpers.compareArrays(...arrays) ⇒
|
|
1061
|
-
Compare two Arrays and return the Object where the value for each property is as follows:
|
|
1062
|
-
1 to indicate val1 is less than val2
|
|
939
|
+
### arrayHelpers.compareArrays(...arrays) ⇒ <code>Array.<module:arrayHelpers~compareArrayResult></code>
|
|
940
|
+
Compare two Arrays and return the Object where the value for each property is as follows:
|
|
941
|
+
-1 to indicate val1 is less than val2
|
|
942
|
+
0 to indicate both values are the equal
|
|
943
|
+
1 to indicate val1 is greater than val2
|
|
944
|
+
The returned Object uses the element values as the property names
|
|
945
|
+
This functions works by first creating a concatenated array of all unique values. Then for each unique values,
|
|
946
|
+
convert to a string and use it as a new property name. Array filter each array checking if it has the unique value.
|
|
947
|
+
Use the lengths of these filtered arrays to compare. So if the first array has the value and the second one doesn't
|
|
948
|
+
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
|
|
949
|
+
or more.
|
|
1063
950
|
|
|
1064
951
|
**Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
|
|
1065
952
|
|
|
@@ -1068,12 +956,52 @@ Compare two Arrays and return the Object where the value for each property is as
|
|
|
1068
956
|
|
|
1069
957
|
**Example**
|
|
1070
958
|
```js
|
|
1071
|
-
// example of input and resulting output
|
|
1072
959
|
['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
|
|
1073
960
|
['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
1074
961
|
{
|
|
1075
962
|
value: 'match1',
|
|
1076
963
|
keys: [[0], [0]],
|
|
1077
964
|
result: [0, 0]
|
|
1078
965
|
},
|
|
1079
966
|
{
|
|
1080
967
|
value: 'firstMismatch1',
|
|
1081
968
|
keys: [[1], []],
|
|
1082
969
|
result: [1, -1]
|
|
1083
970
|
},
|
|
1084
971
|
{
|
|
1085
972
|
value: 'match2',
|
|
1086
973
|
keys: [[2], [1]],
|
|
1087
974
|
result: [0, 0]
|
|
1088
975
|
},
|
|
1089
976
|
{
|
|
1090
977
|
value: 'firstMismatch2',
|
|
1091
978
|
keys: [[3], []],
|
|
1092
979
|
result: [1, -1]
|
|
1093
980
|
},
|
|
1094
981
|
{
|
|
1095
982
|
value: 'badMatch1',
|
|
1096
983
|
keys: [[4], [3, 4]],
|
|
1097
984
|
result: [0, 0]
|
|
1098
985
|
},
|
|
1099
986
|
{
|
|
1100
987
|
value: 'secondMismatch1',
|
|
1101
988
|
keys: [[], [2]],
|
|
1102
989
|
result: [-1, 1]
|
|
1103
990
|
}
|
|
991
|
+
// example of input and resulting output
|
|
992
|
+
compareArrays(
|
|
993
|
+
['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1'],
|
|
994
|
+
['match1', 'match2', 'secondMismatch1', 'badMatch1', 'badMatch1']
|
|
995
|
+
)
|
|
996
|
+
// unique array
|
|
997
|
+
['match1', 'firstMismatch1', 'match2', 'firstMismatch2', 'badMatch1', 'secondMismatch1']
|
|
998
|
+
// result object
|
|
999
|
+
[
|
|
1000
|
+
{
|
|
1001
|
+
value: 'match1',
|
|
1002
|
+
keys: [[0], [0]],
|
|
1003
|
+
result: [0, 0]
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
value: 'firstMismatch1',
|
|
1007
|
+
keys: [[1], []],
|
|
1008
|
+
result: [1, -1]
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
value: 'match2',
|
|
1012
|
+
keys: [[2], [1]],
|
|
1013
|
+
result: [0, 0]
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
value: 'firstMismatch2',
|
|
1017
|
+
keys: [[3], []],
|
|
1018
|
+
result: [1, -1]
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
value: 'badMatch1',
|
|
1022
|
+
keys: [[4], [3, 4]],
|
|
1023
|
+
result: [0, 0]
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
value: 'secondMismatch1',
|
|
1027
|
+
keys: [[], [2]],
|
|
1028
|
+
result: [-1, 1]
|
|
1029
|
+
}
|
|
1030
|
+
]
|
|
1104
1031
|
```
|
|
1105
1032
|
<a name="module_arrayHelpers.buildArrayOfReferences"></a>
|
|
1106
1033
|
|
|
1107
1034
|
### arrayHelpers.buildArrayOfReferences(item, length) ⇒ <code>Array.<\*></code>
|
|
1108
|
-
Leverage buildArrayBase to generate an array filled with references to the provided item.
|
|
1035
|
+
Leverage buildArrayBase to generate an array filled with references to the provided item.
|
|
1036
|
+
The length defines how long the array should be.
|
|
1109
1037
|
|
|
1110
1038
|
**Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
|
|
1111
1039
|
|
|
@@ -1085,7 +1013,8 @@ Leverage buildArrayBase to generate an array filled with references to the provi
|
|
|
1085
1013
|
<a name="module_arrayHelpers.buildArray"></a>
|
|
1086
1014
|
|
|
1087
1015
|
### arrayHelpers.buildArray(item, length) ⇒ <code>Array.<\*></code>
|
|
1088
|
-
Leverage buildArrayBase to generate an array filled with a copy of the provided item.
|
|
1016
|
+
Leverage buildArrayBase to generate an array filled with a copy of the provided item.
|
|
1017
|
+
The length defines how long the array should be.
|
|
1089
1018
|
|
|
1090
1019
|
**Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
|
|
1091
1020
|
|
|
@@ -1096,7 +1025,7 @@ Leverage buildArrayBase to generate an array filled with a copy of the provided
|
|
|
1096
1025
|
|
|
1097
1026
|
<a name="module_arrayHelpers.addUniqueToArray"></a>
|
|
1098
1027
|
|
|
1099
|
-
### arrayHelpers.addUniqueToArray(item, array) ⇒ <code>Array</code>
|
|
1028
|
+
### arrayHelpers.addUniqueToArray(item, array) ⇒ <code>Array</code>
|
|
1100
1029
|
Having an array and a potential new array element, check if the element is in the array, if not append to array.
|
|
1101
1030
|
|
|
1102
1031
|
**Kind**: static method of [<code>arrayHelpers</code>](#module_arrayHelpers)
|
|
@@ -1106,21 +1035,3 @@ Having an array and a potential new array element, check if the element is in th
|
|
|
1106
1035
|
| item | <code>\*</code> | An potential array element, possibly a DomItem |
|
|
1107
1036
|
| array | <code>Array</code> | An array where an element may be appended. |
|
|
1108
1037
|
|
|
1109
|
-
<a name="module_arrayHelpers..compareArrayResult"></a>
|
|
1110
|
-
|
|
1111
|
-
### arrayHelpers~compareArrayResult : <code>Object.<string, (string\|Array.<number>)></code>
|
|
1112
|
-
Store the comparison result for an element that may exist in either of compared arrays.
|
|
1113
|
-
value stores the element value from the arrays being compared
|
|
1114
|
-
results has the comparison results where first index (0) is result for first compared array
|
|
1115
1038
|
and the second index (1) will be the result for the second compared array
|
|
1116
|
-
|
|
1117
|
-
**Kind**: inner typedef of [<code>arrayHelpers</code>](#module_arrayHelpers)
|
|
1118
|
-
**Properties**
|
|
1119
|
-
|
|
1120
|
-
| Name | Type | Description |
|
|
1121
|
-
| --- | --- | --- |
|
|
1122
|
-
| value | <code>string</code> | The element value being compared |
|
|
1123
|
-
| keys | <code>Array.<Array.<(string\|number)>></code> | Keys in arrays associated with this value |
|
|
1124
|
-
| result | <code>Array.<number></code> | The results in the order of the compared arrays |
|
|
1125
|
-
|
|
1126
|
-
**Example**
|
|
1127
|
-
```js
|
|
1128
|
-
// example of input and resulting output
|
|
1129
|
-
```
|