Skip to content

JsonKit.Serialize

github-actions[bot] edited this page Jul 30, 2023 · 1 revision

Namespace: Serialize

JsonKit.Serialize

Table of contents

Functions

Functions

deserialize

deserialize<T>(obj, typeGuard?): T

Turns the input object into an JSON object.

Remarks

It is equivalent to (except a bit more performant due to custom options)

letobj={ ... }parse(stringify(obj),{extended: true})

Type parameters

NameDescription
TType of the output object

Parameters

NameTypeDescription
objanyThe input object
typeGuard?TypeGuardFunction<T>The type guard function, ensures that the output object is of the expected type, refer to TypeGuardFunction for an example.

Returns

T

The JSON object

Defined in

serialize.ts:55


serialize

serialize<T>(obj, typeGuard?): T

Turns the input object into an EJSON object.

Remarks

It is equivalent to (except a bit more performant due to custom options)

letobj={ ... }parse(stringify(obj,{extended: true}))

Type parameters

NameDescription
TType of the output object

Parameters

NameTypeDescription
objanyThe input object
typeGuard?TypeGuardFunction<T>The type guard function, ensures that the output object is of the expected type, refer to TypeGuardFunction for an example.

Returns

T

The EJSON object

Defined in

serialize.ts:20

Clone this wiki locally