project: Move to ESM Modules

This commit is contained in:
Rajeh Taher
2025-07-17 13:54:17 +03:00
parent 19124426b2
commit 787aed88b8
69 changed files with 5143 additions and 4757 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import * as constants from './constants'
import { FullJid, jidDecode } from './jid-utils'
import { type FullJid, jidDecode } from './jid-utils'
import type { BinaryNode, BinaryNodeCodingOptions } from './types'
export const encodeBinaryNode = (
@@ -138,11 +138,11 @@ const encodeBinaryNodeInner = (
const strLengthHalf = Math.floor(str.length / 2)
for (let i = 0; i < strLengthHalf; i++) {
pushByte(packBytePair(str[2 * i], str[2 * i + 1]))
pushByte(packBytePair(str[2 * i]!, str[2 * i + 1]!))
}
if (str.length % 2 !== 0) {
pushByte(packBytePair(str[str.length - 1], '\x00'))
pushByte(packBytePair(str[str.length - 1]!, '\x00'))
}
}