MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / stripLineIndent

Function stripLineIndent

tools/templates/generate-template-readmes.ts:135–148  ·  view source on GitHub ↗
(md: string)

Source from the content-addressed store, hash-verified

133}
134
135function stripLineIndent(md: string): string {
136 let inCodeBlock = false;
137 return md
138 .split('\n')
139 .map(line => {
140 if (line.startsWith('```')) {
141 inCodeBlock = !inCodeBlock;
142 return line;
143 }
144 if (inCodeBlock) return line;
145 return line.replace(/^\s+/, '');
146 })
147 .join('\n');
148}
149
150function quickstartMdxToMarkdown(
151 mdx: string,

Callers 1

quickstartMdxToMarkdownFunction · 0.85

Calls 4

joinMethod · 0.80
splitMethod · 0.80
replaceMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…