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

Function foldBlockScalar

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

Source from the content-addressed store, hash-verified

256}
257
258function foldBlockScalar(lines: string[]): string {
259 let result = "";
260 let previousBlank = false;
261
262 for (const line of lines) {
263 const isBlank = line.trim() === "";
264
265 if (isBlank) {
266 result += "\n";
267 previousBlank = true;
268 continue;
269 }
270
271 if (result !== "" && !previousBlank) {
272 result += " ";
273 }
274
275 result += line;
276 previousBlank = false;
277 }
278
279 return result;
280}
281
282function applyChomp(value: string, mode: "strip" | "clip" | "keep"): string {
283 if (mode === "keep") {

Callers 2

readBlockScalarFunction · 0.85
readIndentedScalarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected