Skip to content

jsonSerializeSafe

jsonSerializeSafe<T>(value, replacer?, options?): JsonSerializeSafeResult<T>

Defined in: packages/core/src/json/json-serialize-safe.ts:24

Serialize a value to a JSON-compatible format.

The function follows the same rules as JSON.stringify, but instead of returning a string, it returns the serialized value directly.

T

T

The value to serialize.

(string | number)[] | null

A function that transforms the result

JsonMakeAllReplacersFunctionOptions

Options to customize the behavior of the serialization, such as handling circular references.

JsonSerializeSafeResult<T>

A JSON representation of the value, or undefined if a “pure” value has been passed in argument.

jsonSerializeSafe<T>(value, replacer?, options?): JsonifySafe<T> | undefined

Defined in: packages/core/src/json/json-serialize-safe.ts:29

Serialize a value to a JSON-compatible format.

The function follows the same rules as JSON.stringify, but instead of returning a string, it returns the serialized value directly.

T

T

The value to serialize.

JsonReplacer

A function that transforms the result

JsonMakeAllReplacersFunctionOptions

Options to customize the behavior of the serialization, such as handling circular references.

JsonifySafe<T> | undefined

A JSON representation of the value, or undefined if a “pure” value has been passed in argument.