project: Move to ESM Modules
This commit is contained in:
@@ -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'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user