edgeport - v1.0.6
    Preparing search index...

    Type Alias RespValue

    RespValue: RespAttributed & (
        | { kind: "string"; value: string }
        | { kind: "error"; value: string }
        | { kind: "number"; value: number }
        | { kind: "bulk"; value: Uint8Array }
        | { format: string; kind: "verbatim"; value: Uint8Array }
        | { kind: "null" }
        | { kind: "boolean"; value: boolean }
        | { kind: "double"; value: number }
        | { kind: "bignum"; value: bigint }
        | { kind: "array"; value: RespValue[] }
        | { kind: "set"; value: RespValue[] }
        | { kind: "map"; value: [RespValue, RespValue][] }
        | { kind: "push"; value: RespValue[] }
    )

    One decoded RESP value as a tag-on-kind discriminated union.

    Covers every RESP2 and RESP3 type; branch on kind to read the type-specific value. The RESP2 null forms ($-1, *-1) and the RESP3 null (_) all decode to { kind: 'null' }, so callers never have to tell them apart. The optional attributes slot is spread onto every member.

    Type Declaration

    • { kind: "string"; value: string }
      • kind: "string"
      • value: string

        A RESP2 simple string (+), which never contains CR or LF.

    • { kind: "error"; value: string }
      • kind: "error"
      • value: string

        The error message, from either a simple error (-) or a bulk error (!).

    • { kind: "number"; value: number }
      • kind: "number"
      • value: number

        A signed 64-bit integer (:); values past 2^53 lose precision as a JS number.

    • { kind: "bulk"; value: Uint8Array }
      • kind: "bulk"
      • value: Uint8Array

        The raw bytes of a bulk string ($), which may hold any binary data.

    • { format: string; kind: "verbatim"; value: Uint8Array }
      • format: string

        The 3-byte encoding hint the server sent, e.g. 'txt'.

      • kind: "verbatim"
      • value: Uint8Array

        The raw bytes of a verbatim string (=), with the encoding prefix stripped.

    • { kind: "null" }
    • { kind: "boolean"; value: boolean }
      • kind: "boolean"
      • value: boolean

        A RESP3 boolean (#).

    • { kind: "double"; value: number }
      • kind: "double"
      • value: number

        A RESP3 double (,); inf, -inf, and nan decode to their JS counterparts.

    • { kind: "bignum"; value: bigint }
      • kind: "bignum"
      • value: bigint

        A RESP3 big number ((), outside the range of a signed 64-bit integer.

    • { kind: "array"; value: RespValue[] }
      • kind: "array"
      • value: RespValue[]

        The array's elements (*), which may be of mixed kinds and nested.

    • { kind: "set"; value: RespValue[] }
      • kind: "set"
      • value: RespValue[]

        The set's members (~): unordered and unique.

    • { kind: "map"; value: [RespValue, RespValue][] }
      • kind: "map"
      • value: [RespValue, RespValue][]

        The map's entries (%) as key-value tuples; keys need not be strings.

    • { kind: "push"; value: RespValue[] }
      • kind: "push"
      • value: RespValue[]

        The push's elements (>), the first of which names the kind of push.

    1.0.6