MCPcopy
hub / github.com/webpack/webpack / returningFunction

Method returningFunction

lib/RuntimeTemplate.js:272–276  ·  view source on GitHub ↗

* Returning function. * @param {string} returnValue return value * @param {string} args arguments * @returns {string} returning function

(returnValue, args = "")

Source from the content-addressed store, hash-verified

270 * @returns {string} returning function
271 */
272 returningFunction(returnValue, args = "") {
273 return this.supportsArrowFunction()
274 ? `(${args}) => (${returnValue})`
275 : `function(${args}) { return ${returnValue}; }`;
276 }
277
278 /**
279 * Returns basic function.

Callers 15

asyncModuleFactoryMethod · 0.95
syncModuleFactoryMethod · 0.95
getAsyncWeakSourceMethod · 0.80
getEagerSourceMethod · 0.80
getLazyOnceSourceMethod · 0.80
getLazySourceMethod · 0.80
generateModuleRemappingFunction · 0.80

Calls 1

supportsArrowFunctionMethod · 0.95

Tested by

no test coverage detected