Skip to content

Function: asBoolean()

asBoolean(options?): TTransformer<boolean, TBoolean>

Create a boolean transformer. Accept case-insensitive 'true' or 'false' and 0 or 1.

Parameters

ParameterTypeDescription
options?SchemaOptionsValidation options (see SchemaOptions)

Returns

TTransformer<boolean, TBoolean>

Example

ts
Column('isDone', asBoolean());

Defined in

src/transformer/as-boolean.ts:14

Released under the MIT License.