cath/src/functions/cleanText.ts

13 lines
294 B
TypeScript
Raw Normal View History

2021-10-09 02:50:42 +02:00
/**
* 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;
}
}