Interface: IConversionOptions

IConversionOptions

Conversion options as used by Type#toObject and Message.toObject.

Properties:
longs function <optional>

Long conversion type.
Valid values are BigInt, String and Number (the global types).
Defaults to copy the present value, which is a possibly unsafe number without and a Long with a long library.

enums function <optional>

Enum value conversion type.
Only valid value is String (the global type).
Defaults to copy the present value, which is the numeric id.

bytes function <optional>

Bytes value conversion type.
Valid values are Array and (a base64 encoded) String (the global types).
Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.

defaults boolean <optional>
false

Also sets default values on the resulting object

arrays boolean <optional>
false

Sets empty arrays for missing repeated fields even if defaults=false

objects boolean <optional>
false

Sets empty objects for missing map fields even if defaults=false

oneofs boolean <optional>
false

Includes virtual oneof properties set to the present field's name, if any

json boolean <optional>
false

Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings