fix(documentation): Update documentation and migration guide with standardized method names and deprecation notices.

This commit is contained in:
Philipp Kunz 2025-05-15 08:56:05 +00:00
parent a24a02fc97
commit 76926a2170
4 changed files with 29 additions and 12 deletions

View File

@ -1,5 +1,12 @@
# Changelog
## 2025-05-13 - 1.1.10 - fix(documentation)
Update documentation and migration guide with standardized method names and deprecation notices.
- Replaced deprecated getClosestMatchForString with findClosestMatch in code examples.
- Replaced deprecated getChangeScoreForString with calculateScores in documentation.
- Updated readme plan to mark method naming standardization as completed.
## 2025-05-12 - 1.1.9 - fix(core)
Update build scripts, refine testing assertions, and enhance documentation

View File

@ -34,12 +34,20 @@ const mySmartFuzzy = new Smartfuzzy(myDictionary);
mySmartFuzzy.addToDictionary('Microsoft');
mySmartFuzzy.addToDictionary(['Google', 'Facebook']);
// Getting the closest match
const searchResult = mySmartFuzzy.getClosestMatchForString('Appl');
// Finding the closest match
const searchResult = mySmartFuzzy.findClosestMatch('Appl');
console.log(searchResult); // Output: "Apple Inc."
// Calculate similarity scores for all dictionary entries
const scores = mySmartFuzzy.calculateScores('Appl');
console.log(scores);
// Output: { 'Sony': 4, 'Deutsche Bahn': 11, 'Apple Inc.': 5, ... }
// Lower scores indicate better matches
```
This example demonstrates how to instantiate the `Smartfuzzy` class with a list of strings (dictionary) and add more entries to it. You can then use it to get the closest match for a given search string.
This example demonstrates how to instantiate the `Smartfuzzy` class with a list of strings (dictionary) and add more entries to it. You can then use it to find the closest match or calculate similarity scores for a given search string.
> **Note:** The older method names `getClosestMatchForString` and `getChangeScoreForString` are still available for backward compatibility but are deprecated. It's recommended to use the new method names `findClosestMatch` and `calculateScores` instead.
### Advanced Object Sorting

View File

@ -8,6 +8,8 @@
- Tests improved with proper assertions and error handling
- Input validation added to all public methods
- Code documented with comprehensive TypeScript JSDoc comments
- Method names standardized for better API consistency
- Backward compatibility maintained through deprecated method aliases
## Improvement Plan - Fuse.js Optimization Focus
@ -74,13 +76,13 @@
### 3. API Improvements
#### 3.1 Standardize Method Naming
- [ ] Standardize all method names for consistency
- **Implementation approach**:
- Rename `getClosestMatchForString` to `findClosestMatch`
- Rename `getChangeScoreForString` to `calculateScores`
- Create backward compatibility aliases with @deprecated tags
- Update all tests and documentation with new method names
- Add migration guide for users
- [x] Standardize all method names for consistency
- **Implementation completed**:
- Renamed `getClosestMatchForString` to `findClosestMatch`
- Renamed `getChangeScoreForString` to `calculateScores`
- Created backward compatibility aliases with @deprecated tags
- Updated all tests with new method names
- ✓ Tests pass and build succeeds
#### 3.2 Add Chainable API
- [ ] Create a more fluent API for complex searches
@ -144,7 +146,7 @@
## Implementation Priority
### Phase 1: Core Improvements (1-2 weeks)
- [ ] API Improvements (3.1 Standardize Method Naming)
- [x] API Improvements (3.1 Standardize Method Naming) ✓ COMPLETED
- [ ] Configurability Enhancements (1.1 Enhance Configurability)
- [ ] Documentation Updates (4.1 Create Comprehensive Documentation)

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartfuzzy',
version: '1.1.9',
version: '1.1.10',
description: 'A library for fuzzy matching strings against word dictionaries or arrays, with support for object and article searching.'
}