MCPcopy
hub / github.com/11ty/buildawesome / compile

Method compile

src/Engines/Html.js:16–32  ·  view source on GitHub ↗
(str, inputPath, preTemplateEngine)

Source from the content-addressed store, hash-verified

14 }
15
16 async compile(str, inputPath, preTemplateEngine) {
17 if (preTemplateEngine) {
18 let engine = await this.#getPreEngine(preTemplateEngine);
19 let fnReady = engine.compile(str, inputPath);
20
21 return async function (data) {
22 let fn = await fnReady;
23
24 return fn(data);
25 };
26 }
27
28 return function () {
29 // do nothing with data if preTemplateEngine is falsy
30 return str;
31 };
32 }
33}

Calls 1

#getPreEngineMethod · 0.95

Tested by

no test coverage detected