Methods
(static) arrayToCsv(data, separatoropt, replaceropt) → {String}
Convert an array to CSV string.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data |
Array
|
|||
separator |
*
|
<optional> |
',' |
Separator, default , |
replacer |
*
|
<optional> |
Replacer function |
Returns:
- Type:
-
String
(static) arrayToObject(arrayOfObjects, keyGetter, valueGetter) → {Object}
Convert an array into a k-v paired object.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arrayOfObjects |
*
|
|
keyGetter |
*
|
|
valueGetter |
*
|
Returns:
- Type:
-
Object
(static) copyArrayLike(arrayLike) → {Array}
Copy an array-like object to an array, return an empty array if the argument is null or undefined.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arrayLike |
*
|
Returns:
- Type:
-
Array
(static) insert(arrayLike, index, value) → {Array}
Insert a value into an array-like object as a new copy.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arrayLike |
*
|
|
index |
integer
|
|
value |
*
|
Returns:
- Type:
-
Array
(static) insertBetween(arr, separator) → {Array}
Insert a separator as element into an array.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array
|
|
separator |
*
|
Returns:
- Type:
-
Array
The newly inserted array
(static) move(array, from, to) → {Array}
Move a value in an array-like object as a new copy.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
array |
*
|
|
from |
*
|
|
to |
*
|
Returns:
- Type:
-
Array
(static) swap(arrayLike, indexA, indexB) → {Array}
Swap two values in an array-like object as a new copy.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arrayLike |
*
|
|
indexA |
integer
|
|
indexB |
integer
|
Returns:
- Type:
-
Array
(static) uniqPush(arrayLike, value) → {Array}
Push a value into an array-like object if the value is not in the array-like object.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arrayLike |
*
|
|
value |
*
|
Returns:
- Type:
-
Array
(static) zipAndFlat(arr1, arr2) → {Array}
One-by-one merge two arrays into one 10x faster than lodash flatten and zip
- Source:
Parameters:
Name | Type | Description |
---|---|---|
arr1 |
Array
|
|
arr2 |
Array
|
Returns:
- Type:
-
Array