MCPcopy
hub / github.com/webpack/webpack / wrapComment

Function wrapComment

lib/BannerPlugin.js:28–38  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

26 * @returns {string} wrapped string
27 */
28const wrapComment = (str) => {
29 if (!str.includes("\n")) {
30 return Template.toComment(str);
31 }
32 return `/*!\n * ${str
33 .replace(/\*\//g, "* /")
34 .split("\n")
35 .join("\n * ")
36 .replace(/\s+\n/g, "\n")
37 .trimEnd()}\n */`;
38};
39
40const PLUGIN_NAME = "BannerPlugin";
41

Callers 1

constructorMethod · 0.85

Calls 3

toCommentMethod · 0.80
splitMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected