getCategoryTree

Function

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
children Record<stringICategoryTree>
label string
value string

Function defined in common/src/core/schemas/internal/categories/getCategoryTree.ts:26