decodeMap
Decodes a CBOR encoded map. Calls a decoder function for each key-value pair (nothing is returned directly).
The decoder function is responsible for separating the key from the value, which are simply stored as consecutive CBOR elements.
export function decodeMap(
bytes: BytesLike,
keyDecoder: Decoder<TKey>,
valueDecoder: Decoder<TValue>
): [TKey, TValue][]
Arguments
Name | Type | Description |
---|---|---|
bytes | BytesLike | |
keyDecoder | Decoder<TKey> | |
valueDecoder | Decoder<TValue> |
Return value
[TKey, TValue][]