From 7c309e371d8fe24d97602d2556d6217efb3549a6 Mon Sep 17 00:00:00 2001 From: naskya Date: Sat, 13 Jan 2024 15:45:19 +0900 Subject: [PATCH] chore: remove 'nA' -> 'nYA' conversion in nyaification --- README.md | 2 ++ packages/backend/src/misc/nyaify.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf91e729c..825d84af9 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ ## 細かい変更点 +- 猫語で "nA" を "nYA" に置換しない + - この置き換えはあまり嬉しくないことが多い - `reset-db` という API を無効化 - エンドポイント自体は残してありますが、叩いても何もしません - データベースをリセットする API って何?怖すぎる diff --git a/packages/backend/src/misc/nyaify.ts b/packages/backend/src/misc/nyaify.ts index efeac12d2..37a0bdecd 100644 --- a/packages/backend/src/misc/nyaify.ts +++ b/packages/backend/src/misc/nyaify.ts @@ -9,7 +9,9 @@ export default function ( .replaceAll("ナ", "ニャ") .replaceAll("ナ", "ニャ") // en-US - .replace(/(?<=n)a/gi, (x) => (x === "A" ? "YA" : "ya")) + .replaceAll("na", "nya") + .replaceAll("Na", "Nya") + .replaceAll("NA", "NYA") .replace(/(?<=morn)ing/gi, (x) => (x === "ING" ? "YAN" : "yan")) .replace(/(?<=every)one/gi, (x) => (x === "ONE" ? "NYAN" : "nyan")) .replace(/non(?=[bcdfghjklmnpqrstvwxyz])/gi, (x) =>