Skip to content

Commit

Permalink
isContainsが正しく動いていないバグを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-20 committed Mar 24, 2024
1 parent f567594 commit 735ea7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion workspaces/admin/src/lib/filter/isContains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function isContains({ query, target }: Params): boolean {
// target の先頭から順に query が含まれているかを調べる
TARGET_LOOP: for (let offset = 0; offset <= target.length - query.length; offset++) {
for (let idx = 0; idx < query.length; idx++) {
if (normalize(target[offset + idx]!) === normalize(query[idx]!)) continue TARGET_LOOP;
if (normalize(target[offset + idx]!) !== normalize(query[idx]!)) continue TARGET_LOOP;
}
// query のすべての文字が含まれていたら true を返す
return true;
Expand Down
2 changes: 1 addition & 1 deletion workspaces/app/src/lib/filter/isContains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function isContains({ query, target }: Params): boolean {
// target の先頭から順に query が含まれているかを調べる
TARGET_LOOP: for (let offset = 0; offset <= target.length - query.length; offset++) {
for (let idx = 0; idx < query.length; idx++) {
if (normalize(target[offset + idx]!) === normalize(query[idx]!)) continue TARGET_LOOP;
if (normalize(target[offset + idx]!) !== normalize(query[idx]!)) continue TARGET_LOOP;
}
// query のすべての文字が含まれていたら true を返す
return true;
Expand Down

0 comments on commit 735ea7b

Please sign in to comment.