1.1.0 • Published 4 years ago

multiple-array-sorter v1.1.0

Weekly downloads
28
License
MIT
Repository
github
Last release
4 years ago

Functions

Typedefs

checkLengths(...arrays) ⇒ boolean

Checks if all arrays are the same size

Kind: global function

ParamTypeDescription
...arraysArray.<Array.<any>>Arrays to check length of

getMoveMap(arrayToSortBy, sortParams) ⇒ Object

Sorts master array and returns moveMap

Kind: global function

ParamType
arrayToSortByArray.<any>
sortParamsSortParams

sortArrayBasedOnMoveMap(array, moveMap) ⇒ Array.<any>

Sorts array based on moveMap

Kind: global function

ParamType
arrayArray.<any>
moveMapArray.<MoveMapItem>

sortMultipleArrays(arrayToSortBy, sortParams, arraysToSort) ⇒ SortResult

Sorts multiple arrays based on master array sort order

Kind: global function
Returns: SortResult - The sorted master array and the sorted resulting arrays

ParamTypeDescription
arrayToSortByArray.<any>Master array to sort the others arrays by
sortParamsSortParamsParameters to sort master array
arraysToSortArray.<Array.<any>>Arrays to sort

SortParams

Kind: global typedef
Properties

NameTypeDefaultDescription
sortPropstringProperty 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

NameType
masterArrayArray.<any>
sortedArraysArray.<Array.<any>>

MoveMapItem

Kind: global typedef
Properties

NameType
fromnumber
tonumber