Support Transformers
Support transformers can be used on any data type. Following transformers are available:
isString
isStringOutputs true or falseon whether the source String.
Usage:
.isString()Example usage:
value.isString()Example return:
"bob"totrue
isArray
isArrayOutputs true or falseon whether the source is Array.
Usage:
.isArray()Example usage:
value.isArray()Example return:
["bob", "man"]totrue
isDictionary
isDictionaryOutputs true or falseon whether the source is Dictionary.
Usage:
.isDictionary()Example usage:
value.isDictionary()Example return:
["age": 21]totrue
isNumber
isNumberOutputs true or falseon whether the source is Number.
Usage:
.isNumber()Example usage:
value.isNumber()Example return:
69420totrue
isBool
isBoolOutputs true or falseon whether the source is Bool.
Usage:
.isBool()Example usage:
value.isBool()Example return:
falsetotrue
isNull
isNullOutputs true or falseon whether the source is null.
Usage:
.isNull()Example usage:
value.isNull()Example return:
falsetotrue
toString
toStringDescribes values that otherwise throw an error when used in substitutions. For example, a dictionary can't be printed by {{ dict }}, however, it can be printed using {{ dict.toString() }}. This method fully describes Dictionary, Array, String, Number or Bool.
Usage:
.toString()Example usage:
value.toString()Example return:
["age": 21]to"["age": 21]"
equals
equalsReturns boolean based on whether value equals another value. Both values must be of the same type, otherwise equals always returns true.
Usage:
.equals(value)Example usage:
"Tom".equals("Tom")Example return:
true
Last updated
Was this helpful?