Skip to content

Class: Boolean

Hierarchy

Enum

Boolean

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

+ new Boolean(defaultVal: any, flags: any): Boolean

Overrides Enum.constructor

Defined in lib/fields/Boolean.ts:5

Parameters:

Name Type
defaultVal any
flags any

Returns: Boolean

Properties

default

default: any

Inherited from Field.default

Defined in lib/Field.ts:13

The value to be returned from Field.prototype.parse when invoked with undefined or null. Note that providing a defualt value effectively renders the field optional.


flags

flags: number

Inherited from Field.flags

Defined in lib/Field.ts:16

A bit field representing a set of boolean flags.


lastError

lastError: string

Inherited from Field.lastError

Defined in lib/Field.ts:19

The error message produced by the last call to Field.prototype.parse, if it was unsuccessful.


rules

rules: any[] = []

Inherited from Text.rules

Defined in lib/fields/Text.ts:8

Methods

assert

assert(rule: any, expect: boolean, message: string): void

Inherited from Text.assert

Defined in lib/fields/Text.ts:21

Parameters:

Name Type Default
rule any -
expect boolean true
message string ""

Returns: void


clone

clone(): Field

Inherited from Field.clone

Defined in lib/Field.ts:39

Returns a copy of the Field instance.

Returns: Field


hasFlag

hasFlag(flag: number): boolean

Inherited from Field.hasFlag

Defined in lib/Field.ts:34

Checks if the specified flag is set on Field.prototype.flags.

Parameters:

Name Type Description
flag number A bit mask.

Returns: boolean

A boolean determining whether or not the flag is present.


parse

parse(value: any): Promise‹any›

Overrides Text.parse

Defined in lib/fields/Boolean.ts:10

Parameters:

Name Type
value any

Returns: Promise‹any›

Object literals

Static Flags

Flags: object

Inherited from Field.Flags

Defined in lib/Field.ts:5

OPT

OPT: number = 1

Defined in lib/Field.ts:7

OPTIONAL denotes that a field should have a default value of null.

PRV

PRV: number = 2

Defined in lib/Field.ts:9

PRIVATE denotes that a field should not be exposed.