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
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
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[] = []
Defined in lib/fields/Text.ts:8
Methods
assert
▸ assert(rule
: any, expect
: boolean, message
: string): void
Defined in lib/fields/Text.ts:21
Parameters:
Name | Type | Default |
---|---|---|
rule |
any | - |
expect |
boolean | true |
message |
string | "" |
Returns: void
clone
▸ clone(): Field
Defined in lib/Field.ts:39
Returns a copy of the Field
instance.
Returns: Field
hasFlag
▸ hasFlag(flag
: number): boolean
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›
Defined in lib/fields/Boolean.ts:10
Parameters:
Name | Type |
---|---|
value |
any |
Returns: Promise‹any›
Object literals
Static
Flags
▪ Flags: object
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.