mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 19:53:09 +02:00
11 lines
376 B
TypeScript
11 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)
|
|
));
|
|
}
|