Nyanize non[consonant]

🟨🟪

https://calckey.social/notes/9f2l6x5u8e
This commit is contained in:
Kainoa Kanter 2023-05-22 15:57:56 +00:00
parent 8526f0af06
commit 161557d559

View file

@ -9,6 +9,7 @@ export function nyaize(text: string): string {
.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(/non(?=[bcdfghjklmnpqrstvwxyz])/gi, (x) => (x === "NON" ? "NYAN" : "nyan"))
// ko-KR
.replace(/[나-낳]/g, (match) =>
String.fromCharCode(