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 5493221 commit 859bac6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion workspaces/admin/src/lib/filter/isContains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ type Params = {
const normalize = (str: string) => {
str = str.normalize('NFKC');
// カタカナを平仮名に
if (str >= 'ァ' && str <= 'ン') return str.charCodeAt(0) + ('あ'.charCodeAt(0) - 'ア'.charCodeAt(0));
if (str >= 'ァ' && str <= 'ン')
return String.fromCharCode(str.charCodeAt(0) + ('あ'.charCodeAt(0) - 'ア'.charCodeAt(0)));
return str;
};

Expand Down
3 changes: 2 additions & 1 deletion workspaces/app/src/lib/filter/isContains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ type Params = {
const normalize = (str: string) => {
str = str.normalize('NFKC');
// カタカナを平仮名に
if (str >= 'ァ' && str <= 'ン') return str.charCodeAt(0) + ('あ'.charCodeAt(0) - 'ア'.charCodeAt(0));
if (str >= 'ァ' && str <= 'ン')
return String.fromCharCode(str.charCodeAt(0) + ('あ'.charCodeAt(0) - 'ア'.charCodeAt(0)));
return str;
};

Expand Down

0 comments on commit 859bac6

Please sign in to comment.