sort-array-devfox
v0.0.5
Published
Sorting Array by order and case sensitivity
Downloads
2
Readme
Sort string arrays
Installation
npm install sort-array-devfox
Usage
sortStrings(stringArray: string[], options?: SortingOptions)
Possible Options:
orderBy
which can take"asc"
or"desc"
isCaseSensitive
which can betrue
orfalse
Default options are { orderBy: "asc", isCaseSensitive: false }
Case Sensitivity:
Given an Array ["Za", "ma", "Ba", "aa"]
- with case sensitive
true
=>["Ba", "Za", "aa", "ma"]
- with case sensitive
false
=>["aa", "Ba", "ma", "Za"]
For more usage details see the Unit Tests