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

Function parseCodeBlocks

test/unit/documentation.test.ts:341–347  ·  view source on GitHub ↗
(block: string)

Source from the content-addressed store, hash-verified

339 .replace(/export (const|class) /gm, '$1 ');
340
341const parseCodeBlocks = (block: string) =>
342 [...block.matchAll(FILE_BLOCKS)].map(([, info = '', content = '']) => ({
343 content: content.trim(),
344 file: info.match(FILE_MATCH)?.[1],
345 info,
346 lang: info.trim().split(/\s+/, 1)[0] ?? '',
347 }));
348
349const splitImports = (source: string): [imports: string, body: string] => {
350 const lines = source.split('\n');

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…