| 1869 | 1869 | |
| 1870 | 1870 | // Check cache for existing results |
| 1871 | 1871 | if (cache.keyHash === currentKeyHash && cache.resultMap.has(searchValue)) { |
| 1872 | 1872 | // console.logdebug(`Using cached ${type} fuzzy search results for ${searchValue}`); |
| 1873 | 1873 | return cache.resultMap.get(searchValue); |
| 1874 | 1874 | } |
| 1875 | 1875 | |
| 1876 | 1876 | // Clear cache if keys changed |
| 1877 | 1877 | if (cache.keyHash !== currentKeyHash) { |
| 1878 | 1878 | // console.logdebug(`${type} Fuse keys changed, clearing cache`); |
| 1879 | 1879 | cache.keyHash = currentKeyHash; |
| 1880 | 1880 | cache.resultMap.clear(); |
| 1881 | 1881 | } |