Documentation Index
Fetch the complete documentation index at: https://docs.forterulesengine.io/llms.txt
Use this file to discover all available pages before exploring further.
removeArrayWrappers(Defined in: src/parsing/internal-parsing-logic.ts:743 Recursively removes unnecessary array wrappers from a nested array structure. If an element in the array is itself an array with only one element, it replaces that element with its single value. If the element is a nested array with more than one element, the function is called recursively on that nested array.array):any[]
Parameters
| Parameter | Type | Description |
|---|---|---|
array | any[] | The array to process, which may contain nested arrays. |
Returns
any[]
A new array with unnecessary wrappers removed, where single-element arrays
are replaced by their single value.