extract cleanIrcMessage from client to shared

This commit is contained in:
Reto Brunner
2023-01-29 17:04:41 +01:00
parent a8149c0f1a
commit 9d34955836
3 changed files with 7 additions and 2 deletions

6
shared/irc.ts Normal file
View File

@@ -0,0 +1,6 @@
const matchFormatting =
/\x02|\x1D|\x1F|\x16|\x0F|\x11|\x1E|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?|\x04(?:[0-9a-f]{6}(?:,[0-9a-f]{6})?)?/gi;
export function cleanIrcMessage(message: string) {
return message.replace(matchFormatting, "").trim();
}