@samatawy/rules
    Preparing search index...

    Functions

    Built-in functions are grouped below by what they operate on.

    You can always declare your own functions if these lack what you need.

    Please note that there is no overloading of functions, so no two functions can have the same name.

    However, the same function can have aliases for convenience and expressibility.

    N.B. There are a total of 289 function names in the core package. Of these, 102 are aliases, so only 187 distinct implementations. Functions that compile into native code for performance are 147 leaving 40 only reachable through expression traversal.

    Use snake_case names whenever possible. Many functions may offer a camelCase alternative name to suit common styles, but snake_case allows more clarity in longer names so it is recommended as the default.

    These compare, inspect, and manipulate numbers. They include functions commonly used in algebra and trigonometry.

    Full list

    These compare, inspect, and manipulate strings. They all work with UTF strings so any language can be handled.

    Full list

    These compare, inspect, and manipulate date/time values.

    Full list

    These make using conditions more expressive in your syntax.

    Full list

    These enable working with arrays, whether literals or variables. You can inspect or manipulate arrays. Lambda functions provide a way to apply logic to each element of an array.

    Full list

    These convert numeric values from one unit to another. When there is no direct function for a specific pair, conversions can be chained through a shared unit.

    Full list

    Physics and chemistry functions are available from the separate @samatawy/rules-science package rather than the core package.

    Full list

    Geography and country-data functions are available from the separate @samatawy/rules-world package rather than the core package.

    Full list

    You can declare your own functions if the built-in ones do not make your rules expressive enough.

    Declaring Custom Functions