Value interface

Wraps a parameter value with metadata and type-safe getters.

Type-safe getters insulate application logic from remote changes to parameter names and types.

Signature:

export interface Value 

Methods

Method Description
asBoolean() Gets the value as a boolean.The following values (case insensitive) are interpreted as true: "1", "true", "t", "yes", "y", "on". Other values are interpreted as false.
asNumber() Gets the value as a number. Comparable to calling Number(value) || 0.
asString() Gets the value as a string.
getSource() Gets the ValueSource for the given key.

Value.asBoolean()

Gets the value as a boolean.

The following values (case insensitive) are interpreted as true: "1", "true", "t", "yes", "y", "on". Other values are interpreted as false.

Signature:

asBoolean(): boolean;

Returns:

boolean

Value.asNumber()

Gets the value as a number. Comparable to calling Number(value) || 0.

Signature:

asNumber(): number;

Returns:

number

Value.asString()

Gets the value as a string.

Signature:

asString(): string;

Returns:

string

Value.getSource()

Gets the ValueSource for the given key.

Signature:

getSource(): ValueSource;

Returns:

ValueSource