mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-01 18:16:44 -06:00
987168b863
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
9 lines
295 B
TypeScript
9 lines
295 B
TypeScript
export function nyaize(text: string): string {
|
|
return text
|
|
// ja-JP
|
|
.replace(/な/g, 'にゃ').replace(/ナ/g, 'ニャ').replace(/ナ/g, 'ニャ')
|
|
// ko-KR
|
|
.replace(/[나-낳]/g, match => String.fromCharCode(
|
|
match.codePointAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0)
|
|
));
|
|
}
|