HyperFormula 2.4.0: More public APIs and better test coverage
We’ve just released HyperFormula 2.4.0. This version improves the capabilities of custom functions by exposing more public APIs, increases test coverage, and brings a few bug fixes.
More public APIs
HyperFormula offers a variety of APIs that let you quickly and precisely control the engine’s behavior according to your needs, from basic actions such as moving columns or adding named expressions, to features like operation batching or updating the configuration at runtime.
Custom error messages
One of HyperFormula’s advantages is custom functions. If the already extensive list of nearly 400 built-in functions doesn’t match your needs, adding a custom function allows you to implement any logic you want.
Now, suppose the end user uses your custom function in a formula, but they make a mistake – you want to let them know what went wrong. That’s where the newly-exported
CellError API comes in. It lets you:
- Display the type of the error (e.g.,
- Convey a user-friendly message
- Point to the root of the problem
Custom functions can handle ranges
Your custom functions are not limited to processing individual cells: they can also accept and return whole ranges of cells at once. This significantly increases the number of potential use cases.
To handle ranges, you’ll need the other class exported in version 2.4.0:
SimpleRangeValue. This API lets you:
- Create ranges in different ways
- Generate values and addresses of a range’s cells
- Compare the size of two different ranges
For more details on handling ranges in custom functions, see HyperFormula’s documentation.
Better test coverage
In this version, thanks to the effort of a prolific community member (thank you, thilgen) HyperFormula increased its test coverage from 95.86% to 97.05%. Step by step, together we’re making it better.
Removing a column works more consistently now: the
removeColumns() method returns the same array of changes regardless of the address mapping policy used. Also, methods
setCellContents() can now operate on cells that contain
null values, without causing any issues.
What we added
- Exported the
CellErrorclass as a public API. #1232
- Exported the
SimpleRangeValueclass as a public API. #1178
What we fixed