MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / indentBlock

Function indentBlock

plugins/grok-theme/index.mjs:1443–1457  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

1441 content.endsWith('};') ||
1442 content.endsWith('>') ||
1443 content.endsWith('>;')
1444 ? trimLastLine(content)
1445 : content;
1446 return '```ts\n' + unEscapeChars(trimmedContent) + '\n```';
1447}
1448
1449/**
1450 * Returns a heading in markdown format
1451 * @param level The level of the heading
1452 * @param text The text of the heading
1453 */
1454function heading(level, text) {
1455 level = level > 6 ? 6 : level;
1456 return `${[...Array(level)].map(() => '#').join('')} ${text}`;
1457}
1458
1459function indentBlock(content) {
1460 const lines = content.split(`${'\n'}`);

Callers 1

constructorMethod · 0.85

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected