mqttJsonCodec
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
mqttJsonCodec<
T>(options?):MqttCodec<T>
Defined in: src/io/broker/MqttCodec.ts:75
Default codec: entities ↔ UTF-8 JSON. encode runs JSON.stringify
then UTF-8 encodes; decode UTF-8 decodes then JSON.parses.
Pass validate to run a schema check (e.g. a zod parser) on the
parsed value — it receives the unknown parse result and must return
(or throw for) a T. A thrown validator is wrapped as a
MqttDecodeError.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”options?
Section titled “options?”validate?
Section titled “validate?”(value) => T
Returns
Section titled “Returns”MqttCodec<T>
