A codec turns a raw wire value into a rich value and back.
hydrate
undefined
onInvalid
serialize
TypeError
equals
Readonly
Returns true if the two values are equal.
true
Turns a raw wire value into a value. It returns undefined for null, undefined or bad input.
null
Optional
Returns true if the input is a value of this codec.
Optional. Gives a primitive key for a value. Two values that equals says are equal have the same key. setOf uses it to find duplicates fast.
setOf
The strict, quiet read. It throws on bad input, and on null or undefined, and sends no report to onInvalid. Composite codecs and validation use it. defineCodec always sets it.
defineCodec
Turns a value into a raw wire value. It returns null for null or undefined.
A codec turns a raw wire value into a rich value and back.
hydrateis forgiving. Bad wire data givesundefinedand a report throughonInvalid. It never throws, so one bad field does not fail a whole response.serializeis strict. A value of the wrong type throws aTypeError.equalscompares two values. Dirty checks use it.