mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 09:49:05 +01:00
12 lines
376 B
TypeScript
12 lines
376 B
TypeScript
export function nyaize(text: string): string {
|
|
return text
|
|
// ja-JP
|
|
.replace(/な/g, 'にゃ').replace(/ナ/g, 'ニャ').replace(/ナ/g, 'ニャ')
|
|
// en-US
|
|
.replace(/morning/gi, 'mornyan').replace(/everyone/gi, 'everynyan')
|
|
// ko-KR
|
|
.replace(/[나-낳]/g, match => String.fromCharCode(
|
|
match.codePointAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0)
|
|
));
|
|
}
|