cath/src/functions/cleanText.ts
2021-10-09 08:50:42 +08:00

12 lines
294 B
TypeScript

/**
* Returns a string without " ` " or " @ "
*/
export function cleanText(text: string): string {
if (typeof text === "string") {
return text
.replace(/`/g, "`" + String.fromCharCode(8203))
.replace(/@/g, "@" + String.fromCharCode(8203));
} else {
return text;
}
}