mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
🛠️ Create custom utilityusing Fuse.js for efficient SVG title searching
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import type { iSVG } from "@/types/svg";
|
||||
import Fuse from "fuse.js";
|
||||
|
||||
export const searchWithFuse = (svgsData: iSVG[]) => {
|
||||
return new Fuse<iSVG>(svgsData, {
|
||||
keys: ["title"],
|
||||
threshold: 0.35,
|
||||
ignoreLocation: true,
|
||||
isCaseSensitive: false,
|
||||
shouldSort: true,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user