Skip to main content

Math functions

abs

Returns the absolute value.

floor

Rounds down to the nearest integer.

ceil

Rounds up to the nearest integer.

round

Rounds to the nearest integer or decimal places.

trunc

Truncates toward zero.

min

Returns the minimum value from an array.

max

Returns the maximum value from an array.

sum

Returns the sum of array values.

avg

Returns the average of array values.

median

Returns the median of array values.

mode

Returns the most frequent value.

rand

Returns a random number between 0 and the specified maximum.

String functions

len

Returns the length of a string or array.

upper

Converts to uppercase.

lower

Converts to lowercase.

trim

Removes leading and trailing whitespace.

contains

Checks if a string contains a substring, or array contains a value.

startsWith

Checks if a string starts with a prefix.

endsWith

Checks if a string ends with a suffix.

matches

Tests a string against a regular expression.

extract

Extracts groups from a regular expression match.

split

Splits a string by delimiter.

fuzzyMatch

Returns a similarity score (0-1) between strings.

Array functions

These functions iterate over arrays. Use # for the current element, or as for a named alias:

map

Transforms each element.

filter

Keeps elements matching a condition.

some

Returns true if any element matches.

all

Returns true if all elements match.

one

Returns true if exactly one element matches.

none

Returns true if no elements match.

count

Counts elements matching a condition.

flatMap

Maps and flattens results.

keys

Returns object keys or array indices.

values

Returns object values.

merge

Combines an array of arrays or an array of objects into a single result. Arrays — concatenates all arrays into one:
Objects — combines all objects, last value wins for duplicate keys:

mergeDeep

Recursively merges an array of objects. Unlike merge, nested objects are combined rather than replaced, and nested arrays are concatenated. Nested objects — recursively merged:
Nested arrays — concatenated:
Scalar values — last value wins:

Date functions

d

Creates a date object. See Date operations for full documentation.

duration

Parses a duration string to seconds.

Type functions

string

Converts to string.

number

Converts to number.

bool

Converts to boolean.

type

Returns the type as a string.

isNumeric

Checks if a value is numeric or can be converted to a number.