Skip to content

SerializeToJson

SerializeToJson<T>: T extends JsonSerializableSet<infer S> ? ReadonlyArray<S> : T extends JsonSerializableObject ? { [P in keyof T]: SerializeToJson<T[P]> } : T extends JsonSerializableArray ? SerializeToJson<T[number]>[] : BigIntToHex<SetToHex<T>>

A helper type that converts a widened JSON-serializable value to a JSON-serializable value. It replaces bigint with hex strings and sets with arrays.

Type Parameters

T

Defined in

packages/utils/src/SerializeToJson.ts:44