efront 3.33.0 → 3.33.1

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.
@@ -0,0 +1,5 @@
1
+ function ArrayFillApply(size, item) {
2
+ var result = Array(size);
3
+ for (var cx = 0; cx < size; cx++)result[cx] = item;
4
+ return result;
5
+ }
@@ -0,0 +1,6 @@
1
+ var backEach = function (arr, run, context) {
2
+ for (var cx = arr.length - 1; cx >= 0; cx--) {
3
+ run.call(context, arr[cx], cx, arr);
4
+ }
5
+ };
6
+ module.exports = backEach;
@@ -16,7 +16,7 @@ function map(f, o) {
16
16
  } else {
17
17
  for (var cx in this) {
18
18
  if (!isFinite(cx)) break;
19
- res[cx] = f.call(o, this[cx], cx, this);
19
+ res[cx] = f.call(o, this[cx], +cx, this);
20
20
  }
21
21
  }
22
22
  return res;
@@ -28,7 +28,7 @@ function forEach(f, o) {
28
28
  }
29
29
  for (var cx in this) {
30
30
  if (!isFinite(cx)) break;
31
- f.call(o, this[cx], cx, this);
31
+ f.call(o, this[cx], +cx, this);
32
32
  }
33
33
  }
34
34
  function filter(f, o) {
@@ -39,7 +39,7 @@ function filter(f, o) {
39
39
  }
40
40
  for (var cx in this) {
41
41
  if (!isFinite(cx)) break;
42
- if (f.call(o, this[cx], cx, this))
42
+ if (f.call(o, this[cx], +cx, this))
43
43
  result.push(this[cx]);
44
44
  }
45
45
  return result;
@@ -48,7 +48,7 @@ function indexOf(searchElement, fromIndex = 0) {
48
48
  if (fromIndex < 0) fromIndex += this.length;
49
49
  if (fromIndex < 0) fromIndex = 0;
50
50
  for (var cx = fromIndex, dx = this.length; cx < dx; cx++) {
51
- if (cx in this && this[cx] === searchElement) return cx;
51
+ if (cx in this && this[cx] === searchElement) return +cx;
52
52
  }
53
53
  return -1;
54
54
  }
@@ -65,16 +65,17 @@ var keys = function keys(object) {
65
65
  }
66
66
  return result;
67
67
  };
68
- if (![].map) Array.prototype.map = map;
69
- if (![].forEach) Array.prototype.forEach = forEach;
70
- if (![].indexOf) Array.prototype.indexOf = indexOf;
71
- if (![].filter) Array.prototype.filter = filter;
68
+ var ArrayProto = Array.prototype;
69
+ if (!ArrayProto.map) ArrayProto.map = map;
70
+ if (!ArrayProto.forEach) ArrayProto.forEach = forEach;
71
+ if (!ArrayProto.indexOf) ArrayProto.indexOf = indexOf;
72
+ if (!ArrayProto.filter) ArrayProto.filter = filter;
72
73
  if (!"".trim) String.prototype.trim = trim;
73
74
  if (!Object.keys) Object.keys = keys;
74
75
  if (!Object.create) Object.create = function (object) {
75
76
  return { __proto__: object };
76
77
  };
77
- if (!function () { }.bind) Function.prototype.bind = function (context) {
78
+ if (!Function.prototype.bind) Function.prototype.bind = function (context) {
78
79
  var args = [].slice.call(arguments, 1);
79
80
  var f = this;
80
81
  return function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.33.0",
3
+ "version": "3.33.1",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {