MCPcopy Create free account
hub / github.com/bytecodealliance/ComponentizeJS / stripLinesPrefixes

Function stripLinesPrefixes

src/componentize.js:456–464  ·  view source on GitHub ↗

* Clean up the given input string by removing the given patterns if * found as line prefixes.

(input, prefixPatterns)

Source from the content-addressed store, hash-verified

454 * found as line prefixes.
455 */
456function stripLinesPrefixes(input, prefixPatterns) {
457 return input
458 .split('\n')
459 .map((line) =>
460 prefixPatterns.reduce((line, n) => line.replace(n, ''), line),
461 )
462 .join('\n')
463 .trim();
464}
465
466/**
467 * Parse output of post-processing step (whether Wizer or Weval)

Callers 1

handleCheckInitOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected