MCPcopy Index your code
hub / github.com/ampproject/amphtml / templateFunc

Function templateFunc

testing/describes.js:247–255  ·  view source on GitHub ↗
(name, variants, fn, describeFunc)

Source from the content-addressed store, hash-verified

245 * @param {function(string, function())} describeFunc
246 */
247 const templateFunc = function (name, variants, fn, describeFunc) {
248 return describeFunc(name, function () {
249 for (const name in variants) {
250 sandboxed(name ? ` ${name} ` : SUB, {}, function (env) {
251 fn.call(this, name, variants[name], env);
252 });
253 }
254 });
255 };
256
257 const createTemplate = (describeFunc) => (name, variants, fn) =>
258 templateFunc(name, variants, fn, describeFunc);

Callers 1

createTemplateFunction · 0.70

Calls 13

beforeEachFunction · 0.85
afterEachFunction · 0.85
concatMethod · 0.80
configureMethod · 0.80
factoryFunction · 0.50
filterMethod · 0.45
isOnMethod · 0.45
createMethod · 0.45
forEachMethod · 0.45
thenMethod · 0.45
setupMethod · 0.45
teardownMethod · 0.45

Tested by

no test coverage detected