@ibiz-template/runtime 0.7.41-alpha.133 → 0.7.41-alpha.134

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.
@@ -168,7 +168,7 @@ export class ViewMsgController {
168
168
  params,
169
169
  }, testScriptCode, {
170
170
  isAsync: false,
171
- singleRowReturn: true,
171
+ singleRowReturn: !testScriptCode.includes('return'),
172
172
  });
173
173
  return !!result;
174
174
  }
@@ -35,8 +35,8 @@ export class ScriptFunction {
35
35
  */
36
36
  formatCode(scriptCode, options) {
37
37
  let code = scriptCode;
38
- // 单行脚本模式脚本代码中没有return时,自动添加return
39
- if (options.singleRowReturn && !code.includes('return')) {
38
+ // 箭头函数、返回函数场景通过是否包含'return'自动化判断单行还是多行模式会存在问题
39
+ if (options.singleRowReturn) {
40
40
  code = `return (${code})`;
41
41
  }
42
42
  if (options.isAsync) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/runtime",
3
- "version": "0.7.41-alpha.133",
3
+ "version": "0.7.41-alpha.134",
4
4
  "description": "运行时逻辑库",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -70,5 +70,5 @@
70
70
  "qx-util": "^0.4.8",
71
71
  "ramda": "^0.29.0"
72
72
  },
73
- "gitHead": "f43d1060a3dedd5fc1e97928d3e2b06f9dbc25a5"
73
+ "gitHead": "e78bf67edd338c57931386b644794510729a9fa8"
74
74
  }
@@ -247,7 +247,7 @@ export class ViewMsgController {
247
247
  testScriptCode,
248
248
  {
249
249
  isAsync: false,
250
- singleRowReturn: true,
250
+ singleRowReturn: !testScriptCode.includes('return'),
251
251
  },
252
252
  );
253
253
  return !!result;
@@ -53,8 +53,8 @@ export class ScriptFunction {
53
53
  options: IScriptFunctionOpts,
54
54
  ): string {
55
55
  let code = scriptCode;
56
- // 单行脚本模式脚本代码中没有return时,自动添加return
57
- if (options.singleRowReturn && !code.includes('return')) {
56
+ // 箭头函数、返回函数场景通过是否包含'return'自动化判断单行还是多行模式会存在问题
57
+ if (options.singleRowReturn) {
58
58
  code = `return (${code})`;
59
59
  }
60
60
  if (options.isAsync) {