MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / normalizeBlockIndent

Function normalizeBlockIndent

src/skill-manager.ts:248–256  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

246}
247
248function normalizeBlockIndent(lines: string[]): string[] {
249 const indents = lines
250 .filter((line) => line.trim() !== "")
251 .map((line) => line.match(/^[ \t]*/)![0].length);
252
253 const trimLength = indents.length > 0 ? Math.min(...indents) : 0;
254
255 return lines.map((line) => line.slice(trimLength));
256}
257
258function foldBlockScalar(lines: string[]): string {
259 let result = "";

Callers 2

readBlockScalarFunction · 0.85
readIndentedScalarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected