mirror of
https://github.com/github/awesome-copilot.git
synced 2026-03-18 23:25:13 +00:00
fix: make FuzzySearch generic to support typed items
- Add SearchableItem base interface for minimum required fields - Make FuzzySearch class generic with type parameter - Update all page scripts to use typed FuzzySearch instances - Fix type casting in calculateScore method
This commit is contained in:
@@ -48,7 +48,7 @@ export async function initHomepage(): Promise<void> {
|
||||
// Load search index
|
||||
const searchIndex = await fetchData<SearchItem[]>('search-index.json');
|
||||
if (searchIndex) {
|
||||
const search = new FuzzySearch();
|
||||
const search = new FuzzySearch<SearchItem>();
|
||||
search.setItems(searchIndex);
|
||||
|
||||
const searchInput = document.getElementById('global-search') as HTMLInputElement;
|
||||
|
||||
Reference in New Issue
Block a user