Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/kentcdodds/match-sorter
/ functions
Functions
19 in github.com/kentcdodds/match-sorter
⨍
Functions
19
◇
Types & classes
8
↓ 2 callers
Function
findMatchingCharacter
( matchChar: string, string: string, index: number, )
src/index.ts:334
↓ 2 callers
Function
getMatchRanking
* Gives a rankings score based on how well the two strings match. * @param {String} testString - the string to test against * @param {String} string
src/index.ts:209
↓ 2 callers
Function
getRankedItems
( items: ReadonlyArray<ItemType>, value: string, options: MatchSorterOptions<ItemType>, )
src/index.ts:105
↓ 2 callers
Function
matchSorterWithRankInfo
* Takes an array of items and a value and returns ranked items with metadata attached * @param {Array} items - the items to sort * @param {String} v
src/index.ts:97
↓ 2 callers
Function
prepareValueForComparison
* Prepares value for comparison by stringifying it, removing diacritics (if specified) * @param {String} value - the value to clean * @param {Object
src/index.ts:406
↓ 1 callers
Function
getAcronym
* Generates an acronym for a string. * * Segment starts ︱ at the beginning of the phrase, after a **space**, or after a **hyphen**. * We capture th
src/index.ts:300
↓ 1 callers
Function
getAllValuesToRank
* Gets all the values for the given keys in the given item and returns an array of those values * @param item - the item from which the values will b
src/index.ts:512
↓ 1 callers
Function
getClosenessRanking
* Returns a score based on how spread apart the * characters from the stringToRank are within the testString. * A number close to rankings.MATCHES r
src/index.ts:328
↓ 1 callers
Function
getHighestRanking
* Gets the highest ranking for value for the given item based on its values for the given keys * @param {*} item - the item to rank * @param {Array}
src/index.ts:145
↓ 1 callers
Function
getItemValues
* Gets value for key in item at arbitrarily nested keypath * @param {Object} item - the item * @param {Object|Function} key - the potentially nested
src/index.ts:425
↓ 1 callers
Function
getKeyAttributes
* Gets all the attributes for the given key * @param key - the key from which the attributes will be retrieved * @return object containing the key's
src/index.ts:540
↓ 1 callers
Function
getNestedValues
* Given path: "foo.bar.baz" * And item: {foo: {bar: {baz: 'buzz'}}} * -> 'buzz' * @param path a dot-separated set of keys * @param item the item
src/index.ts:463
↓ 1 callers
Function
getRanking
(spread: number)
src/index.ts:348
↓ 1 callers
Function
indexesOf
(testString: string, stringToRank: string)
src/index.ts:194
↓ 1 callers
Function
matchSorter
* Takes an array of items and a value and returns a new array with the items that match the given value * @param {Array} items - the items to sort *
src/index.ts:82
↓ 1 callers
Function
sortRankedValues
* Sorts items that have a rank, index, and keyIndex * @param {Object} a - the first item to sort * @param {Object} b - the second item to sort * @r
src/index.ts:378
Function
defaultBaseSortFn
(a, b)
src/index.ts:72
Function
reduceItemsToRanked
( matches: Array<RankedItem<ItemType>>, item: ItemType, index: number, )
src/index.ts:120
Function
testFn
()
src/__tests__/index.ts:661