Functions
- checkLengths(...arrays) ⇒
boolean
Checks if all arrays are the same size
- getMoveMap(arrayToSortBy, sortParams) ⇒
Object
Sorts master array and returns moveMap
- sortArrayBasedOnMoveMap(array, moveMap) ⇒
Array.<any>
Sorts array based on moveMap
- sortMultipleArrays(arrayToSortBy, sortParams, arraysToSort) ⇒
SortResult
Sorts multiple arrays based on master array sort order
Typedefs
boolean
checkLengths(...arrays) ⇒ Checks if all arrays are the same size
Kind: global function
Param | Type | Description |
---|---|---|
...arrays | Array.<Array.<any>> |
Arrays to check length of |
Object
getMoveMap(arrayToSortBy, sortParams) ⇒ Sorts master array and returns moveMap
Kind: global function
Param | Type |
---|---|
arrayToSortBy | Array.<any> |
sortParams | SortParams |
Array.<any>
sortArrayBasedOnMoveMap(array, moveMap) ⇒ Sorts array based on moveMap
Kind: global function
Param | Type |
---|---|
array | Array.<any> |
moveMap | Array.<MoveMapItem> |
SortResult
sortMultipleArrays(arrayToSortBy, sortParams, arraysToSort) ⇒ Sorts multiple arrays based on master array sort order
Kind: global function
Returns: SortResult
- The sorted master array and the sorted resulting arrays
Param | Type | Description |
---|---|---|
arrayToSortBy | Array.<any> |
Master array to sort the others arrays by |
sortParams | SortParams |
Parameters to sort master array |
arraysToSort | Array.<Array.<any>> |
Arrays to sort |
SortParams
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
[sortProp] | string |
Property to sort by, if value to sort by is object. Supports nested props, like 'propA.propB' | |
[sortOrder] | 'asc' | 'desc' |
"desc" |
Whether to use ascending or descending order to sort |
SortResult
Kind: global typedef
Properties
Name | Type |
---|---|
masterArray | Array.<any> |
sortedArrays | Array.<Array.<any>> |
MoveMapItem
Kind: global typedef
Properties
Name | Type |
---|---|
from | number |
to | number |