cspell-trie-lib
Advanced tools
Comparing version 4.0.9 to 4.0.10
@@ -32,2 +32,2 @@ import { TrieNode } from './TrieNode'; | ||
} | ||
export declare function suggestionCollector(word: string, maxNumSuggestions: number, filter?: (word: string) => boolean, changeLimit?: number): SuggestionCollector; | ||
export declare function suggestionCollector(wordToMatch: string, maxNumSuggestions: number, filter?: (word: string) => boolean, changeLimit?: number): SuggestionCollector; |
@@ -174,5 +174,5 @@ "use strict"; | ||
exports.compSuggestionResults = compSuggestionResults; | ||
function suggestionCollector(word, maxNumSuggestions, filter = () => true, changeLimit = maxNumChanges) { | ||
function suggestionCollector(wordToMatch, maxNumSuggestions, filter = () => true, changeLimit = maxNumChanges) { | ||
const sugs = new Map(); | ||
let maxCost = Math.min(baseCost * word.length / 2, baseCost * changeLimit); | ||
let maxCost = Math.min(baseCost * wordToMatch.length / 2, baseCost * changeLimit); | ||
function dropMax() { | ||
@@ -225,3 +225,3 @@ if (sugs.size < 2) { | ||
get maxCost() { return maxCost; }, | ||
get word() { return word; }, | ||
get word() { return wordToMatch; }, | ||
get maxNumSuggestions() { return maxNumSuggestions; }, | ||
@@ -228,0 +228,0 @@ }; |
{ | ||
"name": "cspell-trie-lib", | ||
"version": "4.0.9", | ||
"version": "4.0.10", | ||
"description": "Trie Data Structure to support cspell.", | ||
@@ -60,3 +60,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "a889d1ac70724471454a4189f4082f3af4971074" | ||
"gitHead": "d2bbe5704b69a738731a3761d521418c6dd0641d" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46741