682
683
export function fuzzyScore(pattern: string, patternLow: string, patternStart: number, word: string, wordLow: string, wordStart: number, options: FuzzyScoreOptions = FuzzyScoreOptions.default): FuzzyScore | undefined {
685
>
const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length;
686
>
const wordLen = word.length > _maxLen ? _maxLen : word.length;
687
>
688
>
if (patternStart >= patternLen || wordStart >= wordLen || (patternLen - patternStart) > (wordLen - wordStart)) {
689
return undefined;
690
}
692
>
// Run a simple check if the characters of pattern occur
693
>
// (in order) at all in word. If that isn't the case we
694
>
// stop because no match will be possible
695
>
if (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen, true)) {
696
return undefined;
697
}