BREAKING_CHANGE(api): Remove deprecated methods and enhance documentation
- Remove deprecated getChangeScoreForString() and getClosestMatchForString() methods - Improve type safety with correct return types (string | null) - Add comprehensive documentation with performance guide, error handling, and real-world examples - Include browser compatibility info, troubleshooting, and API reference sections - Modernize developer experience with current best practices
This commit is contained in:
@@ -96,12 +96,6 @@ export class Smartfuzzy {
|
||||
return dictionaryMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use calculateScores instead
|
||||
*/
|
||||
public getChangeScoreForString(stringArg: string): TDictionaryMap {
|
||||
return this.calculateScores(stringArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the closest matching word in the dictionary using fuzzy search
|
||||
@@ -115,7 +109,7 @@ export class Smartfuzzy {
|
||||
* // Returns: 'orange'
|
||||
* ```
|
||||
*/
|
||||
public findClosestMatch(stringArg: string): string {
|
||||
public findClosestMatch(stringArg: string): string | null {
|
||||
if (typeof stringArg !== 'string') {
|
||||
throw new Error('Input must be a string');
|
||||
}
|
||||
@@ -148,10 +142,4 @@ export class Smartfuzzy {
|
||||
return closestMatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use findClosestMatch instead
|
||||
*/
|
||||
public getClosestMatchForString(stringArg: string): string {
|
||||
return this.findClosestMatch(stringArg);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user