class staticbo.dataTypes. Email
Source: data-types/
Provide methods to work with Email data.
Property
new Email()
Creates Email 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 an Email data and is not null.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
value |
data |
|
The value to check. |
- Returns
-
boolean
True if the value is Email 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 an Email data.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
value |
any type |
Yes |
The value to check. |
- Returns
-
any type
The Email value or null when the input value is valid, otherwise undefined.