Home > @rushstack/lookup-by-path > IReadonlyLookupByPath > groupByChild
IReadonlyLookupByPath.groupByChild() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Groups the provided map of info by the nearest entry in the trie that contains the path. If the path is not found in the trie, the info is ignored.
Signature:
groupByChild<TInfo>(infoByPath: Map<string, TInfo>, delimiter?: string): Map<TItem, Map<string, TInfo>>;
Parameters
Parameter | Type | Description |
|---|---|---|
infoByPath | Map<string, TInfo> | The info to be grouped, keyed by path |
delimiter | string | (Optional) |
Returns:
Map<TItem, Map<string, TInfo>>
The grouped info, grouped by the nearest entry in the trie that contains the path