encode a sequential array of primitive items. to invert/decode the transformation, use unpackSeq.
under the hood, this function uses pack for encoding each item.
import { assertEquals } from "jsr:@std/assert"assertEquals( packSeq(["u4b", 0x12AB98], ["str", "hello"], ["bool", false]), Uint8Array.of(0x00, 0x12, 0xAB, 0x98, 104, 101, 108, 108, 111, 0),) Copy
import { assertEquals } from "jsr:@std/assert"assertEquals( packSeq(["u4b", 0x12AB98], ["str", "hello"], ["bool", false]), Uint8Array.of(0x00, 0x12, 0xAB, 0x98, 104, 101, 108, 108, 111, 0),)
encode a sequential array of primitive items. to invert/decode the transformation, use unpackSeq.
under the hood, this function uses pack for encoding each item.
Example