class staticbo.dataTypes. Boolean
Source: data-types/
Provide methods to work with Boolean data.
Property
new Boolean()
Creates Boolean data type definition.
- Extends
- bo.dataTypes.DataType
Property
read-onlyname
string
The name of the data type. The default value is the name of the constructor.
- Inherited from
- bo.dataTypes.DataType#name
Methods
hasValue(value) → boolean
Checks if value is a Boolean data and is not null.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
value |
data |
|
The value to check. |
- Returns
-
boolean
True if the value is Boolean and not null, otherwise false.
abstractisValid([value]) → any type
Abstract method to check if the value conforms to the data type definition. Returns the value when it has the required data type. If not, but it can be converted into the required data type, then returns the converted value. Otherwise returns undefined to mark the value as invalid.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
value |
|
Yes |
The value to check. |
- Inherited from
- bo.dataTypes.DataType#isValid
- Throws
-
Not implemented error: The DataType.check method is not implemented.
- Returns
-
The value in the defined data type or null when the value is valid, otherwise undefined.
parse([value]) → any type
Checks if value is a Boolean data.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
value |
any type |
Yes |
The value to check. |
- Returns
-
any type
The Boolean value or null when the input value is valid, otherwise undefined.