Skip to content

Commit

Permalink
fix:nyaizeがおかしい
Browse files Browse the repository at this point in the history
Signed-off-by: mattyatea <[email protected]>
  • Loading branch information
mattyatea committed Oct 29, 2023
1 parent aefc941 commit 780f868
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/frontend/src/scripts/nyaize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export function nyaize(text: string): string {
// ja-JP
.replaceAll('な', 'にゃ').replaceAll('ナ', 'ニャ').replaceAll('ナ', 'ニャ')
// en-US
.replace(/(?<=n)a/gi, x => x === 'A' ? 'YA' : 'ya')
.replace(/(?<=morn)ing/gi, x => x === 'ING' ? 'YAN' : 'yan')
.replace(/(?<=every)one/gi, x => x === 'ONE' ? 'NYAN' : 'nyan')
.replace(/(n)a/gi, (match, p1) => p1 === 'A' ? 'YA' : 'ya')
.replace(/(morn)ing/gi, (match, p1) => p1 === 'ING' ? 'YAN' : 'yan')
.replace(/(every)one/gi, (match, p1) => p1 === 'ONE' ? 'NYAN' : 'nyan')
// ko-KR
.replace(/[나-낳]/g, match => String.fromCharCode(
match.charCodeAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0),
Expand Down

0 comments on commit 780f868

Please sign in to comment.