- Notifications
You must be signed in to change notification settings - Fork 0
JsonKit.Serialize
github-actions[bot] edited this page Jul 30, 2023
·
1 revision
JsonKit.Serialize
▸ 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})| Name | Description |
|---|---|
T | Type of the output object |
| Name | Type | Description |
|---|---|---|
obj | any | The 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. |
T
The JSON object
▸ 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}))| Name | Description |
|---|---|
T | Type of the output object |
| Name | Type | Description |
|---|---|---|
obj | any | The 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. |
T
The EJSON object