MCPcopy
hub / github.com/webpack/webpack / expressionFunction

Method expressionFunction

lib/RuntimeTemplate.js:364–368  ·  view source on GitHub ↗

* Expression function. * @param {string} expression expression * @param {string} args arguments * @returns {string} expression function code

(expression, args = "")

Source from the content-addressed store, hash-verified

362 * @returns {string} expression function code
363 */
364 expressionFunction(expression, args = "") {
365 return this.supportsArrowFunction()
366 ? `(${args}) => (${expression})`
367 : `function(${args}) { ${expression}; }`;
368 }
369
370 /**
371 * Returns empty function code.

Callers 8

generateMethod · 0.80
generateMethod · 0.80
generateMethod · 0.80
generateMethod · 0.80
generateMethod · 0.80
generateMethod · 0.80
generateMethod · 0.80
generateMethod · 0.80

Calls 1

supportsArrowFunctionMethod · 0.95

Tested by

no test coverage detected