@tarojs/taro 2.2.19 → 2.2.22

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/dist/index.js CHANGED
@@ -2,35 +2,67 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- function ownKeys(object, enumerableOnly) {
6
- var keys = Object.keys(object);
5
+ function _callSuper(t, o, e) {
6
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
7
+ }
8
+ function _construct(t, e, r) {
9
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
10
+ var o = [null];
11
+ o.push.apply(o, e);
12
+ var p = new (t.bind.apply(t, o))();
13
+ return r && _setPrototypeOf(p, r.prototype), p;
14
+ }
15
+ function _isNativeReflectConstruct() {
16
+ try {
17
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
18
+ } catch (t) {}
19
+ return (_isNativeReflectConstruct = function () {
20
+ return !!t;
21
+ })();
22
+ }
23
+ function ownKeys(e, r) {
24
+ var t = Object.keys(e);
7
25
  if (Object.getOwnPropertySymbols) {
8
- var symbols = Object.getOwnPropertySymbols(object);
9
- enumerableOnly && (symbols = symbols.filter(function (sym) {
10
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11
- })), keys.push.apply(keys, symbols);
12
- }
13
- return keys;
14
- }
15
- function _objectSpread2(target) {
16
- for (var i = 1; i < arguments.length; i++) {
17
- var source = null != arguments[i] ? arguments[i] : {};
18
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
19
- _defineProperty(target, key, source[key]);
20
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
21
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
26
+ var o = Object.getOwnPropertySymbols(e);
27
+ r && (o = o.filter(function (r) {
28
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
29
+ })), t.push.apply(t, o);
30
+ }
31
+ return t;
32
+ }
33
+ function _objectSpread2(e) {
34
+ for (var r = 1; r < arguments.length; r++) {
35
+ var t = null != arguments[r] ? arguments[r] : {};
36
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
37
+ _defineProperty(e, r, t[r]);
38
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
39
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
22
40
  });
23
41
  }
24
- return target;
42
+ return e;
43
+ }
44
+ function _toPrimitive(t, r) {
45
+ if ("object" != typeof t || !t) return t;
46
+ var e = t[Symbol.toPrimitive];
47
+ if (void 0 !== e) {
48
+ var i = e.call(t, r || "default");
49
+ if ("object" != typeof i) return i;
50
+ throw new TypeError("@@toPrimitive must return a primitive value.");
51
+ }
52
+ return ("string" === r ? String : Number)(t);
25
53
  }
26
- function _typeof(obj) {
54
+ function _toPropertyKey(t) {
55
+ var i = _toPrimitive(t, "string");
56
+ return "symbol" == typeof i ? i : String(i);
57
+ }
58
+ function _typeof(o) {
27
59
  "@babel/helpers - typeof";
28
60
 
29
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
30
- return typeof obj;
31
- } : function (obj) {
32
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
33
- }, _typeof(obj);
61
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
62
+ return typeof o;
63
+ } : function (o) {
64
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
65
+ }, _typeof(o);
34
66
  }
35
67
  function _classCallCheck(instance, Constructor) {
36
68
  if (!(instance instanceof Constructor)) {
@@ -43,7 +75,7 @@ function _defineProperties(target, props) {
43
75
  descriptor.enumerable = descriptor.enumerable || false;
44
76
  descriptor.configurable = true;
45
77
  if ("value" in descriptor) descriptor.writable = true;
46
- Object.defineProperty(target, descriptor.key, descriptor);
78
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
47
79
  }
48
80
  }
49
81
  function _createClass(Constructor, protoProps, staticProps) {
@@ -55,6 +87,7 @@ function _createClass(Constructor, protoProps, staticProps) {
55
87
  return Constructor;
56
88
  }
57
89
  function _defineProperty(obj, key, value) {
90
+ key = _toPropertyKey(key);
58
91
  if (key in obj) {
59
92
  Object.defineProperty(obj, key, {
60
93
  value: value,
@@ -96,35 +129,13 @@ function _setPrototypeOf(o, p) {
96
129
  };
97
130
  return _setPrototypeOf(o, p);
98
131
  }
99
- function _isNativeReflectConstruct() {
100
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
101
- if (Reflect.construct.sham) return false;
102
- if (typeof Proxy === "function") return true;
132
+ function _isNativeFunction(fn) {
103
133
  try {
104
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
105
- return true;
134
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
106
135
  } catch (e) {
107
- return false;
136
+ return typeof fn === "function";
108
137
  }
109
138
  }
110
- function _construct(Parent, args, Class) {
111
- if (_isNativeReflectConstruct()) {
112
- _construct = Reflect.construct.bind();
113
- } else {
114
- _construct = function _construct(Parent, args, Class) {
115
- var a = [null];
116
- a.push.apply(a, args);
117
- var Constructor = Function.bind.apply(Parent, a);
118
- var instance = new Constructor();
119
- if (Class) _setPrototypeOf(instance, Class.prototype);
120
- return instance;
121
- };
122
- }
123
- return _construct.apply(null, arguments);
124
- }
125
- function _isNativeFunction(fn) {
126
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
127
- }
128
139
  function _wrapNativeSuper(Class) {
129
140
  var _cache = typeof Map === "function" ? new Map() : undefined;
130
141
  _wrapNativeSuper = function _wrapNativeSuper(Class) {
@@ -165,20 +176,6 @@ function _possibleConstructorReturn(self, call) {
165
176
  }
166
177
  return _assertThisInitialized(self);
167
178
  }
168
- function _createSuper(Derived) {
169
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
170
- return function _createSuperInternal() {
171
- var Super = _getPrototypeOf(Derived),
172
- result;
173
- if (hasNativeReflectConstruct) {
174
- var NewTarget = _getPrototypeOf(this).constructor;
175
- result = Reflect.construct(Super, arguments, NewTarget);
176
- } else {
177
- result = Super.apply(this, arguments);
178
- }
179
- return _possibleConstructorReturn(this, result);
180
- };
181
- }
182
179
  function _toConsumableArray(arr) {
183
180
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
184
181
  }
@@ -1562,7 +1559,6 @@ function detachAllRef(component) {
1562
1559
  }
1563
1560
  var RefsArray = /*#__PURE__*/function (_Array) {
1564
1561
  _inherits(RefsArray, _Array);
1565
- var _super = _createSuper(RefsArray);
1566
1562
  /**
1567
1563
  * @param {Array} initList
1568
1564
  */
@@ -1570,7 +1566,7 @@ var RefsArray = /*#__PURE__*/function (_Array) {
1570
1566
  var _this;
1571
1567
  var initList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1572
1568
  _classCallCheck(this, RefsArray);
1573
- _this = _super.call.apply(_super, [this].concat(_toConsumableArray(initList)));
1569
+ _this = _callSuper(this, RefsArray, _toConsumableArray(initList));
1574
1570
  _this.inited = false;
1575
1571
  return _this;
1576
1572
  }