diff options
Diffstat (limited to 'src/lib/utils.ts')
-rw-r--r-- | src/lib/utils.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 9bc74b8..0674dea 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -57,3 +57,9 @@ export function getRandomHexColor() { // Ensure the color code is always 6 digits by padding with zeros if needed return "#" + randomColor.padStart(6, "0"); } + +export function cleanIpa(ipa: string): string { + const r1 = /\.\//; + const r2 = /[\[\]\/]/g; + return ipa.replace(r1, "").replace(r2, ""); +} |