MCPcopy
hub / github.com/danvk/source-map-explorer / getTreeDataMap

Function getTreeDataMap

src/lib/html.ts:18–33  ·  view source on GitHub ↗

* Get webtreemap data to update map on bundle select

(exploreResults: ExploreBundleResult[])

Source from the content-addressed store, hash-verified

16 * Get webtreemap data to update map on bundle select
17 */
18function getTreeDataMap(exploreResults: ExploreBundleResult[]): { [id: number]: WebTreeData } {
19 let treeData = exploreResults.map<WebTreeData>((data) => ({
20 name: data.bundleName,
21 data: getWebTreeMapData(data.files),
22 }));
23
24 if (treeData.length > 1) {
25 treeData = [makeMergedTreeDataMap(cloneDeep(treeData)), ...treeData];
26 }
27
28 for (const webTreeData of treeData) {
29 addSizeToTitle(webTreeData.data, webTreeData.data.data['$area']);
30 }
31
32 return { ...treeData };
33}
34
35/**
36 * Generate HTML file content for specified files

Callers 1

generateHtmlFunction · 0.85

Calls 3

getWebTreeMapDataFunction · 0.85
makeMergedTreeDataMapFunction · 0.85
addSizeToTitleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…