@zenweb/template 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## [3.0.3] - 2023-4-2
4
+ - 清除遗留的 console.log
5
+
6
+ ## [3.0.2] - 2023-4-2
7
+ - 使用 ctx.template 方法无 engine 指定的情况下使用第一匹配的 engine
package/dist/render.js CHANGED
@@ -10,7 +10,8 @@ class TemplateRender {
10
10
  }
11
11
  match(ctx) {
12
12
  const opt = ctx[exports.TEMPLATE_OPTION];
13
- if (opt && opt.engine === this._option.engineName) {
13
+ // 匹配引擎, 如果不设置引擎则直接匹配
14
+ if (opt && (!opt.engine || opt.engine === this._option.engineName)) {
14
15
  (0, utils_1.debug)('matchEngine: %o', this._option.engineName);
15
16
  return true;
16
17
  }
@@ -34,7 +35,6 @@ class TemplateRender {
34
35
  return false;
35
36
  }
36
37
  render(ctx, data) {
37
- console.log(this);
38
38
  const opt = ctx[exports.TEMPLATE_OPTION];
39
39
  let template = opt === null || opt === void 0 ? void 0 : opt.template;
40
40
  if (!template) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenweb/template",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "zenweb template render module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",