API Reference
assertStrictJsonValue()
Validate and normalize a host value into strict canonical JSON data.
Import
import { assertStrictJsonValue } from "@graphrefly/ts";
Signature
function assertStrictJsonValue(
value: unknown,
label = "strictJsonValue",
): StrictJsonValue
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | Unknown value to check or decode. |
label | unknown | label value used by the helper. |
Returns
The narrowed, validated value.
Example
import { assertStrictJsonValue } from "@graphrefly/ts";
Source
packages/ts/src/json/codec.ts