feat: add support for FB and Interop JID encoding/decoding and empty strings (#2189)

This commit is contained in:
vini
2026-01-08 16:56:50 -03:00
committed by GitHub
parent 720cc688d6
commit c392d4ce6c
2 changed files with 33 additions and 1 deletions
+6 -1
View File
@@ -182,6 +182,11 @@ const encodeBinaryNodeInner = (
return
}
if (str === '') {
writeStringRaw(str)
return
}
const tokenIndex = TOKEN_MAP[str]
if (tokenIndex) {
if (typeof tokenIndex.dict === 'number') {
@@ -193,7 +198,7 @@ const encodeBinaryNodeInner = (
writePackedBytes(str, 'nibble')
} else if (isHex(str)) {
writePackedBytes(str, 'hex')
} else if (str) {
} else {
const decodedJid = jidDecode(str)
if (decodedJid) {
writeJid(decodedJid)