@zerospacegg/vynthra
Version:
Discord bot for ZeroSpace.gg data
31 lines • 911 B
TypeScript
/**
* Create a fuzzy matcher for a collection of strings
*/
export declare function createFuzzyMatcher<T>(items: T[], selector: (item: T) => string): {
items: T[];
selector: (item: T) => string;
};
/**
* Fuzzy search items with a query string
*/
export declare function fuzzySearch<T>(matcher: {
items: T[];
selector: (item: T) => string;
}, query: string, limit?: number): Array<{
item: T;
score: number;
positions: Set<number>;
}>;
/**
* Check if a string contains another string (case insensitive)
*/
export declare function contains(query: string, target: string): boolean;
/**
* Check if target starts with query (case insensitive)
*/
export declare function startsWith(query: string, target: string): boolean;
/**
* Exact match check (case insensitive)
*/
export declare function exactMatch(query: string, target: string): boolean;
//# sourceMappingURL=fuzzy.d.ts.map