MCPcopy
hub / github.com/webpack/webpack / prefix

Method prefix

lib/Template.js:252–257  ·  view source on GitHub ↗

* Returns new prefix string. * @param {string | string[]} s string to create prefix for * @param {string} prefix prefix to compose * @returns {string} returns new prefix string

(s, prefix)

Source from the content-addressed store, hash-verified

250 * @returns {string} returns new prefix string
251 */
252 static prefix(s, prefix) {
253 const str = Template.asString(s).trim();
254 if (!str) return "";
255 const ind = str[0] === "\n" ? "" : prefix;
256 return ind + str.replace(/\n([^\n])/g, `\n${prefix}$1`);
257 }
258
259 /**
260 * Returns a single string from array.

Callers

nothing calls this directly

Calls 2

asStringMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected