MCPcopy Create free account
hub / github.com/EsperoTech/yaade / getParentTree

Function getParentTree

client/src/utils/env.tsx:6–13  ·  view source on GitHub ↗
(collections: Collection[], collectionId: number)

Source from the content-addressed store, hash-verified

4import { findCollection } from '../state/collections';
5
6function getParentTree(collections: Collection[], collectionId: number): Collection[] {
7 const c = findCollection(collections, collectionId);
8 if (!c) return [];
9
10 if (!c.data?.parentId) return [c];
11
12 return [c, ...getParentTree(collections, c.data?.parentId)];
13}
14
15function getMergedEnvData(
16 collections: Collection[],

Callers 2

getMergedEnvDataFunction · 0.85
getMergedHeadersFunction · 0.85

Calls 1

findCollectionFunction · 0.90

Tested by

no test coverage detected