import Fuse from "fuse.js";

function getResults(typed: string, options: string[]): string[] {
    options = options.filter((option) => option.length <= 100); // thanks discord. 6000 character limit on slash command inputs but only 100 for autocomplete.
    if (!typed) return options.slice(0, 25).sort();
    // @ts-expect-error
    const fuse = new Fuse(options, {
        useExtendedSearch: true,
        findAllMatches: true,
        minMatchCharLength: typed.length > 3 ? 3 : typed.length
    }).search(typed);
    return fuse.slice(0, 25).map((option: { item: string }) => option.item);
}

export { getResults };
