Functions
atan2
atan2(x, y)
Returns the inverse tangent of x
/y
in radians between -pi and pi.
Code example
atan2(3, 2) -> 0.982793723247329
case
case(x, c1, r1, c2, r2, ..., (default))
Compare x
to each of c1
, c2
, etc. and return the matching r1
, r2
of the first match. If no entry matches, a final optional expression can be returned as default.
Code examples
case("b", "a", 1, "b", 2, "c", 3, 0) -> 2
case("d", "a", 1, "b", 2, "c", 3, 0) -> 0
ceil
ceil(x)
Returns x
rounded up to the nearest integer.
Code example
ceil(16.2) -> 17
chars
chars(x)
Creates an array of characters from a string.
Code example
"test".chars() -> ["t", "e", "s", "t"]
chunk
chunk(x, s)
Converts the list x
into several lists of length at most s
Code example
chunk([1, 2, 3, 4, 5, 6, 7], 3) -> [[1, 2, 3], [4, 5, 6], [7]]
concat
concat(x, y, ...)
Concatenate any number of strings.
Code examples
concat("Hello, ", "world!") -> "Hello, world!"
{
"externalId": concat("some-prefix:", input.tag)
}
distinct_by
distinct_by(x, (a(, b)) => ...)
Returns a list or object where the elements are distinct by the returned value of the given lambda function. The lambda function either takes list values, or object (value, key) pairs.
Code example
[1, 2, 3, 4, 5].distinct_by(x => x % 2) -> [1, 2]
except
except(x, (v(, k)) => ...)
or except(x, l)
Returns a list or object where keys or entries maching the predicate have been removed.
If the second argument is a lambda, it will be given the entry and if it returns true
, the entry is removed.
If the second argument is a list, any entry also found in this list will be removed.
Code examples
{
"x-axis": 13.6,
"y-axis": 63.1,
"z-axis": 1.4,
"offset": 4.3,
"power": "on"
}.except(["offset", "power"])
->
{
"x-axis": 13.6,
"y-axis": 63.1,
"z-axis": 1.4
}