Repository navigation
Enable fuzzy search in the repository, branch, PR, and clone FilterLists - #3873
Conversation
|
💤 |
| export function score( | ||
| str: string, | ||
| query: string, | ||
| maxScore: number = fuzzAldrin.score(query, query, undefined, options) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| matches: ReadonlyArray<number> | ||
| } | ||
|
|
||
| export function match<T, _K extends keyof T>( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return items | ||
| .map((item): IMatch<T> => { | ||
| let key: string | ||
| if (typeof getKey === 'function') { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| ): ReadonlyArray<IMatch<T>> { | ||
| // matching `query` against itself is a perfect match. | ||
| const maxScore = score(query, query, 1) | ||
| return items |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Almost there, just got some prettier issues to deal with! 😈 |
|
|
||
| import { compareDescending } from './compare' | ||
|
|
||
| export const options: fuzzAldrin.IFilterOptions = { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| pathSeparator: '-', | ||
| } | ||
|
|
||
| export function score(str: string, query: string, maxScore: number) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🐐 |
|
✅/❌ @shiftkey? |
| @@ -0,0 +1,43 @@ | |||
| import * as React from 'react' | |||
|
|
|||
| // broken for SFCs | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🚂 |
Fixes #911.