MCPcopy
hub / github.com/webpack/webpack / basicFunction

Method basicFunction

lib/RuntimeTemplate.js:284–288  ·  view source on GitHub ↗

* Returns basic function. * @param {string} args arguments * @param {string | string[]} body body * @returns {string} basic function

(args, body)

Source from the content-addressed store, hash-verified

282 * @returns {string} basic function
283 */
284 basicFunction(args, body) {
285 return this.supportsArrowFunction()
286 ? `(${args}) => {\n${Template.indent(body)}\n}`
287 : `function(${args}) {\n${Template.indent(body)}\n}`;
288 }
289
290 /**
291 * Returns result expression.

Callers 15

methodMethod · 0.95
iifeMethod · 0.95
weakErrorMethod · 0.95
getAsyncWeakSourceMethod · 0.80
getEagerSourceMethod · 0.80
getLazyOnceSourceMethod · 0.80
getLazySourceMethod · 0.80
generateMethod · 0.80

Calls 2

supportsArrowFunctionMethod · 0.95
indentMethod · 0.80

Tested by

no test coverage detected