Skip to content

Interface: ListToTreeOptions<T>

Type Parameters

Type ParameterDefault type
Tany

Properties

PropertyTypeDescription
childrenKey?stringThe key to use for storing children. Default: 'children'
idKey?stringThe key to use as the unique identifier for each item. Default: 'id'
keepEmptyChildren?booleanWhether to keep empty children arrays. Default: true
parentKey?stringThe key to use as the parent identifier for each item. Default: 'parentId'
transformNode?(node) => TFunction to transform each node before processing. Default: (node) => node

Released under the MIT License.