Jyro 0.3.0 - Improved Stdlib Composability

We're releasing updates to the Jyro standard library that improve API consistency and enable more powerful function composition patterns. These changes affect several array manipulation functions and introduce new capabilities for working with collections.

The Sort and Reverse functions now return new arrays instead of modifying the original. This change aligns these functions with other transformation operations like Filter and enables predictable data flow in complex scripts. This pattern prevents unintended side effects when arrays are passed through multiple transformation steps or reused in different contexts.

The Filter and CountIf functions now support comparison operators, expanding their capabilities beyond simple equality checks. The operator parameter accepts "==", "!=", "<", "<=", ">", and ">=".

The RemoveAt and RemoveLast functions now return the modified array to support method chaining. The new Pop function provides the previous behavior when you need to retrieve the removed element.

Three new functions provide null-safe access to array elements:

  • First(array) - Returns the first element or null if empty

  • Last(array) - Returns the last element or null if empty

  • Pop(array) - Removes and returns the last element or null if empty

These functions eliminate the need for manual bounds checking and make code more readable.

The Base64Decode function complements the existing Base64Encode, enabling round-trip encoding scenarios for API integration and data transmission.

Scripts using the previous API will require updates:

  • Sort and Reverse calls must capture the return value

  • Filter and CountIf calls need an operator parameter added

  • Code using RemoveAt or RemoveLast return values should switch to Pop or access elements before removal

These updates are available in the latest Jyro release. The standard library now includes 50 functions across mathematical, string, array, date/time, and utility categories.

Next
Next

Host-side Function Plugin Support for Jyro