getCategoryTree
Constructs a hierarchical category tree from an array of fully qualified category strings. The categories must all start with the same prefix, either "/categories/" or "/Categories/". Intermediary nodes are created as necessary to complete the tree structure.
Parameters
| Parameter | Type | Default | Notes |
|---|---|---|---|
| categories Required | string[] |
An array of fully qualified category strings. |
Returns
An ICategoryTree representing the hierarchical structure of the categories.
| Property | Type | Notes |
|---|---|---|
| Record<stringICategoryTree> | ||
| string | ||
| string |
Function defined in packages/common/src/core/schemas/internal/categories/getCategoryTree.ts:26