@oazmi/kitchensink - v0.9.13
    Preparing search index...

    Function packSeq

    • 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.

      Parameters

      Returns Uint8Array<ArrayBufferLike>

      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),
      )