Transformation
Set of property value transformation functions.
Method Summary
Public Methods | ||
public |
Transform the provided value into a boolean. |
|
public |
booleanAttr(value: *): Boolean Transform the provided value into a boolean. |
|
public |
float(value: *): * Transforms the provided value into a floating number. |
|
public |
Transforms the provided value into a floating point number. |
|
public |
Transform the provided value into a string. |
Public Methods
public boolean(value: *): Boolean source
Transform the provided value into a boolean. Follows the behavior of JavaScript thruty/falsy.
Params:
Name | Type | Attribute | Description |
value | * | The value to convert to Boolean. |
public booleanAttr(value: *): Boolean source
Transform the provided value into a boolean. Follows the behavior of the HTML specification, in which the existence of
the attribute indicates true
regardless of the attribute's value. If the value is a boolean, it ignores
the transformation.
Params:
Name | Type | Attribute | Description |
value | * | The value to convert to Boolean. |
public float(value: *): * source
Transforms the provided value into a floating number. The conversion is strict in the sense that if non numeric values
are detected, null
is returned instead.
Params:
Name | Type | Attribute | Description |
value | * | The value to be converted to a Number. |
Return:
* |