Migrate to typescript and make new distribution files
π Release Notes for @smakss/search - Version 2.0.0 π
Overview π
We are thrilled to announce the release of version X.Y.Z of our Search functionality. This update introduces significant improvements in code organization, readability, and documentation, making your search experience smoother and more efficient.
What's New π
- Modular Code Structure π: The search functionality has been divided into smaller, more manageable files (
types.ts
,utils.ts
,searchLogic.ts
,search.ts
). - TypeScript Integration π: Full conversion of the codebase to TypeScript, providing strong typing and reducing potential runtime errors.
- Enhanced Readability π: Refactoring of existing code for greater clarity and readability.
- JSDoc Documentation π: Comprehensive JSDoc comments have been added, offering detailed explanations and usage examples.
- Utility Function Improvements βοΈ: Refinement of utility functions for more efficient and reliable operation.
Breaking Changes π₯
- File Structure ποΈ: Functions are now distributed across multiple files. Users will need to update their import paths.
- TypeScript Adoption π: The codebase is now in TypeScript, which may require changes in JavaScript projects.
Migration Guide π
To migrate from a previous version, please consider the following steps:
- Update import statements to match the new file structure, e.g.,
import { search } from './search';
. - For JavaScript integration, ensure your build tooling supports TypeScript.
- Review your implementation for compatibility with the new TypeScript types and interfaces.
Examples π‘
Here's a quick example of how to use the new search functionality:
import search from './search';
import { SearchItem } from './types';
// Sample data
const items: SearchItem[] = [{ name: 'John Doe', age: 30 }, { name: 'Jane Smith', age: 25 }];
// Perform a search
const results = search({
searchText: 'John',
searchItems: items,
keys: ['name'],
include: true,
exact: false
});
console.log(results); // Expected output: [{ name: 'John Doe', age: 30 }]
Feedback π’
Your feedback is crucial to us. Please let us know if you encounter any issues or have suggestions for future improvements.