UNPKG

@loken/hierarchies

Version:

Library for working with hierarchies of identifiers and identifiable objects.

9 lines 589 B
import { type Multiple } from '@loken/utilities'; import { HCNode } from './node.js'; /** Extract the `Item` from each of the `nodes`. */ export declare const nodesToItems: <Item>(nodes: Multiple<HCNode<Item>>) => Item[]; /** Extract the `Id` from the `node.item`. */ export declare const nodeToId: <Item, Id = Item>(node: HCNode<Item>, identify?: (item: Item) => Id) => Id; /** Extract the `Id` from each `node.item`. */ export declare const nodesToIds: <Item, Id = Item>(nodes: Multiple<HCNode<Item>>, identify?: (item: Item) => Id) => Id[]; //# sourceMappingURL=node-conversion.d.ts.map