pref: add * to filter keyword prefix when use fuzzy matching (#437)

This commit is contained in:
Lykin 2025-05-08 18:32:10 +08:00
parent 2aa302c652
commit 69752d2a90

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import { endsWith, get, isEmpty, join, map, now, size, slice, split } from 'lodash'
import { endsWith, get, isEmpty, join, map, now, size, slice, split, startsWith } from 'lodash'
import {
AddHashField,
AddListItem,
@ -644,6 +644,9 @@ const useBrowserStore = defineStore('browser', {
}
if (!isRedisGlob(match) && !exact) {
if (!startsWith(match, '*')) {
match = '*' + match
}
if (!endsWith(match, '*')) {
match = match + '*'
}