MCPcopy
hub / github.com/webpack/webpack / indent

Function indent

lib/stats/DefaultStatsPrinterPlugin.js:1271–1276  ·  view source on GitHub ↗
(str, prefix, noPrefixInFirstLine)

Source from the content-addressed store, hash-verified

1269 * @returns {string} result
1270 */
1271const indent = (str, prefix, noPrefixInFirstLine) => {
1272 const rem = str.replace(/\n([^\n])/g, `\n${prefix}$1`);
1273 if (noPrefixInFirstLine) return rem;
1274 const ind = str[0] === "\n" ? "" : prefix;
1275 return ind + rem;
1276};
1277
1278/**
1279 * Join explicit new line.

Callers 2

joinExplicitNewLineFunction · 0.70

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected