diff --git a/src/utils/searchWithFuse.ts b/src/utils/searchWithFuse.ts new file mode 100644 index 0000000..af7a844 --- /dev/null +++ b/src/utils/searchWithFuse.ts @@ -0,0 +1,12 @@ +import type { iSVG } from "@/types/svg"; +import Fuse from "fuse.js"; + +export const searchWithFuse = (svgsData: iSVG[]) => { + return new Fuse(svgsData, { + keys: ["title"], + threshold: 0.35, + ignoreLocation: true, + isCaseSensitive: false, + shouldSort: true, + }); +};