fix: 收敛BangDream自由词搜索匹配
This commit is contained in:
parent
4199d68dda
commit
0127628a1e
@ -278,7 +278,7 @@ export function match(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (matchesOnlyAll(matches, keyCount)) {
|
if (matchesOnlyAll(matches, keyCount)) {
|
||||||
return matches._all.some((keyword) =>
|
return matches._all.every((keyword) =>
|
||||||
targetIncludesAllKeyword(target, keyword),
|
targetIncludesAllKeyword(target, keyword),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,12 @@ describe('BangDream fuzzy search helpers', () => {
|
|||||||
expect(match({ _all: ['summer'] }, { title: ['Summer Dive'] }, [])).toBe(
|
expect(match({ _all: ['summer'] }, { title: ['Summer Dive'] }, [])).toBe(
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
expect(
|
||||||
|
match({ _all: ['fire', 'bird'] }, { title: ['FIRE BIRD'] }, []),
|
||||||
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
match({ _all: ['fire', 'bird'] }, { title: ['Light a fire'] }, []),
|
||||||
|
).toBe(false);
|
||||||
expect(
|
expect(
|
||||||
match(
|
match(
|
||||||
{ scoreUpMaxValue: [100], _number: [100] },
|
{ scoreUpMaxValue: [100], _number: [100] },
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user