async-call-rpc

A lightweight JSON RPC client & server

Home > async-call-rpc > SuccessResponse > undef

SuccessResponse.undef property

Non-standard property

Signature:

undef?: unknown;

Remarks

This is a non-standard field that used to represent the result field should be undefined instead of null.

A field with value undefined will be omitted in JSON.stringify, and if the "result" field is omitted, this is no longer a valid JSON-RPC response object.

By default, AsyncCall will convert undefined to null to keep the response valid, but it _won’t_ add this field.

Set keepUndefined in JSONEncoderOptions to "keep" will add this field.

This field starts with a space, so TypeScript will hide it when providing completion.