A lightweight JSON RPC client & server
Home > async-call-rpc > JSONSerialization
Create a serialization by JSON.parse/stringify
Signature:
JSONSerialization: (replacerAndReceiver?: [(((key: string, value: any) => any) | undefined)?, (((key: string, value: any) => any) | undefined)?], space?: string | number | undefined, undefinedKeepingBehavior?: 'keep' | 'null' | false) => Serialization
Parameter | Type | Description |
---|---|---|
replacerAndReceiver | [(((key: string, value: any) => any) | undefined)?, (((key: string, value: any) => any) | undefined)?] | (Optional) Replacer and receiver of JSON.parse/stringify |
space | string | number | undefined | (Optional) Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. |
undefinedKeepingBehavior | ‘keep’ | ‘null’ | false | <p>(Optional) How to keep “undefined” in result of SuccessResponse?</p><p>If it is not handled properly, JSON.stringify will emit an invalid JSON RPC object.</p><p>Options: - "null" (**default**): convert it to null. - "keep" : try to keep it by additional property “undef”. - false : Don’t keep it, let it break.</p> |
Returns: