Skip to content
Functionutilsv0.8.17

filterCirculars

Creates a clean, JSON safe copy of a value and replaces circular references with a marker.

In json mode it behaves like stringify then parse with a replacer that handles cycles and BigInt. In decycle mode it first clones without using toJSON, then you can stringify the result later.

filterCirculars<ObjType, Marker>(
    value: ObjType,
    options?: FilterCircularsOptions<Marker>
): JsonifyWithCirculars<ObjType, Marker> | UnserializableValue

ObjType

Type of the input value.

ObjType

Type of the input value.

Marker

Marker string used for circular references.

Marker

Marker string used for circular references.

value

value: ObjType

The value to clone safely.