efront 4.1.13 → 4.1.14

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.
@@ -52,7 +52,7 @@ class Table extends Array {
52
52
  this.update();
53
53
  }
54
54
  addItem(o) {
55
- if (isEmpty(o)) return;
55
+ if (!isHandled(o)) return;
56
56
  var searchtext = this.searchText;
57
57
  var fields = this.searchFields ? this.searchFields : this.fields;
58
58
  var power = 0;
@@ -0,0 +1,5 @@
1
+ function isHandled(value) {
2
+ if (value === '' || value === null || value === undefined || Number.isNaN(value)) return false;
3
+ return true;
4
+ }
5
+ module.exports = isHandled;
@@ -242,7 +242,7 @@ function parse(piece) {
242
242
  piece[0] = piece0 + (piece[0] || '').trim();
243
243
  }
244
244
 
245
- piece = piece.map(p => isString(p) ? p.trim() : p).filter(p => !isEmpty(p));
245
+ piece = piece.map(p => isString(p) ? p.trim() : p).filter(p => isHandled(p));
246
246
  if (/^[\}\]]/.test(piece[0])) {
247
247
  var f = piecepath.pop()
248
248
  last_type = f.last_type;
@@ -89,9 +89,15 @@ var maplist = function (u) {
89
89
  m.wcount++;
90
90
  }
91
91
  }
92
- if (enumtype & (REFSTRC | REFMOVE)) {
92
+ else if (enumtype & (REFSTRC | REFMOVE)) {
93
93
  if (o.property) o[ignore] = true;
94
- else if (o.equal) m.enumref = o.enumref, m.wcount++;
94
+ else if (o.equal) {
95
+ if (o.enumref && o.enumref !== m.enumref) {
96
+ m.enumref = o.enumref;
97
+ m.wcount++;
98
+ }
99
+ else if (enumtype & REFMOVE) m.wcount++;
100
+ }
95
101
  else if (enumtype & REFMOVE) m.wcount++;
96
102
  }
97
103
  }
@@ -11,7 +11,7 @@ var helps = [
11
11
  ["m", i18n`创建应用,项目目录允许创建第二个应用`, "init", "from SRCNAME", "init APPNAME", "init APPNAME from SRCNAME", "from SRCNAME init APPNAME"],
12
12
  ["m", i18n`创建简单应用,独占项目目录的单应用`, "create", "simple", "create|simple from SRCNAME", "create|simple APPNAME", "create|simple APPNAME from APPNAME"],
13
13
  ["m", i18n`创建空应用`, "blank", "simple", "from blank", "simple from blank"],
14
- ["q", i18n`自动识别环境并启动测试环境服务器`, "cook", "cooks", "cook HTTP_PORT", "cook HTTP_PORT HTTPS_PORT", "cooks HTTPS_PORT", "cooks HTTPS_PORT HTTP_PORT"],
14
+ ["a", i18n`自动识别环境并启动测试环境服务器`, "cook", "cooks", "cook HTTP_PORT", "cook HTTP_PORT HTTPS_PORT", "cooks HTTPS_PORT", "cooks HTTPS_PORT HTTP_PORT"],
15
15
  ["q", i18n`自动识别环境并启动开发环境服务器`, "live", "lives", "live HTTP_PORT", "live HTTP_PORT HTTPS_PORT", "lives HTTPS_PORT", "lives HTTPS_PORT HTTP_PORT"],
16
16
  ["a", i18n`在项目文件夹启动生产环境服务器`, "start", "starts", "start HTTP_PORT", "start HTTP_PORT HTTPS_PORT", "starts HTTPS_PORT", "starts HTTPS_PORT HTTP_PORT"],
17
17
  ["a", i18n`在项目文件夹启动开发环境服务器`, "dev", "devs", "test", "dev|test HTTP_PORT", "dev|test HTTP_PORT HTTPS_PORT", "devs|tests HTTPS_PORT", "devs|tests HTTPS_PORT HTTP_PORT"],
@@ -469,18 +469,18 @@ var src2 = function (search) {
469
469
  temp = extend([], origin);
470
470
  } else if (isObject(origin)) {
471
471
  temp = extend({}, origin);
472
- } else if (isEmpty(origin)) {
472
+ } else if (!isHandled(origin)) {
473
473
  temp = "";
474
474
  }
475
- if (savedValue !== undefined && savedValue !== null) {
475
+ if (isHandled(savedValue)) {
476
476
  var changes = getChanges(temp, savedValue);
477
- if (!changes || isEmpty(origin) && isEmpty(this.src) && isEmpty(savedValue)) return;
477
+ if (!changes) return;
478
478
  }
479
479
  else {
480
480
  if (isSame(savedValue, temp)) return;
481
481
  }
482
482
  savedValue = temp;
483
- if (isEmpty(origin) && isEmpty(this.src));
483
+ if (!isHandled(origin) && !isHandled(this.src));
484
484
  else this.src = origin;
485
485
  cast(this, origin);
486
486
  });
@@ -749,7 +749,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
749
749
  if (!isNumber(element.$renderid)) {
750
750
  element.$renderid = 0;
751
751
  element.$scope = scope;
752
- if (!isEmpty(parentScopes) && !isArray(parentScopes)) {
752
+ if (isHandled(parentScopes) && !isArray(parentScopes)) {
753
753
  throw new Error('父级作用域链应以数组的类型传入');
754
754
  }
755
755
  if (parentScopes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.1.13",
3
+ "version": "4.1.14",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {