MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getLabelBlocks

Function getLabelBlocks

gulpfile.mjs:244–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242
243let labelBlocks;
244const getLabelBlocks = async () => {
245 if (labelBlocks == null) {
246 labelBlocks = new Map();
247 await allModules(async (module) => {
248 [
249 ...(
250 await promises.readFile(`src/@types/${module}/docs.js`, UTF8)
251 ).matchAll(TYPES_DOC_BLOCKS),
252 ].forEach(([_, block, label]) => {
253 if (labelBlocks.has(label)) {
254 throw new Error(`Duplicate label '${label}' in ${module}`);
255 }
256 labelBlocks.set(label, block);
257 });
258 });
259 }
260 return labelBlocks;
261};
262
263const copyDefinition = async (dir, module) => {
264 const labelBlocks = await getLabelBlocks();

Callers 1

copyDefinitionFunction · 0.85

Calls 1

allModulesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…