(str, inputPath, preTemplateEngine)
| 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 | } |
no test coverage detected