MCPcopy Index your code
hub / github.com/code-pushup/cli / transformLines

Function transformLines

packages/utils/src/lib/formatting.ts:153–158  ·  view source on GitHub ↗
(
  text: string,
  fn: (line: string, index: number) => string,
)

Source from the content-addressed store, hash-verified

151}
152
153export function transformLines(
154 text: string,
155 fn: (line: string, index: number) => string,
156): string {
157 return text.split(/\r?\n/).map(fn).join('\n');
158}
159
160export function indentLines(text: string, identation: number): string {
161 return transformLines(text, line => `${' '.repeat(identation)}${line}`);

Callers 5

logFunction · 0.90
indentLinesFunction · 0.85
pluginMetaLogFormatterFunction · 0.85
#formatMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected