2.1.2
Transform JavaScript values into CBOR bytes
(Object
= {}
)
Transform binary cbor data into JavaScript objects.
(Object
= {}
)
Output the diagnostic format from a stream of CBOR bytes.
Extends Decoder
A CBOR tagged item, where the tag does not have semantics specified at the moment, or those semantics threw an error during parsing. Typically this will be an extension point you're not yet expecting.
(Number)
the number of the tag
(any)
the value inside the tag
(Error)
the error that was thrown parsing the tag, or null
If we have a converter for this type, do the conversion. Some converters are built-in. Additional ones can be passed in. If you want to remove a built-in converter, pass a converter in whose value is 'null' instead of a function.
(Object)
keys in the object are a tag number, the value
is a function that takes the decoded CBOR and returns a JavaScript value
of the appropriate type. Throw an exception in the function on errors.
any
:
the converted item
A CBOR Simple Value that does not map onto a known constant.
(integer)
the simple value's integer value
Is the given object a Simple?
(any)
object to test
bool
:
is it Simple?
Decode from the CBOR additional information into a JavaScript value.
If the CBOR item has no parent, return a "safe" symbol instead of
null
or undefined
, so that the value can be passed through a
stream in object mode.
(Number)
the CBOR additional info to convert
(bool)
Does the CBOR item have a parent?
(null | undefined | Boolean | Symbol)
:
the decoded value