You can now add special sentinel values for CBOR null and undefined. Just set
cbor.null
cbor.undefined
or
cbor_s.null
cbor_s.undefined
(depending upon the module you are using) to some unique value. If this value
is seen when encoding, the respective CBOR value is used, and this value will
be used when decoding. Example:
cbor = require "org.conman.cbor"
cbor.null = {} -- unique values
cbor.undefined = {}
a = { alpha = 1 , beta = cbor.null , gamma = cbor.undefined }
b = cbor.encode(a)
c = cbor.decode(b)
-- a should be equal to c