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