MCPcopy
hub / github.com/webpack/webpack / getFunctionContent

Method getFunctionContent

lib/Template.js:106–114  ·  view source on GitHub ↗

* Gets function content. * @param {Stringable} fn a runtime function (.runtime.js) "template" * @returns {string} the updated and normalized function string

(fn)

Source from the content-addressed store, hash-verified

104 * @returns {string} the updated and normalized function string
105 */
106 static getFunctionContent(fn) {
107 return fn
108 .toString()
109 .replace(JSDOC_LINE_REGEX, "")
110 .replace(JSDOC_INLINE_REGEX, "")
111 .replace(FUNCTION_CONTENT_REGEX, "")
112 .replace(INDENT_MULTILINE_REGEX, "")
113 .replace(LINE_SEPARATOR_REGEX, "\n");
114 }
115
116 /**
117 * Returns created identifier.

Callers 3

generateMethod · 0.80
generateJavascriptHMRFunction · 0.80

Calls 2

replaceMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected