Property value transform functions.
Methods
-
Coral.transform.boolean
-
- Parameters:
-
Name Type Description value * The value to convert to Boolean. - Returns:
-
The corresponding boolean value. {Boolean}
-
Coral.transform.booleanAttr
-
- Parameters:
-
Name Type Description value * The value to convert to Boolean. - Returns:
-
The corresponding boolean value. {Boolean}
-
Coral.transform.float
-
- Parameters:
-
Name Type Description value * The value to be converted to a Number.
-
Coral.transform.number
-
- Parameters:
-
Name Type Description value * The value to convert to a Number. - Returns:
-
The corresponding number or
null
if the passed value cannot be converted to a number. {Number}
-
Coral.transform.string
-
- Parameters:
-
Name Type Description value * The value to convert to String. - Returns:
-
The corresponding string value. {String}
Transform the provided value into a boolean. Follows the behavior of JavaScript thruty/falsy.
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.
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.
Transforms the provided value into a floating point number.
Transform the provided value into a string. When given
null
or undefined
it will be
converted to an empty string("").