Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

JSONCodec

import { JSONCodec } from "https://raw.githubusercontent.com/nats-io/nats.deno/v1.28.2/nats-base-client/internal_mod.ts";

Returns a Codec for encoding JavaScript object to JSON and serialize them to an Uint8Array, and conversely, from an Uint8Array to JSON to a JavaScript Object.

function JSONCodec<T = unknown>(reviver?: (
this: unknown,
key: string,
value: unknown,
) => unknown
): Codec<T>;
§
JSONCodec<T = unknown>(reviver?: (this: unknown, key: string, value: unknown) => unknown): Codec<T>
[src]

§Type Parameters

§
T = unknown
[src]

§Parameters

§
reviver?: (this: unknown, key: string, value: unknown) => unknown optional
[src]

§Return Type