MCPcopy Create free account
hub / github.com/massCodeIO/massCode / visit

Function visit

src/main/import/snippets/snippetsLab.ts:75–90  ·  view source on GitHub ↗
(folder: SnippetsLabRecord, parentPath: string[])

Source from the content-addressed store, hash-verified

73 const map = new Map<string, string[]>()
74
75 function visit(folder: SnippetsLabRecord, parentPath: string[]) {
76 const uuid = readString(folder, 'uuid')
77 const title = normalizeImportEntryName(
78 readString(folder, 'title'),
79 'Imported',
80 )
81 const folderPath = [...parentPath, title]
82
83 if (uuid) {
84 map.set(uuid, folderPath)
85 }
86
87 getRecordArray(folder, 'children').forEach(child =>
88 visit(child, folderPath),
89 )
90 }
91
92 folders.forEach(folder => visit(folder, []))
93

Callers 1

buildFolderPathMapFunction · 0.70

Calls 4

normalizeImportEntryNameFunction · 0.90
getRecordArrayFunction · 0.85
readStringFunction · 0.70
setMethod · 0.45

Tested by

no test coverage detected