Bootstrap

API coercion

auBooleanAttribute

function

auBooleanAttribute(value): boolean | undefined

Transforms a value (typically a string) to a boolean. Intended to be used as a transform function of an input.

Parameters
value

unknown

Value to be transformed.

Returns

boolean | undefined

the value transformed

Example

readonly status = input({ transform: auBooleanAttribute });


auNumberAttribute

function

auNumberAttribute(value): number | undefined

Transforms a value (typically a string) to a number. Intended to be used as a transform function of an input.

Parameters
value

unknown

Value to be transformed.

Returns

number | undefined

the value transformed

Example

readonly id = input({ transform: auNumberAttribute });