Escapes a tag value for the wire per the IRCv3 message-tags spec.
Encodes the five reserved octets so a value stays unambiguous inside the semicolon-separated
tag list: ; becomes \:, space becomes \s, backslash becomes \\, CR becomes \r, and
LF becomes \n.
Parameters
value: string
The raw tag value.
Returns string
The escaped value safe to place after key=.
Since
1.0.4
Example
import { escapeTagValue } from'edgeport/irc';
escapeTagValue('a;b c'); // 'a\\:b\\s c' -> on the wire: a\:b\s
Escapes a tag value for the wire per the IRCv3 message-tags spec.
Encodes the five reserved octets so a value stays unambiguous inside the semicolon-separated tag list:
;becomes\:, space becomes\s, backslash becomes\\, CR becomes\r, and LF becomes\n.