Simple

Simple

A CBOR Simple Value that does not map onto a known constant.

Constructor

new Simple(value)

Creates an instance of Simple.
Source:
Parameters:
Name Type Description
value integer the simple value's integer value

Methods

(static) decode(val, has_parent) → {null|undefined|bool|Symbol}

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.
Source:
Parameters:
Name Type Description
val number the CBOR additional info to convert
has_parent bool Does the CBOR item have a parent?
Returns:
Type:
null | undefined | bool | Symbol
- the decoded value

(static) isSimple(obj) → {bool}

Is the given object a Simple?
Source:
Parameters:
Name Type Description
obj any object to test
Returns:
Type:
bool
- is it Simple?

encodeCBOR(gen)

Push the simple value onto the CBOR stream
Source:
Parameters:
Name Type Description
gen cbor.Encoder The generator to push onto

inspect() → {string}

Debug string for simple value
Source:
Returns:
Type:
string
simple(value)

toString() → {string}

Debug string for simple value
Source:
Returns:
Type:
string
simple(value)