Field

source

Constructors

new Field<T extends Type = Type>(type: T): Fieldsource

Properties

_compareEquality: EqCompareFnsource

_compareOrder: OrdCompareFnsource

alias: stringsource

The key used when serialising this value, if it differs from the field name.

commentText: stringsource

The comment for this field.

isOptional: booleansource

If set, the value may be null or absent.

treatEmptyValuesAsMissing: booleansource

If set, implies optional, with the further relaxation that a value may also be 'empty', where the definition of 'empty' depends on the serialised datatype of the value. For example, an array or map with no elements would be considered empty, and a numeric zero is considered empty. An empty value will be treated as if it is absent.

readonlytype: Tsource

Methods

Instance methods

as(alias: string): Fieldsource

clone(withValues: Partial<Field<T>>): Fieldsource

comment(commentText: string): Fieldsource

maybeEmpty(): Fieldsource

optional(): Fieldsource