GraphReFlyTS

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

ParameterTypeDescription
valueunknownUnknown value to check or decode.
labelunknownlabel value used by the helper.

Returns

The narrowed, validated value.

Example

import { assertStrictJsonValue } from "@graphrefly/ts";

Source

packages/ts/src/json/codec.ts