mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-16 21:06:27 +01:00
10 lines
305 B
TypeScript
10 lines
305 B
TypeScript
|
export function nyaize(text: string): string {
|
||
|
return text
|
||
|
// ja-JP
|
||
|
.replace(/な/g, 'にゃ').replace(/ナ/g, 'ニャ').replace(/ナ/g, 'ニャ')
|
||
|
// ko-KR
|
||
|
.replace(/[나-낳]/g, (match: string) => String.fromCharCode(
|
||
|
match.codePointAt(0) + '냐'.charCodeAt(0) - '나'.charCodeAt(0)
|
||
|
));
|
||
|
}
|