Skip to content

Commit

Permalink
feat: allow ReadonlyArray for keys option
Browse files Browse the repository at this point in the history
  • Loading branch information
diesieben07 committed Sep 15, 2021
1 parent 1ea7f26 commit 3a49b43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type KeyOption<ItemType> =
| string

interface MatchSorterOptions<ItemType = unknown> {
keys?: Array<KeyOption<ItemType>>
keys?: ReadonlyArray<KeyOption<ItemType>>
threshold?: Ranking
baseSort?: BaseSorter<ItemType>
keepDiacritics?: boolean
Expand Down Expand Up @@ -120,7 +120,7 @@ function matchSorter<ItemType = string>(
*/
function getHighestRanking<ItemType>(
item: ItemType,
keys: Array<KeyOption<ItemType>> | undefined,
keys: ReadonlyArray<KeyOption<ItemType>> | undefined,
value: string,
options: MatchSorterOptions<ItemType>,
): RankingInfo {
Expand Down Expand Up @@ -445,7 +445,7 @@ function getNestedValues<ItemType>(
*/
function getAllValuesToRank<ItemType>(
item: ItemType,
keys: Array<KeyOption<ItemType>>,
keys: ReadonlyArray<KeyOption<ItemType>>,
) {
const allValues: Array<{itemValue: string; attributes: KeyAttributes}> = []
for (let j = 0, J = keys.length; j < J; j++) {
Expand Down

0 comments on commit 3a49b43

Please sign in to comment.