Skip to content

getField

getField<Desc>(message, field): Message | ScalarValue | MessageShape<Desc>[keyof MessageShape<Desc>] | undefined

Defined in: packages/core/src/field.ts:42

Gets the value of the field on a message. If the field is a oneof, the value is returned from the oneof field. If the field is not a oneof, the value is returned from the field directly.

Desc extends DescMessage

MessageShape<Desc>

DescField

Message | ScalarValue | MessageShape<Desc>[keyof MessageShape<Desc>] | undefined