Standard Library Functions
The Jyro standard library provides a comprehensive set of functions organized into logical categories for efficient data transformation and processing tasks.
Mathematical Functions
Functions for numeric calculations and mathematical operations.
- Abs - Calculate absolute value of a number
- Max - Find maximum value from multiple arguments
- Min - Find minimum value from multiple arguments
- Round - Round number to specified decimal places
- Sum - Calculate sum of multiple numeric arguments
String Manipulation
Functions for processing and transforming text data.
- Contains - Test if string contains substring or array contains value
- EndsWith - Test if string ends with specified suffix
- Join - Join array elements into single string with delimiter
- Lower - Convert string to lowercase
- Replace - Replace all occurrences of substring with replacement
- Split - Split string into array using delimiter
- StartsWith - Test if string begins with specified prefix
- Trim - Remove leading and trailing whitespace
- Upper - Convert string to uppercase
- ToNumber - Convert a string to a number
Array Operations
Functions for manipulating and processing array data structures.
- Append - Add value to end of array
- Clear - Remove all elements from array
- CountIf - Count elements where field matches value using comparison operator
- Filter - Return new array with elements matching field comparison criteria
- First - Return first element of array without modifying it
- IndexOf - Find index of element in array using deep equality
- Insert - Insert value at specific array index
- Last - Return last element of array without modifying it
- MergeArrays - Combine multiple arrays into single array
- Pop - Remove and return last array element
- RemoveAt - Remove element at specific index and return modified array
- RemoveLast - Remove last element and return modified array
- Reverse - Return new array with elements in reversed order
- Sort - Return new sorted array using type-aware comparison
- SortByField - Sort array of objects by specified field
Date and Time Functions
Functions for handling date parsing, formatting, and calculations.
- DateAdd - Add time interval to date
- DateDiff - Calculate difference between two dates
- DatePart - Extract specific component from date
- FormatDate - Format date using specified pattern
- Now - Get current date and time in UTC
- ParseDate - Parse date string into normalized format
- Today - Get current date without time components
Utility Functions
Miscellaneous functions for inspecting and testing data types, value generation, and calling scripts.
- Base64Decode - Decode Base64-encoded string back to original format
- Base64Encode - Encode a string to Base64 format
- CallScript - Execute Jyro script with isolated data context
- Equal - Test equality between two values
- Exists - Test if value is not null
- InvokeRestMethod - Execute HTTP REST API requests (experimental)
- IsNull - Test if value is null
- Length - Get length/count of strings, arrays, or objects
- NewGuid - Generate a new globally unique identifier (GUID)
- NotEqual - Test inequality between two values
- TypeOf - Get type name of value as string
Usage Patterns
Most functions follow consistent patterns for parameter handling and return values:
- Immutable Transformations: Functions like
Sort,Reverse, andFilterreturn new arrays without modifying the original, enabling predictable data flow and safe composition - Chainable Operations: Array-returning functions can be composed together (e.g.,
Filter(Sort(Filter(...)))) for powerful data transformations - Type Coercion: Functions automatically handle reasonable type conversions (e.g., converting values to strings in
Join) - Error Handling: Functions return null or default values for invalid inputs rather than throwing exceptions
- Safe Access: Functions like
First,Last, andPopreturn null for empty arrays instead of throwing errors - Consistent Operators: Functions like
FilterandCountIfsupport comparison operators:"==","!=","<","<=",">",">="