A RESP2 simple string (+), which never contains CR or LF.
The error message, from either a simple error (-) or a bulk error (!).
A signed 64-bit integer (:); values past 2^53 lose precision as a JS number.
The raw bytes of a bulk string ($), which may hold any binary data.
The 3-byte encoding hint the server sent, e.g. 'txt'.
The raw bytes of a verbatim string (=), with the encoding prefix stripped.
A RESP3 boolean (#).
A RESP3 double (,); inf, -inf, and nan decode to their JS counterparts.
A RESP3 big number ((), outside the range of a signed 64-bit integer.
The array's elements (*), which may be of mixed kinds and nested.
The set's members (~): unordered and unique.
The push's elements (>), the first of which names the kind of push.
One decoded RESP value as a tag-on-
kinddiscriminated union.Covers every RESP2 and RESP3 type; branch on
kindto read the type-specificvalue. The RESP2 null forms ($-1,*-1) and the RESP3 null (_) all decode to{ kind: 'null' }, so callers never have to tell them apart. The optionalattributesslot is spread onto every member.