@tarojs/taro 2.2.18 → 2.2.21
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.esm.js +169 -449
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +169 -448
- package/dist/index.js.map +1 -1
- package/dist/taro.js +169 -448
- package/dist/taro.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2,83 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function ownKeys(
|
|
6
|
-
var
|
|
7
|
-
|
|
5
|
+
function ownKeys(e, r) {
|
|
6
|
+
var t = Object.keys(e);
|
|
8
7
|
if (Object.getOwnPropertySymbols) {
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
9
|
+
r && (o = o.filter(function (r) {
|
|
10
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
11
|
+
})), t.push.apply(t, o);
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function _objectSpread2(e) {
|
|
16
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
17
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
18
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
19
|
+
_defineProperty(e, r, t[r]);
|
|
20
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
21
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
22
|
+
});
|
|
18
23
|
}
|
|
19
|
-
|
|
20
|
-
return keys;
|
|
24
|
+
return e;
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
function _objectSpread2(target) {
|
|
24
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
25
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
26
|
-
|
|
27
|
-
if (i % 2) {
|
|
28
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
29
|
-
_defineProperty(target, key, source[key]);
|
|
30
|
-
});
|
|
31
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
32
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
33
|
-
} else {
|
|
34
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
35
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return target;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _typeof(obj) {
|
|
26
|
+
function _typeof(o) {
|
|
44
27
|
"@babel/helpers - typeof";
|
|
45
28
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
_typeof = function (obj) {
|
|
52
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return _typeof(obj);
|
|
29
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
30
|
+
return typeof o;
|
|
31
|
+
} : function (o) {
|
|
32
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
33
|
+
}, _typeof(o);
|
|
57
34
|
}
|
|
58
|
-
|
|
59
35
|
function _classCallCheck(instance, Constructor) {
|
|
60
36
|
if (!(instance instanceof Constructor)) {
|
|
61
37
|
throw new TypeError("Cannot call a class as a function");
|
|
62
38
|
}
|
|
63
39
|
}
|
|
64
|
-
|
|
65
40
|
function _defineProperties(target, props) {
|
|
66
41
|
for (var i = 0; i < props.length; i++) {
|
|
67
42
|
var descriptor = props[i];
|
|
68
43
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
69
44
|
descriptor.configurable = true;
|
|
70
45
|
if ("value" in descriptor) descriptor.writable = true;
|
|
71
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
46
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
72
47
|
}
|
|
73
48
|
}
|
|
74
|
-
|
|
75
49
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
76
50
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
77
51
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
52
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
53
|
+
writable: false
|
|
54
|
+
});
|
|
78
55
|
return Constructor;
|
|
79
56
|
}
|
|
80
|
-
|
|
81
57
|
function _defineProperty(obj, key, value) {
|
|
58
|
+
key = _toPropertyKey(key);
|
|
82
59
|
if (key in obj) {
|
|
83
60
|
Object.defineProperty(obj, key, {
|
|
84
61
|
value: value,
|
|
@@ -89,15 +66,12 @@ function _defineProperty(obj, key, value) {
|
|
|
89
66
|
} else {
|
|
90
67
|
obj[key] = value;
|
|
91
68
|
}
|
|
92
|
-
|
|
93
69
|
return obj;
|
|
94
70
|
}
|
|
95
|
-
|
|
96
71
|
function _inherits(subClass, superClass) {
|
|
97
72
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
98
73
|
throw new TypeError("Super expression must either be null or a function");
|
|
99
74
|
}
|
|
100
|
-
|
|
101
75
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
102
76
|
constructor: {
|
|
103
77
|
value: subClass,
|
|
@@ -105,30 +79,28 @@ function _inherits(subClass, superClass) {
|
|
|
105
79
|
configurable: true
|
|
106
80
|
}
|
|
107
81
|
});
|
|
82
|
+
Object.defineProperty(subClass, "prototype", {
|
|
83
|
+
writable: false
|
|
84
|
+
});
|
|
108
85
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
109
86
|
}
|
|
110
|
-
|
|
111
87
|
function _getPrototypeOf(o) {
|
|
112
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
88
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
113
89
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
114
90
|
};
|
|
115
91
|
return _getPrototypeOf(o);
|
|
116
92
|
}
|
|
117
|
-
|
|
118
93
|
function _setPrototypeOf(o, p) {
|
|
119
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
94
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
120
95
|
o.__proto__ = p;
|
|
121
96
|
return o;
|
|
122
97
|
};
|
|
123
|
-
|
|
124
98
|
return _setPrototypeOf(o, p);
|
|
125
99
|
}
|
|
126
|
-
|
|
127
100
|
function _isNativeReflectConstruct() {
|
|
128
101
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
129
102
|
if (Reflect.construct.sham) return false;
|
|
130
103
|
if (typeof Proxy === "function") return true;
|
|
131
|
-
|
|
132
104
|
try {
|
|
133
105
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
134
106
|
return true;
|
|
@@ -136,10 +108,9 @@ function _isNativeReflectConstruct() {
|
|
|
136
108
|
return false;
|
|
137
109
|
}
|
|
138
110
|
}
|
|
139
|
-
|
|
140
111
|
function _construct(Parent, args, Class) {
|
|
141
112
|
if (_isNativeReflectConstruct()) {
|
|
142
|
-
_construct = Reflect.construct;
|
|
113
|
+
_construct = Reflect.construct.bind();
|
|
143
114
|
} else {
|
|
144
115
|
_construct = function _construct(Parent, args, Class) {
|
|
145
116
|
var a = [null];
|
|
@@ -150,34 +121,29 @@ function _construct(Parent, args, Class) {
|
|
|
150
121
|
return instance;
|
|
151
122
|
};
|
|
152
123
|
}
|
|
153
|
-
|
|
154
124
|
return _construct.apply(null, arguments);
|
|
155
125
|
}
|
|
156
|
-
|
|
157
126
|
function _isNativeFunction(fn) {
|
|
158
|
-
|
|
127
|
+
try {
|
|
128
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
129
|
+
} catch (e) {
|
|
130
|
+
return typeof fn === "function";
|
|
131
|
+
}
|
|
159
132
|
}
|
|
160
|
-
|
|
161
133
|
function _wrapNativeSuper(Class) {
|
|
162
134
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
163
|
-
|
|
164
135
|
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
165
136
|
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
166
|
-
|
|
167
137
|
if (typeof Class !== "function") {
|
|
168
138
|
throw new TypeError("Super expression must either be null or a function");
|
|
169
139
|
}
|
|
170
|
-
|
|
171
140
|
if (typeof _cache !== "undefined") {
|
|
172
141
|
if (_cache.has(Class)) return _cache.get(Class);
|
|
173
|
-
|
|
174
142
|
_cache.set(Class, Wrapper);
|
|
175
143
|
}
|
|
176
|
-
|
|
177
144
|
function Wrapper() {
|
|
178
145
|
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
|
179
146
|
}
|
|
180
|
-
|
|
181
147
|
Wrapper.prototype = Object.create(Class.prototype, {
|
|
182
148
|
constructor: {
|
|
183
149
|
value: Wrapper,
|
|
@@ -188,59 +154,45 @@ function _wrapNativeSuper(Class) {
|
|
|
188
154
|
});
|
|
189
155
|
return _setPrototypeOf(Wrapper, Class);
|
|
190
156
|
};
|
|
191
|
-
|
|
192
157
|
return _wrapNativeSuper(Class);
|
|
193
158
|
}
|
|
194
|
-
|
|
195
159
|
function _assertThisInitialized(self) {
|
|
196
160
|
if (self === void 0) {
|
|
197
161
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
198
162
|
}
|
|
199
|
-
|
|
200
163
|
return self;
|
|
201
164
|
}
|
|
202
|
-
|
|
203
165
|
function _possibleConstructorReturn(self, call) {
|
|
204
166
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
205
167
|
return call;
|
|
206
168
|
} else if (call !== void 0) {
|
|
207
169
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
208
170
|
}
|
|
209
|
-
|
|
210
171
|
return _assertThisInitialized(self);
|
|
211
172
|
}
|
|
212
|
-
|
|
213
173
|
function _createSuper(Derived) {
|
|
214
174
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
215
|
-
|
|
216
175
|
return function _createSuperInternal() {
|
|
217
176
|
var Super = _getPrototypeOf(Derived),
|
|
218
|
-
|
|
219
|
-
|
|
177
|
+
result;
|
|
220
178
|
if (hasNativeReflectConstruct) {
|
|
221
179
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
222
|
-
|
|
223
180
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
224
181
|
} else {
|
|
225
182
|
result = Super.apply(this, arguments);
|
|
226
183
|
}
|
|
227
|
-
|
|
228
184
|
return _possibleConstructorReturn(this, result);
|
|
229
185
|
};
|
|
230
186
|
}
|
|
231
|
-
|
|
232
187
|
function _toConsumableArray(arr) {
|
|
233
188
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
234
189
|
}
|
|
235
|
-
|
|
236
190
|
function _arrayWithoutHoles(arr) {
|
|
237
191
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
238
192
|
}
|
|
239
|
-
|
|
240
193
|
function _iterableToArray(iter) {
|
|
241
194
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
242
195
|
}
|
|
243
|
-
|
|
244
196
|
function _unsupportedIterableToArray(o, minLen) {
|
|
245
197
|
if (!o) return;
|
|
246
198
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -249,18 +201,28 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
249
201
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
250
202
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
251
203
|
}
|
|
252
|
-
|
|
253
204
|
function _arrayLikeToArray(arr, len) {
|
|
254
205
|
if (len == null || len > arr.length) len = arr.length;
|
|
255
|
-
|
|
256
206
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
257
|
-
|
|
258
207
|
return arr2;
|
|
259
208
|
}
|
|
260
|
-
|
|
261
209
|
function _nonIterableSpread() {
|
|
262
210
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
263
211
|
}
|
|
212
|
+
function _toPrimitive(input, hint) {
|
|
213
|
+
if (typeof input !== "object" || input === null) return input;
|
|
214
|
+
var prim = input[Symbol.toPrimitive];
|
|
215
|
+
if (prim !== undefined) {
|
|
216
|
+
var res = prim.call(input, hint || "default");
|
|
217
|
+
if (typeof res !== "object") return res;
|
|
218
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
219
|
+
}
|
|
220
|
+
return (hint === "string" ? String : Number)(input);
|
|
221
|
+
}
|
|
222
|
+
function _toPropertyKey(arg) {
|
|
223
|
+
var key = _toPrimitive(arg, "string");
|
|
224
|
+
return typeof key === "symbol" ? key : String(key);
|
|
225
|
+
}
|
|
264
226
|
|
|
265
227
|
if (typeof Object.assign !== 'function') {
|
|
266
228
|
// Must be writable: true, enumerable: false, configurable: true
|
|
@@ -270,12 +232,9 @@ if (typeof Object.assign !== 'function') {
|
|
|
270
232
|
// TypeError if undefined or null
|
|
271
233
|
throw new TypeError('Cannot convert undefined or null to object');
|
|
272
234
|
}
|
|
273
|
-
|
|
274
235
|
var to = Object(target);
|
|
275
|
-
|
|
276
236
|
for (var index = 1; index < arguments.length; index++) {
|
|
277
237
|
var nextSource = arguments[index];
|
|
278
|
-
|
|
279
238
|
if (nextSource != null) {
|
|
280
239
|
// Skip over if undefined or null
|
|
281
240
|
for (var nextKey in nextSource) {
|
|
@@ -286,90 +245,69 @@ if (typeof Object.assign !== 'function') {
|
|
|
286
245
|
}
|
|
287
246
|
}
|
|
288
247
|
}
|
|
289
|
-
|
|
290
248
|
return to;
|
|
291
249
|
};
|
|
292
250
|
}
|
|
293
|
-
|
|
294
251
|
if (typeof Object.defineProperties !== 'function') {
|
|
295
252
|
Object.defineProperties = function (obj, properties) {
|
|
296
253
|
function convertToDescriptor(desc) {
|
|
297
254
|
function hasProperty(obj, prop) {
|
|
298
255
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
299
256
|
}
|
|
300
|
-
|
|
301
257
|
function isCallable(v) {
|
|
302
258
|
// NB: modify as necessary if other values than functions are callable.
|
|
303
259
|
return typeof v === 'function';
|
|
304
260
|
}
|
|
305
|
-
|
|
306
261
|
if (_typeof(desc) !== 'object' || desc === null) {
|
|
307
262
|
throw new TypeError('bad desc');
|
|
308
263
|
}
|
|
309
|
-
|
|
310
264
|
var d = {};
|
|
311
265
|
if (hasProperty(desc, 'enumerable')) d.enumerable = !!desc.enumerable;
|
|
312
|
-
|
|
313
266
|
if (hasProperty(desc, 'configurable')) {
|
|
314
267
|
d.configurable = !!desc.configurable;
|
|
315
268
|
}
|
|
316
|
-
|
|
317
269
|
if (hasProperty(desc, 'value')) d.value = desc.value;
|
|
318
270
|
if (hasProperty(desc, 'writable')) d.writable = !!desc.writable;
|
|
319
|
-
|
|
320
271
|
if (hasProperty(desc, 'get')) {
|
|
321
272
|
var g = desc.get;
|
|
322
|
-
|
|
323
273
|
if (!isCallable(g) && typeof g !== 'undefined') {
|
|
324
274
|
throw new TypeError('bad get');
|
|
325
275
|
}
|
|
326
|
-
|
|
327
276
|
d.get = g;
|
|
328
277
|
}
|
|
329
|
-
|
|
330
278
|
if (hasProperty(desc, 'set')) {
|
|
331
279
|
var s = desc.set;
|
|
332
|
-
|
|
333
280
|
if (!isCallable(s) && typeof s !== 'undefined') {
|
|
334
281
|
throw new TypeError('bad set');
|
|
335
282
|
}
|
|
336
|
-
|
|
337
283
|
d.set = s;
|
|
338
284
|
}
|
|
339
|
-
|
|
340
285
|
if (('get' in d || 'set' in d) && ('value' in d || 'writable' in d)) {
|
|
341
286
|
throw new TypeError('identity-confused descriptor');
|
|
342
287
|
}
|
|
343
|
-
|
|
344
288
|
return d;
|
|
345
289
|
}
|
|
346
|
-
|
|
347
290
|
if (_typeof(obj) !== 'object' || obj === null) throw new TypeError('bad obj');
|
|
348
291
|
properties = Object(properties);
|
|
349
292
|
var keys = Object.keys(properties);
|
|
350
293
|
var descs = [];
|
|
351
|
-
|
|
352
294
|
for (var i = 0; i < keys.length; i++) {
|
|
353
295
|
descs.push([keys[i], convertToDescriptor(properties[keys[i]])]);
|
|
354
296
|
}
|
|
355
|
-
|
|
356
297
|
for (var i = 0; i < descs.length; i++) {
|
|
357
298
|
Object.defineProperty(obj, descs[i][0], descs[i][1]);
|
|
358
299
|
}
|
|
359
|
-
|
|
360
300
|
return obj;
|
|
361
301
|
};
|
|
362
302
|
}
|
|
363
303
|
|
|
364
|
-
var Component = function Component(props) {
|
|
304
|
+
var Component = /*#__PURE__*/_createClass(function Component(props) {
|
|
365
305
|
_classCallCheck(this, Component);
|
|
366
|
-
|
|
367
306
|
this.state = {};
|
|
368
307
|
this.props = props || {};
|
|
369
|
-
};
|
|
308
|
+
});
|
|
370
309
|
|
|
371
310
|
/* eslint-disable */
|
|
372
|
-
|
|
373
311
|
/**
|
|
374
312
|
* lodash (Custom Build) <https://lodash.com/>
|
|
375
313
|
* Build: `lodash modularize exports="npm" -o ./`
|
|
@@ -380,50 +318,51 @@ var Component = function Component(props) {
|
|
|
380
318
|
|
|
381
319
|
/** Used as the `TypeError` message for "Functions" methods. */
|
|
382
320
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
383
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
384
321
|
|
|
322
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
385
323
|
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
386
|
-
/** Used as references for various `Number` constants. */
|
|
387
324
|
|
|
325
|
+
/** Used as references for various `Number` constants. */
|
|
388
326
|
var INFINITY = 1 / 0;
|
|
389
|
-
/** `Object#toString` result references. */
|
|
390
327
|
|
|
328
|
+
/** `Object#toString` result references. */
|
|
391
329
|
var funcTag = '[object Function]',
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
/** Used to match property names within property paths. */
|
|
330
|
+
genTag = '[object GeneratorFunction]',
|
|
331
|
+
symbolTag = '[object Symbol]';
|
|
395
332
|
|
|
333
|
+
/** Used to match property names within property paths. */
|
|
396
334
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
335
|
+
reIsPlainProp = /^\w*$/,
|
|
336
|
+
reLeadingDot = /^\./,
|
|
337
|
+
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
338
|
+
|
|
400
339
|
/**
|
|
401
340
|
* Used to match `RegExp`
|
|
402
341
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
403
342
|
*/
|
|
404
|
-
|
|
405
343
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
406
|
-
/** Used to match backslashes in property paths. */
|
|
407
344
|
|
|
345
|
+
/** Used to match backslashes in property paths. */
|
|
408
346
|
var reEscapeChar = /\\(\\)?/g;
|
|
409
|
-
/** Used to detect host constructors (Safari). */
|
|
410
347
|
|
|
348
|
+
/** Used to detect host constructors (Safari). */
|
|
411
349
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
412
|
-
/** Detect free variable `global` from Node.js. */
|
|
413
350
|
|
|
351
|
+
/** Detect free variable `global` from Node.js. */
|
|
414
352
|
var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof(global)) === 'object' && global && global.Object === Object && global;
|
|
415
|
-
/** Detect free variable `self`. */
|
|
416
353
|
|
|
354
|
+
/** Detect free variable `self`. */
|
|
417
355
|
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) === 'object' && self && self.Object === Object && self;
|
|
418
|
-
/** Used as a reference to the global object. */
|
|
419
356
|
|
|
357
|
+
/** Used as a reference to the global object. */
|
|
420
358
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
421
|
-
/** Used as references for various `Number` constants. */
|
|
422
359
|
|
|
360
|
+
/** Used as references for various `Number` constants. */
|
|
423
361
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
424
|
-
/** Used to detect unsigned integer values. */
|
|
425
362
|
|
|
363
|
+
/** Used to detect unsigned integer values. */
|
|
426
364
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
365
|
+
|
|
427
366
|
/**
|
|
428
367
|
* Gets the value at `key` of `object`.
|
|
429
368
|
*
|
|
@@ -432,10 +371,10 @@ var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
|
432
371
|
* @param {string} key The key of the property to get.
|
|
433
372
|
* @returns {*} Returns the property value.
|
|
434
373
|
*/
|
|
435
|
-
|
|
436
374
|
function getValue(object, key) {
|
|
437
375
|
return object == null ? undefined : object[key];
|
|
438
376
|
}
|
|
377
|
+
|
|
439
378
|
/**
|
|
440
379
|
* Checks if `value` is a host object in IE < 9.
|
|
441
380
|
*
|
|
@@ -443,65 +382,60 @@ function getValue(object, key) {
|
|
|
443
382
|
* @param {*} value The value to check.
|
|
444
383
|
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
445
384
|
*/
|
|
446
|
-
|
|
447
|
-
|
|
448
385
|
function isHostObject(value) {
|
|
449
386
|
// Many host objects are `Object` objects that can coerce to strings
|
|
450
387
|
// despite having improperly defined `toString` methods.
|
|
451
388
|
var result = false;
|
|
452
|
-
|
|
453
389
|
if (value != null && typeof value.toString !== 'function') {
|
|
454
390
|
try {
|
|
455
391
|
result = !!(value + '');
|
|
456
392
|
} catch (e) {}
|
|
457
393
|
}
|
|
458
|
-
|
|
459
394
|
return result;
|
|
460
395
|
}
|
|
461
|
-
/** Used for built-in method references. */
|
|
462
|
-
|
|
463
396
|
|
|
397
|
+
/** Used for built-in method references. */
|
|
464
398
|
var arrayProto = Array.prototype,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
/** Used to detect overreaching core-js shims. */
|
|
399
|
+
funcProto = Function.prototype,
|
|
400
|
+
objectProto = Object.prototype;
|
|
468
401
|
|
|
402
|
+
/** Used to detect overreaching core-js shims. */
|
|
469
403
|
var coreJsData = root['__core-js_shared__'];
|
|
470
|
-
/** Used to detect methods masquerading as native. */
|
|
471
404
|
|
|
405
|
+
/** Used to detect methods masquerading as native. */
|
|
472
406
|
var maskSrcKey = function () {
|
|
473
407
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
474
408
|
return uid ? 'Symbol(src)_1.' + uid : '';
|
|
475
409
|
}();
|
|
476
|
-
/** Used to resolve the decompiled source of functions. */
|
|
477
|
-
|
|
478
410
|
|
|
411
|
+
/** Used to resolve the decompiled source of functions. */
|
|
479
412
|
var funcToString = funcProto.toString;
|
|
480
|
-
/** Used to check objects for own properties. */
|
|
481
413
|
|
|
414
|
+
/** Used to check objects for own properties. */
|
|
482
415
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
416
|
+
|
|
483
417
|
/**
|
|
484
418
|
* Used to resolve the
|
|
485
419
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
486
420
|
* of values.
|
|
487
421
|
*/
|
|
488
|
-
|
|
489
422
|
var objectToString = objectProto.toString;
|
|
490
|
-
/** Used to detect if a method is native. */
|
|
491
423
|
|
|
424
|
+
/** Used to detect if a method is native. */
|
|
492
425
|
var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
|
493
|
-
/** Built-in value references. */
|
|
494
426
|
|
|
427
|
+
/** Built-in value references. */
|
|
495
428
|
var _Symbol = root.Symbol,
|
|
496
|
-
|
|
497
|
-
/* Built-in method references that are verified to be native. */
|
|
429
|
+
splice = arrayProto.splice;
|
|
498
430
|
|
|
431
|
+
/* Built-in method references that are verified to be native. */
|
|
499
432
|
var Map$1 = getNative(root, 'Map'),
|
|
500
|
-
|
|
501
|
-
/** Used to convert symbols to primitives and strings. */
|
|
433
|
+
nativeCreate = getNative(Object, 'create');
|
|
502
434
|
|
|
435
|
+
/** Used to convert symbols to primitives and strings. */
|
|
503
436
|
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
504
|
-
|
|
437
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
438
|
+
|
|
505
439
|
/**
|
|
506
440
|
* Creates a hash object.
|
|
507
441
|
*
|
|
@@ -509,17 +443,16 @@ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
|
509
443
|
* @constructor
|
|
510
444
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
511
445
|
*/
|
|
512
|
-
|
|
513
446
|
function Hash(entries) {
|
|
514
447
|
var index = -1,
|
|
515
|
-
|
|
448
|
+
length = entries ? entries.length : 0;
|
|
516
449
|
this.clear();
|
|
517
|
-
|
|
518
450
|
while (++index < length) {
|
|
519
451
|
var entry = entries[index];
|
|
520
452
|
this.set(entry[0], entry[1]);
|
|
521
453
|
}
|
|
522
454
|
}
|
|
455
|
+
|
|
523
456
|
/**
|
|
524
457
|
* Removes all key-value entries from the hash.
|
|
525
458
|
*
|
|
@@ -527,11 +460,10 @@ function Hash(entries) {
|
|
|
527
460
|
* @name clear
|
|
528
461
|
* @memberOf Hash
|
|
529
462
|
*/
|
|
530
|
-
|
|
531
|
-
|
|
532
463
|
function hashClear() {
|
|
533
464
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
534
465
|
}
|
|
466
|
+
|
|
535
467
|
/**
|
|
536
468
|
* Removes `key` and its value from the hash.
|
|
537
469
|
*
|
|
@@ -542,11 +474,10 @@ function hashClear() {
|
|
|
542
474
|
* @param {string} key The key of the value to remove.
|
|
543
475
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
544
476
|
*/
|
|
545
|
-
|
|
546
|
-
|
|
547
477
|
function hashDelete(key) {
|
|
548
478
|
return this.has(key) && delete this.__data__[key];
|
|
549
479
|
}
|
|
480
|
+
|
|
550
481
|
/**
|
|
551
482
|
* Gets the hash value for `key`.
|
|
552
483
|
*
|
|
@@ -556,18 +487,15 @@ function hashDelete(key) {
|
|
|
556
487
|
* @param {string} key The key of the value to get.
|
|
557
488
|
* @returns {*} Returns the entry value.
|
|
558
489
|
*/
|
|
559
|
-
|
|
560
|
-
|
|
561
490
|
function hashGet(key) {
|
|
562
491
|
var data = this.__data__;
|
|
563
|
-
|
|
564
492
|
if (nativeCreate) {
|
|
565
493
|
var result = data[key];
|
|
566
494
|
return result === HASH_UNDEFINED ? undefined : result;
|
|
567
495
|
}
|
|
568
|
-
|
|
569
496
|
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
570
497
|
}
|
|
498
|
+
|
|
571
499
|
/**
|
|
572
500
|
* Checks if a hash value for `key` exists.
|
|
573
501
|
*
|
|
@@ -577,12 +505,11 @@ function hashGet(key) {
|
|
|
577
505
|
* @param {string} key The key of the entry to check.
|
|
578
506
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
579
507
|
*/
|
|
580
|
-
|
|
581
|
-
|
|
582
508
|
function hashHas(key) {
|
|
583
509
|
var data = this.__data__;
|
|
584
510
|
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
585
511
|
}
|
|
512
|
+
|
|
586
513
|
/**
|
|
587
514
|
* Sets the hash `key` to `value`.
|
|
588
515
|
*
|
|
@@ -593,20 +520,19 @@ function hashHas(key) {
|
|
|
593
520
|
* @param {*} value The value to set.
|
|
594
521
|
* @returns {Object} Returns the hash instance.
|
|
595
522
|
*/
|
|
596
|
-
|
|
597
|
-
|
|
598
523
|
function hashSet(key, value) {
|
|
599
524
|
var data = this.__data__;
|
|
600
525
|
data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
|
|
601
526
|
return this;
|
|
602
|
-
}
|
|
603
|
-
|
|
527
|
+
}
|
|
604
528
|
|
|
529
|
+
// Add methods to `Hash`.
|
|
605
530
|
Hash.prototype.clear = hashClear;
|
|
606
531
|
Hash.prototype['delete'] = hashDelete;
|
|
607
532
|
Hash.prototype.get = hashGet;
|
|
608
533
|
Hash.prototype.has = hashHas;
|
|
609
534
|
Hash.prototype.set = hashSet;
|
|
535
|
+
|
|
610
536
|
/**
|
|
611
537
|
* Creates an list cache object.
|
|
612
538
|
*
|
|
@@ -614,17 +540,16 @@ Hash.prototype.set = hashSet;
|
|
|
614
540
|
* @constructor
|
|
615
541
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
616
542
|
*/
|
|
617
|
-
|
|
618
543
|
function ListCache(entries) {
|
|
619
544
|
var index = -1,
|
|
620
|
-
|
|
545
|
+
length = entries ? entries.length : 0;
|
|
621
546
|
this.clear();
|
|
622
|
-
|
|
623
547
|
while (++index < length) {
|
|
624
548
|
var entry = entries[index];
|
|
625
549
|
this.set(entry[0], entry[1]);
|
|
626
550
|
}
|
|
627
551
|
}
|
|
552
|
+
|
|
628
553
|
/**
|
|
629
554
|
* Removes all key-value entries from the list cache.
|
|
630
555
|
*
|
|
@@ -632,11 +557,10 @@ function ListCache(entries) {
|
|
|
632
557
|
* @name clear
|
|
633
558
|
* @memberOf ListCache
|
|
634
559
|
*/
|
|
635
|
-
|
|
636
|
-
|
|
637
560
|
function listCacheClear() {
|
|
638
561
|
this.__data__ = [];
|
|
639
562
|
}
|
|
563
|
+
|
|
640
564
|
/**
|
|
641
565
|
* Removes `key` and its value from the list cache.
|
|
642
566
|
*
|
|
@@ -646,26 +570,21 @@ function listCacheClear() {
|
|
|
646
570
|
* @param {string} key The key of the value to remove.
|
|
647
571
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
648
572
|
*/
|
|
649
|
-
|
|
650
|
-
|
|
651
573
|
function listCacheDelete(key) {
|
|
652
574
|
var data = this.__data__,
|
|
653
|
-
|
|
654
|
-
|
|
575
|
+
index = assocIndexOf(data, key);
|
|
655
576
|
if (index < 0) {
|
|
656
577
|
return false;
|
|
657
578
|
}
|
|
658
|
-
|
|
659
579
|
var lastIndex = data.length - 1;
|
|
660
|
-
|
|
661
580
|
if (index == lastIndex) {
|
|
662
581
|
data.pop();
|
|
663
582
|
} else {
|
|
664
583
|
splice.call(data, index, 1);
|
|
665
584
|
}
|
|
666
|
-
|
|
667
585
|
return true;
|
|
668
586
|
}
|
|
587
|
+
|
|
669
588
|
/**
|
|
670
589
|
* Gets the list cache value for `key`.
|
|
671
590
|
*
|
|
@@ -675,13 +594,12 @@ function listCacheDelete(key) {
|
|
|
675
594
|
* @param {string} key The key of the value to get.
|
|
676
595
|
* @returns {*} Returns the entry value.
|
|
677
596
|
*/
|
|
678
|
-
|
|
679
|
-
|
|
680
597
|
function listCacheGet(key) {
|
|
681
598
|
var data = this.__data__,
|
|
682
|
-
|
|
599
|
+
index = assocIndexOf(data, key);
|
|
683
600
|
return index < 0 ? undefined : data[index][1];
|
|
684
601
|
}
|
|
602
|
+
|
|
685
603
|
/**
|
|
686
604
|
* Checks if a list cache value for `key` exists.
|
|
687
605
|
*
|
|
@@ -691,11 +609,10 @@ function listCacheGet(key) {
|
|
|
691
609
|
* @param {string} key The key of the entry to check.
|
|
692
610
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
693
611
|
*/
|
|
694
|
-
|
|
695
|
-
|
|
696
612
|
function listCacheHas(key) {
|
|
697
613
|
return assocIndexOf(this.__data__, key) > -1;
|
|
698
614
|
}
|
|
615
|
+
|
|
699
616
|
/**
|
|
700
617
|
* Sets the list cache `key` to `value`.
|
|
701
618
|
*
|
|
@@ -706,27 +623,24 @@ function listCacheHas(key) {
|
|
|
706
623
|
* @param {*} value The value to set.
|
|
707
624
|
* @returns {Object} Returns the list cache instance.
|
|
708
625
|
*/
|
|
709
|
-
|
|
710
|
-
|
|
711
626
|
function listCacheSet(key, value) {
|
|
712
627
|
var data = this.__data__,
|
|
713
|
-
|
|
714
|
-
|
|
628
|
+
index = assocIndexOf(data, key);
|
|
715
629
|
if (index < 0) {
|
|
716
630
|
data.push([key, value]);
|
|
717
631
|
} else {
|
|
718
632
|
data[index][1] = value;
|
|
719
633
|
}
|
|
720
|
-
|
|
721
634
|
return this;
|
|
722
|
-
}
|
|
723
|
-
|
|
635
|
+
}
|
|
724
636
|
|
|
637
|
+
// Add methods to `ListCache`.
|
|
725
638
|
ListCache.prototype.clear = listCacheClear;
|
|
726
639
|
ListCache.prototype['delete'] = listCacheDelete;
|
|
727
640
|
ListCache.prototype.get = listCacheGet;
|
|
728
641
|
ListCache.prototype.has = listCacheHas;
|
|
729
642
|
ListCache.prototype.set = listCacheSet;
|
|
643
|
+
|
|
730
644
|
/**
|
|
731
645
|
* Creates a map cache object to store key-value pairs.
|
|
732
646
|
*
|
|
@@ -734,17 +648,16 @@ ListCache.prototype.set = listCacheSet;
|
|
|
734
648
|
* @constructor
|
|
735
649
|
* @param {Array} [entries] The key-value pairs to cache.
|
|
736
650
|
*/
|
|
737
|
-
|
|
738
651
|
function MapCache(entries) {
|
|
739
652
|
var index = -1,
|
|
740
|
-
|
|
653
|
+
length = entries ? entries.length : 0;
|
|
741
654
|
this.clear();
|
|
742
|
-
|
|
743
655
|
while (++index < length) {
|
|
744
656
|
var entry = entries[index];
|
|
745
657
|
this.set(entry[0], entry[1]);
|
|
746
658
|
}
|
|
747
659
|
}
|
|
660
|
+
|
|
748
661
|
/**
|
|
749
662
|
* Removes all key-value entries from the map.
|
|
750
663
|
*
|
|
@@ -752,8 +665,6 @@ function MapCache(entries) {
|
|
|
752
665
|
* @name clear
|
|
753
666
|
* @memberOf MapCache
|
|
754
667
|
*/
|
|
755
|
-
|
|
756
|
-
|
|
757
668
|
function mapCacheClear() {
|
|
758
669
|
this.__data__ = {
|
|
759
670
|
hash: new Hash(),
|
|
@@ -761,6 +672,7 @@ function mapCacheClear() {
|
|
|
761
672
|
string: new Hash()
|
|
762
673
|
};
|
|
763
674
|
}
|
|
675
|
+
|
|
764
676
|
/**
|
|
765
677
|
* Removes `key` and its value from the map.
|
|
766
678
|
*
|
|
@@ -770,11 +682,10 @@ function mapCacheClear() {
|
|
|
770
682
|
* @param {string} key The key of the value to remove.
|
|
771
683
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
772
684
|
*/
|
|
773
|
-
|
|
774
|
-
|
|
775
685
|
function mapCacheDelete(key) {
|
|
776
686
|
return getMapData(this, key)['delete'](key);
|
|
777
687
|
}
|
|
688
|
+
|
|
778
689
|
/**
|
|
779
690
|
* Gets the map value for `key`.
|
|
780
691
|
*
|
|
@@ -784,11 +695,10 @@ function mapCacheDelete(key) {
|
|
|
784
695
|
* @param {string} key The key of the value to get.
|
|
785
696
|
* @returns {*} Returns the entry value.
|
|
786
697
|
*/
|
|
787
|
-
|
|
788
|
-
|
|
789
698
|
function mapCacheGet(key) {
|
|
790
699
|
return getMapData(this, key).get(key);
|
|
791
700
|
}
|
|
701
|
+
|
|
792
702
|
/**
|
|
793
703
|
* Checks if a map value for `key` exists.
|
|
794
704
|
*
|
|
@@ -798,11 +708,10 @@ function mapCacheGet(key) {
|
|
|
798
708
|
* @param {string} key The key of the entry to check.
|
|
799
709
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
800
710
|
*/
|
|
801
|
-
|
|
802
|
-
|
|
803
711
|
function mapCacheHas(key) {
|
|
804
712
|
return getMapData(this, key).has(key);
|
|
805
713
|
}
|
|
714
|
+
|
|
806
715
|
/**
|
|
807
716
|
* Sets the map `key` to `value`.
|
|
808
717
|
*
|
|
@@ -813,19 +722,18 @@ function mapCacheHas(key) {
|
|
|
813
722
|
* @param {*} value The value to set.
|
|
814
723
|
* @returns {Object} Returns the map cache instance.
|
|
815
724
|
*/
|
|
816
|
-
|
|
817
|
-
|
|
818
725
|
function mapCacheSet(key, value) {
|
|
819
726
|
getMapData(this, key).set(key, value);
|
|
820
727
|
return this;
|
|
821
|
-
}
|
|
822
|
-
|
|
728
|
+
}
|
|
823
729
|
|
|
730
|
+
// Add methods to `MapCache`.
|
|
824
731
|
MapCache.prototype.clear = mapCacheClear;
|
|
825
732
|
MapCache.prototype['delete'] = mapCacheDelete;
|
|
826
733
|
MapCache.prototype.get = mapCacheGet;
|
|
827
734
|
MapCache.prototype.has = mapCacheHas;
|
|
828
735
|
MapCache.prototype.set = mapCacheSet;
|
|
736
|
+
|
|
829
737
|
/**
|
|
830
738
|
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
831
739
|
*
|
|
@@ -834,18 +742,16 @@ MapCache.prototype.set = mapCacheSet;
|
|
|
834
742
|
* @param {*} key The key to search for.
|
|
835
743
|
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
836
744
|
*/
|
|
837
|
-
|
|
838
745
|
function assocIndexOf(array, key) {
|
|
839
746
|
var length = array.length;
|
|
840
|
-
|
|
841
747
|
while (length--) {
|
|
842
748
|
if (eq(array[length][0], key)) {
|
|
843
749
|
return length;
|
|
844
750
|
}
|
|
845
751
|
}
|
|
846
|
-
|
|
847
752
|
return -1;
|
|
848
753
|
}
|
|
754
|
+
|
|
849
755
|
/**
|
|
850
756
|
* The base implementation of `_.get` without support for default values.
|
|
851
757
|
*
|
|
@@ -854,19 +760,16 @@ function assocIndexOf(array, key) {
|
|
|
854
760
|
* @param {Array|string} path The path of the property to get.
|
|
855
761
|
* @returns {*} Returns the resolved value.
|
|
856
762
|
*/
|
|
857
|
-
|
|
858
|
-
|
|
859
763
|
function baseGet(object, path) {
|
|
860
764
|
path = isKey(path, object) ? [path] : castPath(path);
|
|
861
765
|
var index = 0,
|
|
862
|
-
|
|
863
|
-
|
|
766
|
+
length = path.length;
|
|
864
767
|
while (object != null && index < length) {
|
|
865
768
|
object = object[toKey(path[index++])];
|
|
866
769
|
}
|
|
867
|
-
|
|
868
770
|
return index && index == length ? object : undefined;
|
|
869
771
|
}
|
|
772
|
+
|
|
870
773
|
/**
|
|
871
774
|
* The base implementation of `_.isNative` without bad shim checks.
|
|
872
775
|
*
|
|
@@ -875,15 +778,14 @@ function baseGet(object, path) {
|
|
|
875
778
|
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
876
779
|
* else `false`.
|
|
877
780
|
*/
|
|
878
|
-
|
|
879
781
|
function baseIsNative(value) {
|
|
880
782
|
if (!isObject(value) || isMasked(value)) {
|
|
881
783
|
return false;
|
|
882
784
|
}
|
|
883
|
-
|
|
884
785
|
var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
|
885
786
|
return pattern.test(toSource(value));
|
|
886
787
|
}
|
|
788
|
+
|
|
887
789
|
/**
|
|
888
790
|
* The base implementation of `_.toString` which doesn't convert nullish
|
|
889
791
|
* values to empty strings.
|
|
@@ -892,21 +794,18 @@ function baseIsNative(value) {
|
|
|
892
794
|
* @param {*} value The value to process.
|
|
893
795
|
* @returns {string} Returns the string.
|
|
894
796
|
*/
|
|
895
|
-
|
|
896
|
-
|
|
897
797
|
function baseToString(value) {
|
|
898
798
|
// Exit early for strings to avoid a performance hit in some environments.
|
|
899
799
|
if (typeof value === 'string') {
|
|
900
800
|
return value;
|
|
901
801
|
}
|
|
902
|
-
|
|
903
802
|
if (isSymbol(value)) {
|
|
904
803
|
return symbolToString ? symbolToString.call(value) : '';
|
|
905
804
|
}
|
|
906
|
-
|
|
907
805
|
var result = value + '';
|
|
908
806
|
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
|
909
807
|
}
|
|
808
|
+
|
|
910
809
|
/**
|
|
911
810
|
* Casts `value` to a path array if it's not one.
|
|
912
811
|
*
|
|
@@ -914,11 +813,10 @@ function baseToString(value) {
|
|
|
914
813
|
* @param {*} value The value to inspect.
|
|
915
814
|
* @returns {Array} Returns the cast property path array.
|
|
916
815
|
*/
|
|
917
|
-
|
|
918
|
-
|
|
919
816
|
function castPath(value) {
|
|
920
817
|
return isArray(value) ? value : stringToPath(value);
|
|
921
818
|
}
|
|
819
|
+
|
|
922
820
|
/**
|
|
923
821
|
* Gets the data for `map`.
|
|
924
822
|
*
|
|
@@ -927,12 +825,11 @@ function castPath(value) {
|
|
|
927
825
|
* @param {string} key The reference key.
|
|
928
826
|
* @returns {*} Returns the map data.
|
|
929
827
|
*/
|
|
930
|
-
|
|
931
|
-
|
|
932
828
|
function getMapData(map, key) {
|
|
933
829
|
var data = map.__data__;
|
|
934
830
|
return isKeyable(key) ? data[typeof key === 'string' ? 'string' : 'hash'] : data.map;
|
|
935
831
|
}
|
|
832
|
+
|
|
936
833
|
/**
|
|
937
834
|
* Gets the native function at `key` of `object`.
|
|
938
835
|
*
|
|
@@ -941,12 +838,11 @@ function getMapData(map, key) {
|
|
|
941
838
|
* @param {string} key The key of the method to get.
|
|
942
839
|
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
943
840
|
*/
|
|
944
|
-
|
|
945
|
-
|
|
946
841
|
function getNative(object, key) {
|
|
947
842
|
var value = getValue(object, key);
|
|
948
843
|
return baseIsNative(value) ? value : undefined;
|
|
949
844
|
}
|
|
845
|
+
|
|
950
846
|
/**
|
|
951
847
|
* Checks if `value` is a property name and not a property path.
|
|
952
848
|
*
|
|
@@ -955,21 +851,17 @@ function getNative(object, key) {
|
|
|
955
851
|
* @param {Object} [object] The object to query keys on.
|
|
956
852
|
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
957
853
|
*/
|
|
958
|
-
|
|
959
|
-
|
|
960
854
|
function isKey(value, object) {
|
|
961
855
|
if (isArray(value)) {
|
|
962
856
|
return false;
|
|
963
857
|
}
|
|
964
|
-
|
|
965
858
|
var type = _typeof(value);
|
|
966
|
-
|
|
967
859
|
if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
|
|
968
860
|
return true;
|
|
969
861
|
}
|
|
970
|
-
|
|
971
862
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
972
863
|
}
|
|
864
|
+
|
|
973
865
|
/**
|
|
974
866
|
* Checks if `value` is suitable for use as unique object key.
|
|
975
867
|
*
|
|
@@ -977,13 +869,11 @@ function isKey(value, object) {
|
|
|
977
869
|
* @param {*} value The value to check.
|
|
978
870
|
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
979
871
|
*/
|
|
980
|
-
|
|
981
|
-
|
|
982
872
|
function isKeyable(value) {
|
|
983
873
|
var type = _typeof(value);
|
|
984
|
-
|
|
985
874
|
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
|
|
986
875
|
}
|
|
876
|
+
|
|
987
877
|
/**
|
|
988
878
|
* Checks if `func` has its source masked.
|
|
989
879
|
*
|
|
@@ -991,11 +881,10 @@ function isKeyable(value) {
|
|
|
991
881
|
* @param {Function} func The function to check.
|
|
992
882
|
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
993
883
|
*/
|
|
994
|
-
|
|
995
|
-
|
|
996
884
|
function isMasked(func) {
|
|
997
885
|
return !!maskSrcKey && maskSrcKey in func;
|
|
998
886
|
}
|
|
887
|
+
|
|
999
888
|
/**
|
|
1000
889
|
* Converts `string` to a property path array.
|
|
1001
890
|
*
|
|
@@ -1003,21 +892,18 @@ function isMasked(func) {
|
|
|
1003
892
|
* @param {string} string The string to convert.
|
|
1004
893
|
* @returns {Array} Returns the property path array.
|
|
1005
894
|
*/
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
895
|
var stringToPath = memoize(function (string) {
|
|
1009
896
|
string = toString(string);
|
|
1010
897
|
var result = [];
|
|
1011
|
-
|
|
1012
898
|
if (reLeadingDot.test(string)) {
|
|
1013
899
|
result.push('');
|
|
1014
900
|
}
|
|
1015
|
-
|
|
1016
901
|
string.replace(rePropName, function (match, number, quote, string) {
|
|
1017
902
|
result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
|
|
1018
903
|
});
|
|
1019
904
|
return result;
|
|
1020
905
|
});
|
|
906
|
+
|
|
1021
907
|
/**
|
|
1022
908
|
* Converts `value` to a string key if it's not a string or symbol.
|
|
1023
909
|
*
|
|
@@ -1025,15 +911,14 @@ var stringToPath = memoize(function (string) {
|
|
|
1025
911
|
* @param {*} value The value to inspect.
|
|
1026
912
|
* @returns {string|symbol} Returns the key.
|
|
1027
913
|
*/
|
|
1028
|
-
|
|
1029
914
|
function toKey(value) {
|
|
1030
915
|
if (typeof value === 'string' || isSymbol(value)) {
|
|
1031
916
|
return value;
|
|
1032
917
|
}
|
|
1033
|
-
|
|
1034
918
|
var result = value + '';
|
|
1035
919
|
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
|
1036
920
|
}
|
|
921
|
+
|
|
1037
922
|
/**
|
|
1038
923
|
* Converts `func` to its source code.
|
|
1039
924
|
*
|
|
@@ -1041,21 +926,18 @@ function toKey(value) {
|
|
|
1041
926
|
* @param {Function} func The function to process.
|
|
1042
927
|
* @returns {string} Returns the source code.
|
|
1043
928
|
*/
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
929
|
function toSource(func) {
|
|
1047
930
|
if (func != null) {
|
|
1048
931
|
try {
|
|
1049
932
|
return funcToString.call(func);
|
|
1050
933
|
} catch (e) {}
|
|
1051
|
-
|
|
1052
934
|
try {
|
|
1053
935
|
return func + '';
|
|
1054
936
|
} catch (e) {}
|
|
1055
937
|
}
|
|
1056
|
-
|
|
1057
938
|
return '';
|
|
1058
939
|
}
|
|
940
|
+
|
|
1059
941
|
/**
|
|
1060
942
|
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
1061
943
|
* provided, it determines the cache key for storing the result based on the
|
|
@@ -1100,33 +982,28 @@ function toSource(func) {
|
|
|
1100
982
|
* // Replace `_.memoize.Cache`.
|
|
1101
983
|
* _.memoize.Cache = WeakMap;
|
|
1102
984
|
*/
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
985
|
function memoize(func, resolver) {
|
|
1106
986
|
if (typeof func !== 'function' || resolver && typeof resolver !== 'function') {
|
|
1107
987
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1108
988
|
}
|
|
1109
|
-
|
|
1110
989
|
var memoized = function memoized() {
|
|
1111
990
|
var args = arguments,
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
991
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
992
|
+
cache = memoized.cache;
|
|
1115
993
|
if (cache.has(key)) {
|
|
1116
994
|
return cache.get(key);
|
|
1117
995
|
}
|
|
1118
|
-
|
|
1119
996
|
var result = func.apply(this, args);
|
|
1120
997
|
memoized.cache = cache.set(key, result);
|
|
1121
998
|
return result;
|
|
1122
999
|
};
|
|
1123
|
-
|
|
1124
1000
|
memoized.cache = new (memoize.Cache || MapCache)();
|
|
1125
1001
|
return memoized;
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1002
|
+
}
|
|
1128
1003
|
|
|
1004
|
+
// Assign cache to `_.memoize`.
|
|
1129
1005
|
memoize.Cache = MapCache;
|
|
1006
|
+
|
|
1130
1007
|
/**
|
|
1131
1008
|
* Performs a
|
|
1132
1009
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
@@ -1159,10 +1036,10 @@ memoize.Cache = MapCache;
|
|
|
1159
1036
|
* _.eq(NaN, NaN);
|
|
1160
1037
|
* // => true
|
|
1161
1038
|
*/
|
|
1162
|
-
|
|
1163
1039
|
function eq(value, other) {
|
|
1164
1040
|
return value === other || value !== value && other !== other;
|
|
1165
1041
|
}
|
|
1042
|
+
|
|
1166
1043
|
/**
|
|
1167
1044
|
* Checks if `value` is classified as an `Array` object.
|
|
1168
1045
|
*
|
|
@@ -1186,9 +1063,8 @@ function eq(value, other) {
|
|
|
1186
1063
|
* _.isArray(_.noop);
|
|
1187
1064
|
* // => false
|
|
1188
1065
|
*/
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
1066
|
var isArray = Array.isArray;
|
|
1067
|
+
|
|
1192
1068
|
/**
|
|
1193
1069
|
* Checks if `value` is classified as a `Function` object.
|
|
1194
1070
|
*
|
|
@@ -1206,13 +1082,13 @@ var isArray = Array.isArray;
|
|
|
1206
1082
|
* _.isFunction(/abc/);
|
|
1207
1083
|
* // => false
|
|
1208
1084
|
*/
|
|
1209
|
-
|
|
1210
1085
|
function isFunction(value) {
|
|
1211
1086
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
1212
1087
|
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
1213
1088
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
|
1214
1089
|
return tag == funcTag || tag == genTag;
|
|
1215
1090
|
}
|
|
1091
|
+
|
|
1216
1092
|
/**
|
|
1217
1093
|
* Checks if `value` is the
|
|
1218
1094
|
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
@@ -1238,13 +1114,11 @@ function isFunction(value) {
|
|
|
1238
1114
|
* _.isObject(null);
|
|
1239
1115
|
* // => false
|
|
1240
1116
|
*/
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
1117
|
function isObject(value) {
|
|
1244
1118
|
var type = _typeof(value);
|
|
1245
|
-
|
|
1246
1119
|
return !!value && (type == 'object' || type == 'function');
|
|
1247
1120
|
}
|
|
1121
|
+
|
|
1248
1122
|
/**
|
|
1249
1123
|
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1250
1124
|
* and has a `typeof` result of "object".
|
|
@@ -1269,11 +1143,10 @@ function isObject(value) {
|
|
|
1269
1143
|
* _.isObjectLike(null);
|
|
1270
1144
|
* // => false
|
|
1271
1145
|
*/
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
1146
|
function isObjectLike(value) {
|
|
1275
1147
|
return !!value && _typeof(value) === 'object';
|
|
1276
1148
|
}
|
|
1149
|
+
|
|
1277
1150
|
/**
|
|
1278
1151
|
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
1279
1152
|
*
|
|
@@ -1291,11 +1164,10 @@ function isObjectLike(value) {
|
|
|
1291
1164
|
* _.isSymbol('abc');
|
|
1292
1165
|
* // => false
|
|
1293
1166
|
*/
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
1167
|
function isSymbol(value) {
|
|
1297
1168
|
return _typeof(value) === 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
|
|
1298
1169
|
}
|
|
1170
|
+
|
|
1299
1171
|
/**
|
|
1300
1172
|
* Converts `value` to a string. An empty string is returned for `null`
|
|
1301
1173
|
* and `undefined` values. The sign of `-0` is preserved.
|
|
@@ -1317,11 +1189,10 @@ function isSymbol(value) {
|
|
|
1317
1189
|
* _.toString([1, 2, 3]);
|
|
1318
1190
|
* // => '1,2,3'
|
|
1319
1191
|
*/
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
1192
|
function toString(value) {
|
|
1323
1193
|
return value == null ? '' : baseToString(value);
|
|
1324
1194
|
}
|
|
1195
|
+
|
|
1325
1196
|
/**
|
|
1326
1197
|
* Checks if `value` is a valid array-like index.
|
|
1327
1198
|
*
|
|
@@ -1330,14 +1201,12 @@ function toString(value) {
|
|
|
1330
1201
|
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
1331
1202
|
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
1332
1203
|
*/
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
1204
|
function isIndex(value, length) {
|
|
1336
1205
|
var type = _typeof(value);
|
|
1337
|
-
|
|
1338
1206
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
1339
1207
|
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
1340
1208
|
}
|
|
1209
|
+
|
|
1341
1210
|
/**
|
|
1342
1211
|
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
1343
1212
|
* value checks.
|
|
@@ -1347,8 +1216,6 @@ function isIndex(value, length) {
|
|
|
1347
1216
|
* @param {string} key The key of the property to assign.
|
|
1348
1217
|
* @param {*} value The value to assign.
|
|
1349
1218
|
*/
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
1219
|
function baseAssignValue(object, key, value) {
|
|
1353
1220
|
if (key == '__proto__') {
|
|
1354
1221
|
Object.defineProperty(object, key, {
|
|
@@ -1361,10 +1228,10 @@ function baseAssignValue(object, key, value) {
|
|
|
1361
1228
|
object[key] = value;
|
|
1362
1229
|
}
|
|
1363
1230
|
}
|
|
1364
|
-
/** Used to check objects for own properties. */
|
|
1365
|
-
|
|
1366
1231
|
|
|
1232
|
+
/** Used to check objects for own properties. */
|
|
1367
1233
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1234
|
+
|
|
1368
1235
|
/**
|
|
1369
1236
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
1370
1237
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
@@ -1375,14 +1242,13 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
|
1375
1242
|
* @param {string} key The key of the property to assign.
|
|
1376
1243
|
* @param {*} value The value to assign.
|
|
1377
1244
|
*/
|
|
1378
|
-
|
|
1379
1245
|
function assignValue(object, key, value) {
|
|
1380
1246
|
var objValue = object[key];
|
|
1381
|
-
|
|
1382
1247
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
|
|
1383
1248
|
baseAssignValue(object, key, value);
|
|
1384
1249
|
}
|
|
1385
1250
|
}
|
|
1251
|
+
|
|
1386
1252
|
/**
|
|
1387
1253
|
* The base implementation of `set`.
|
|
1388
1254
|
*
|
|
@@ -1393,36 +1259,28 @@ function assignValue(object, key, value) {
|
|
|
1393
1259
|
* @param {Function} [customizer] The function to customize path creation.
|
|
1394
1260
|
* @returns {Object} Returns `object`.
|
|
1395
1261
|
*/
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
1262
|
function baseSet(object, path, value, customizer) {
|
|
1399
1263
|
if (!isObject(object)) {
|
|
1400
1264
|
return object;
|
|
1401
1265
|
}
|
|
1402
|
-
|
|
1403
1266
|
path = castPath(path, object);
|
|
1404
1267
|
var length = path.length;
|
|
1405
1268
|
var lastIndex = length - 1;
|
|
1406
1269
|
var index = -1;
|
|
1407
1270
|
var nested = object;
|
|
1408
|
-
|
|
1409
1271
|
while (nested != null && ++index < length) {
|
|
1410
1272
|
var key = toKey(path[index]);
|
|
1411
1273
|
var newValue = value;
|
|
1412
|
-
|
|
1413
1274
|
if (index != lastIndex) {
|
|
1414
1275
|
var objValue = nested[key];
|
|
1415
1276
|
newValue = customizer ? customizer(objValue, key, nested) : undefined;
|
|
1416
|
-
|
|
1417
1277
|
if (newValue === undefined) {
|
|
1418
1278
|
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
|
|
1419
1279
|
}
|
|
1420
1280
|
}
|
|
1421
|
-
|
|
1422
1281
|
assignValue(nested, key, newValue);
|
|
1423
1282
|
nested = nested[key];
|
|
1424
1283
|
}
|
|
1425
|
-
|
|
1426
1284
|
return object;
|
|
1427
1285
|
}
|
|
1428
1286
|
|
|
@@ -1451,7 +1309,6 @@ function baseSet(object, path, value, customizer) {
|
|
|
1451
1309
|
* _.get(object, 'a.b.c', 'default');
|
|
1452
1310
|
* // => 'default'
|
|
1453
1311
|
*/
|
|
1454
|
-
|
|
1455
1312
|
function get(object, path, defaultValue) {
|
|
1456
1313
|
var result = object == null ? undefined : baseGet(object, path);
|
|
1457
1314
|
return result === undefined ? defaultValue : result;
|
|
@@ -1484,42 +1341,33 @@ function get(object, path, defaultValue) {
|
|
|
1484
1341
|
* console.log(object.x[0].y.z)
|
|
1485
1342
|
* // => 5
|
|
1486
1343
|
*/
|
|
1487
|
-
|
|
1488
1344
|
function set$1(object, path, value) {
|
|
1489
1345
|
return object == null ? object : baseSet(object, path, value);
|
|
1490
1346
|
}
|
|
1491
1347
|
|
|
1492
1348
|
var upperCasePattern = /([A-Z])/g;
|
|
1493
|
-
|
|
1494
1349
|
function dashify(str) {
|
|
1495
1350
|
return str.replace(upperCasePattern, dashLower);
|
|
1496
1351
|
}
|
|
1497
|
-
|
|
1498
1352
|
function dashLower(c) {
|
|
1499
1353
|
return '-' + c.toLowerCase();
|
|
1500
1354
|
}
|
|
1501
|
-
|
|
1502
1355
|
function isObject$1(val) {
|
|
1503
1356
|
return val != null && _typeof(val) === 'object' && Array.isArray(val) === false;
|
|
1504
1357
|
}
|
|
1505
|
-
|
|
1506
1358
|
function inlineStyle(obj) {
|
|
1507
1359
|
if (obj == null) {
|
|
1508
1360
|
return '';
|
|
1509
1361
|
}
|
|
1510
|
-
|
|
1511
1362
|
if (typeof obj === 'string') {
|
|
1512
1363
|
return obj;
|
|
1513
1364
|
}
|
|
1514
|
-
|
|
1515
1365
|
if (obj === null || obj === undefined) {
|
|
1516
1366
|
return '';
|
|
1517
1367
|
}
|
|
1518
|
-
|
|
1519
1368
|
if (!isObject$1(obj)) {
|
|
1520
1369
|
throw new TypeError('style 只能是一个对象或字符串。');
|
|
1521
1370
|
}
|
|
1522
|
-
|
|
1523
1371
|
return Object.keys(obj).map(function (key) {
|
|
1524
1372
|
return dashify(key).concat(':').concat(obj[key]);
|
|
1525
1373
|
}).join(';');
|
|
@@ -1536,99 +1384,82 @@ var ENV_TYPE = {
|
|
|
1536
1384
|
QQ: 'QQ',
|
|
1537
1385
|
JD: 'JD'
|
|
1538
1386
|
};
|
|
1539
|
-
var _env = null;
|
|
1387
|
+
var _env = null;
|
|
1540
1388
|
|
|
1389
|
+
// 一个taro项目肯定运行同样的环境
|
|
1541
1390
|
function getEnv() {
|
|
1542
1391
|
if (_env) return _env;
|
|
1543
|
-
|
|
1544
1392
|
if (typeof jd !== 'undefined' && jd.getSystemInfo) {
|
|
1545
1393
|
_env = ENV_TYPE.JD;
|
|
1546
1394
|
return ENV_TYPE.JD;
|
|
1547
1395
|
}
|
|
1548
|
-
|
|
1549
1396
|
if (typeof qq !== 'undefined' && qq.getSystemInfo) {
|
|
1550
1397
|
_env = ENV_TYPE.QQ;
|
|
1551
1398
|
return ENV_TYPE.QQ;
|
|
1552
1399
|
}
|
|
1553
|
-
|
|
1554
1400
|
if (typeof tt !== 'undefined' && tt.getSystemInfo) {
|
|
1555
1401
|
_env = ENV_TYPE.TT;
|
|
1556
1402
|
return ENV_TYPE.TT;
|
|
1557
1403
|
}
|
|
1558
|
-
|
|
1559
1404
|
if (typeof wx !== 'undefined' && wx.getSystemInfo) {
|
|
1560
1405
|
_env = ENV_TYPE.WEAPP;
|
|
1561
1406
|
return ENV_TYPE.WEAPP;
|
|
1562
1407
|
}
|
|
1563
|
-
|
|
1564
1408
|
if (typeof swan !== 'undefined' && swan.getSystemInfo) {
|
|
1565
1409
|
_env = ENV_TYPE.SWAN;
|
|
1566
1410
|
return ENV_TYPE.SWAN;
|
|
1567
1411
|
}
|
|
1568
|
-
|
|
1569
1412
|
if (typeof my !== 'undefined' && my.getSystemInfo) {
|
|
1570
1413
|
_env = ENV_TYPE.ALIPAY;
|
|
1571
1414
|
return ENV_TYPE.ALIPAY;
|
|
1572
1415
|
}
|
|
1573
|
-
|
|
1574
1416
|
if (typeof global !== 'undefined' && global.__fbGenNativeModule) {
|
|
1575
1417
|
_env = ENV_TYPE.RN;
|
|
1576
1418
|
return ENV_TYPE.RN;
|
|
1577
1419
|
}
|
|
1578
|
-
|
|
1579
1420
|
if (typeof global !== 'undefined' && global.getManifestField) {
|
|
1580
1421
|
_env = ENV_TYPE.QUICKAPP;
|
|
1581
1422
|
return ENV_TYPE.QUICKAPP;
|
|
1582
1423
|
}
|
|
1583
|
-
|
|
1584
1424
|
if (typeof window !== 'undefined') {
|
|
1585
1425
|
_env = ENV_TYPE.WEB;
|
|
1586
1426
|
return ENV_TYPE.WEB;
|
|
1587
1427
|
}
|
|
1588
|
-
|
|
1589
1428
|
return 'Unknown environment';
|
|
1590
1429
|
}
|
|
1591
1430
|
|
|
1592
1431
|
function isObject$2(arg) {
|
|
1593
1432
|
return arg === Object(arg) && typeof arg !== 'function';
|
|
1594
1433
|
}
|
|
1595
|
-
|
|
1596
1434
|
var env = null;
|
|
1597
1435
|
function getOriginal(item) {
|
|
1598
1436
|
if (env === null) {
|
|
1599
1437
|
env = getEnv();
|
|
1600
1438
|
}
|
|
1601
|
-
|
|
1602
1439
|
if (isObject$2(item)) {
|
|
1603
1440
|
return item[env === ENV_TYPE.SWAN ? 'privateOriginal' : '$original'] || item;
|
|
1604
1441
|
}
|
|
1605
|
-
|
|
1606
1442
|
return item;
|
|
1607
1443
|
}
|
|
1608
1444
|
|
|
1609
1445
|
var Events = /*#__PURE__*/function () {
|
|
1610
1446
|
function Events(opts) {
|
|
1611
1447
|
_classCallCheck(this, Events);
|
|
1612
|
-
|
|
1613
1448
|
if (typeof opts !== 'undefined' && opts.callbacks) {
|
|
1614
1449
|
this.callbacks = opts.callbacks;
|
|
1615
1450
|
} else {
|
|
1616
1451
|
this.callbacks = {};
|
|
1617
1452
|
}
|
|
1618
1453
|
}
|
|
1619
|
-
|
|
1620
1454
|
_createClass(Events, [{
|
|
1621
1455
|
key: "on",
|
|
1622
1456
|
value: function on(events, callback, context) {
|
|
1623
1457
|
var calls, event, node, tail, list;
|
|
1624
|
-
|
|
1625
1458
|
if (!callback) {
|
|
1626
1459
|
return this;
|
|
1627
1460
|
}
|
|
1628
|
-
|
|
1629
1461
|
events = events.split(Events.eventSplitter);
|
|
1630
1462
|
calls = this.callbacks;
|
|
1631
|
-
|
|
1632
1463
|
while (event = events.shift()) {
|
|
1633
1464
|
list = calls[event];
|
|
1634
1465
|
node = list ? list.tail : {};
|
|
@@ -1640,24 +1471,19 @@ var Events = /*#__PURE__*/function () {
|
|
|
1640
1471
|
next: list ? list.next : node
|
|
1641
1472
|
};
|
|
1642
1473
|
}
|
|
1643
|
-
|
|
1644
1474
|
return this;
|
|
1645
1475
|
}
|
|
1646
1476
|
}, {
|
|
1647
1477
|
key: "once",
|
|
1648
1478
|
value: function once(events, callback, context) {
|
|
1649
1479
|
var _this = this;
|
|
1650
|
-
|
|
1651
1480
|
var wrapper = function wrapper() {
|
|
1652
1481
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1653
1482
|
args[_key] = arguments[_key];
|
|
1654
1483
|
}
|
|
1655
|
-
|
|
1656
1484
|
callback.apply(_this, args);
|
|
1657
|
-
|
|
1658
1485
|
_this.off(events, wrapper, context);
|
|
1659
1486
|
};
|
|
1660
|
-
|
|
1661
1487
|
this.on(events, wrapper, context);
|
|
1662
1488
|
return this;
|
|
1663
1489
|
}
|
|
@@ -1665,69 +1491,53 @@ var Events = /*#__PURE__*/function () {
|
|
|
1665
1491
|
key: "off",
|
|
1666
1492
|
value: function off(events, callback, context) {
|
|
1667
1493
|
var event, calls, node, tail, cb, ctx;
|
|
1668
|
-
|
|
1669
1494
|
if (!(calls = this.callbacks)) {
|
|
1670
1495
|
return this;
|
|
1671
1496
|
}
|
|
1672
|
-
|
|
1673
1497
|
if (!(events || callback || context)) {
|
|
1674
1498
|
delete this.callbacks;
|
|
1675
1499
|
return this;
|
|
1676
1500
|
}
|
|
1677
|
-
|
|
1678
1501
|
events = events ? events.split(Events.eventSplitter) : Object.keys(calls);
|
|
1679
|
-
|
|
1680
1502
|
while (event = events.shift()) {
|
|
1681
1503
|
node = calls[event];
|
|
1682
1504
|
delete calls[event];
|
|
1683
|
-
|
|
1684
1505
|
if (!node || !(callback || context)) {
|
|
1685
1506
|
continue;
|
|
1686
1507
|
}
|
|
1687
|
-
|
|
1688
1508
|
tail = node.tail;
|
|
1689
|
-
|
|
1690
1509
|
while ((node = node.next) !== tail) {
|
|
1691
1510
|
cb = node.callback;
|
|
1692
1511
|
ctx = node.context;
|
|
1693
|
-
|
|
1694
1512
|
if (callback && cb !== callback || context && ctx !== context) {
|
|
1695
1513
|
this.on(event, cb, ctx);
|
|
1696
1514
|
}
|
|
1697
1515
|
}
|
|
1698
1516
|
}
|
|
1699
|
-
|
|
1700
1517
|
return this;
|
|
1701
1518
|
}
|
|
1702
1519
|
}, {
|
|
1703
1520
|
key: "trigger",
|
|
1704
1521
|
value: function trigger(events) {
|
|
1705
1522
|
var event, node, calls, tail, rest;
|
|
1706
|
-
|
|
1707
1523
|
if (!(calls = this.callbacks)) {
|
|
1708
1524
|
return this;
|
|
1709
1525
|
}
|
|
1710
|
-
|
|
1711
1526
|
events = events.split(Events.eventSplitter);
|
|
1712
1527
|
rest = [].slice.call(arguments, 1);
|
|
1713
|
-
|
|
1714
1528
|
while (event = events.shift()) {
|
|
1715
1529
|
if (node = calls[event]) {
|
|
1716
1530
|
tail = node.tail;
|
|
1717
|
-
|
|
1718
1531
|
while ((node = node.next) !== tail) {
|
|
1719
1532
|
node.callback.apply(node.context || this, rest);
|
|
1720
1533
|
}
|
|
1721
1534
|
}
|
|
1722
1535
|
}
|
|
1723
|
-
|
|
1724
1536
|
return this;
|
|
1725
1537
|
}
|
|
1726
1538
|
}]);
|
|
1727
|
-
|
|
1728
1539
|
return Events;
|
|
1729
1540
|
}();
|
|
1730
|
-
|
|
1731
1541
|
Events.eventSplitter = /\s+/;
|
|
1732
1542
|
|
|
1733
1543
|
function render() {}
|
|
@@ -1737,6 +1547,7 @@ function createRef() {
|
|
|
1737
1547
|
current: null
|
|
1738
1548
|
};
|
|
1739
1549
|
}
|
|
1550
|
+
|
|
1740
1551
|
/**
|
|
1741
1552
|
* 赋值 ref
|
|
1742
1553
|
* @param {Object} ref ref 对象/ref 函数/ref 字符串
|
|
@@ -1744,11 +1555,9 @@ function createRef() {
|
|
|
1744
1555
|
* @param {Object} component 组件实例
|
|
1745
1556
|
* @param {Object} refs 字符串 ref 搜集器
|
|
1746
1557
|
*/
|
|
1747
|
-
|
|
1748
1558
|
function commitAttachRef(ref, target, component, refs) {
|
|
1749
1559
|
var isInit = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
1750
1560
|
if (isInit && !target) return;
|
|
1751
|
-
|
|
1752
1561
|
if ('refName' in ref && ref['refName']) {
|
|
1753
1562
|
refs[ref.refName] = target;
|
|
1754
1563
|
} else if ('fn' in ref && typeof ref['fn'] === 'function') {
|
|
@@ -1765,7 +1574,6 @@ function detachAllRef(component) {
|
|
|
1765
1574
|
} else if (ref['fn'] && _typeof(ref['fn']) === 'object' && 'current' in ref['fn']) {
|
|
1766
1575
|
ref['fn'].current = null;
|
|
1767
1576
|
}
|
|
1768
|
-
|
|
1769
1577
|
if ('target' in ref) delete ref['target'];
|
|
1770
1578
|
});
|
|
1771
1579
|
component.refs = {};
|
|
@@ -1773,29 +1581,22 @@ function detachAllRef(component) {
|
|
|
1773
1581
|
}
|
|
1774
1582
|
var RefsArray = /*#__PURE__*/function (_Array) {
|
|
1775
1583
|
_inherits(RefsArray, _Array);
|
|
1776
|
-
|
|
1777
1584
|
var _super = _createSuper(RefsArray);
|
|
1778
|
-
|
|
1779
1585
|
/**
|
|
1780
1586
|
* @param {Array} initList
|
|
1781
1587
|
*/
|
|
1782
1588
|
function RefsArray() {
|
|
1783
1589
|
var _this;
|
|
1784
|
-
|
|
1785
1590
|
var initList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1786
|
-
|
|
1787
1591
|
_classCallCheck(this, RefsArray);
|
|
1788
|
-
|
|
1789
1592
|
_this = _super.call.apply(_super, [this].concat(_toConsumableArray(initList)));
|
|
1790
1593
|
_this.inited = false;
|
|
1791
1594
|
return _this;
|
|
1792
1595
|
}
|
|
1793
|
-
|
|
1794
1596
|
_createClass(RefsArray, [{
|
|
1795
1597
|
key: "pushRefs",
|
|
1796
1598
|
value: function pushRefs($$refs) {
|
|
1797
1599
|
var _this2 = this;
|
|
1798
|
-
|
|
1799
1600
|
if (this.inited) return;
|
|
1800
1601
|
$$refs.forEach(function (ref) {
|
|
1801
1602
|
return _this2.pushRef(ref);
|
|
@@ -1811,20 +1612,16 @@ var RefsArray = /*#__PURE__*/function (_Array) {
|
|
|
1811
1612
|
!isExist && this.push(ref);
|
|
1812
1613
|
}
|
|
1813
1614
|
}]);
|
|
1814
|
-
|
|
1815
1615
|
return RefsArray;
|
|
1816
1616
|
}( /*#__PURE__*/_wrapNativeSuper(Array));
|
|
1817
1617
|
function handleLoopRef(getElementById) {
|
|
1818
1618
|
return function (component, id, type, handler) {
|
|
1819
1619
|
if (!component) return null;
|
|
1820
1620
|
var dom = getElementById(component, id, type);
|
|
1821
|
-
|
|
1822
1621
|
var handlerType = _typeof(handler);
|
|
1823
|
-
|
|
1824
1622
|
if (handlerType !== 'function' && handlerType !== 'object') {
|
|
1825
1623
|
return console.warn("\u5FAA\u73AF Ref \u53EA\u652F\u6301\u51FD\u6570\u6216 createRef()\uFF0C\u5F53\u524D\u7C7B\u578B\u4E3A\uFF1A".concat(handlerType));
|
|
1826
1624
|
}
|
|
1827
|
-
|
|
1828
1625
|
if (handlerType === 'object') {
|
|
1829
1626
|
handler.current = dom;
|
|
1830
1627
|
} else if (handlerType === 'function') {
|
|
@@ -1837,27 +1634,20 @@ var Chain = /*#__PURE__*/function () {
|
|
|
1837
1634
|
function Chain(requestParams) {
|
|
1838
1635
|
var interceptors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
1839
1636
|
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1840
|
-
|
|
1841
1637
|
_classCallCheck(this, Chain);
|
|
1842
|
-
|
|
1843
1638
|
this.index = index;
|
|
1844
1639
|
this.requestParams = requestParams;
|
|
1845
1640
|
this.interceptors = interceptors;
|
|
1846
1641
|
}
|
|
1847
|
-
|
|
1848
1642
|
_createClass(Chain, [{
|
|
1849
1643
|
key: "proceed",
|
|
1850
1644
|
value: function proceed(requestParams) {
|
|
1851
1645
|
this.requestParams = requestParams;
|
|
1852
|
-
|
|
1853
1646
|
if (this.index >= this.interceptors.length) {
|
|
1854
1647
|
throw new Error('chain 参数错误, 请勿直接修改 request.chain');
|
|
1855
1648
|
}
|
|
1856
|
-
|
|
1857
1649
|
var nextInterceptor = this._getNextInterceptor();
|
|
1858
|
-
|
|
1859
1650
|
var nextChain = this._getNextChain();
|
|
1860
|
-
|
|
1861
1651
|
var p = nextInterceptor(nextChain);
|
|
1862
1652
|
var res = p["catch"](function (err) {
|
|
1863
1653
|
return Promise.reject(err);
|
|
@@ -1878,23 +1668,19 @@ var Chain = /*#__PURE__*/function () {
|
|
|
1878
1668
|
return new Chain(this.requestParams, this.interceptors, this.index + 1);
|
|
1879
1669
|
}
|
|
1880
1670
|
}]);
|
|
1881
|
-
|
|
1882
1671
|
return Chain;
|
|
1883
1672
|
}();
|
|
1884
1673
|
|
|
1885
1674
|
var Link = /*#__PURE__*/function () {
|
|
1886
1675
|
function Link(interceptor) {
|
|
1887
1676
|
_classCallCheck(this, Link);
|
|
1888
|
-
|
|
1889
1677
|
this.taroInterceptor = interceptor;
|
|
1890
1678
|
this.chain = new Chain();
|
|
1891
1679
|
}
|
|
1892
|
-
|
|
1893
1680
|
_createClass(Link, [{
|
|
1894
1681
|
key: "request",
|
|
1895
1682
|
value: function request(requestParams) {
|
|
1896
1683
|
var _this = this;
|
|
1897
|
-
|
|
1898
1684
|
this.chain.interceptors = this.chain.interceptors.filter(function (interceptor) {
|
|
1899
1685
|
return interceptor !== _this.taroInterceptor;
|
|
1900
1686
|
});
|
|
@@ -1912,7 +1698,6 @@ var Link = /*#__PURE__*/function () {
|
|
|
1912
1698
|
this.chain = new Chain();
|
|
1913
1699
|
}
|
|
1914
1700
|
}]);
|
|
1915
|
-
|
|
1916
1701
|
return Link;
|
|
1917
1702
|
}();
|
|
1918
1703
|
|
|
@@ -1940,8 +1725,8 @@ function timeoutInterceptor(chain) {
|
|
|
1940
1725
|
function logInterceptor(chain) {
|
|
1941
1726
|
var requestParams = chain.requestParams;
|
|
1942
1727
|
var method = requestParams.method,
|
|
1943
|
-
|
|
1944
|
-
|
|
1728
|
+
data = requestParams.data,
|
|
1729
|
+
url = requestParams.url;
|
|
1945
1730
|
console.log("http ".concat(method || 'GET', " --> ").concat(url, " data: "), data);
|
|
1946
1731
|
var p = chain.proceed(requestParams);
|
|
1947
1732
|
var res = p.then(function (res) {
|
|
@@ -2257,31 +2042,29 @@ var otherApis = {
|
|
|
2257
2042
|
navigateBackSmartProgram: true,
|
|
2258
2043
|
preloadSubPackage: true
|
|
2259
2044
|
};
|
|
2260
|
-
|
|
2261
2045
|
function initPxTransform(config) {
|
|
2262
2046
|
var _config$designWidth = config.designWidth,
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2047
|
+
designWidth = _config$designWidth === void 0 ? 700 : _config$designWidth,
|
|
2048
|
+
_config$deviceRatio = config.deviceRatio,
|
|
2049
|
+
deviceRatio = _config$deviceRatio === void 0 ? {
|
|
2050
|
+
'640': 2.34 / 2,
|
|
2051
|
+
'750': 1,
|
|
2052
|
+
'828': 1.81 / 2
|
|
2053
|
+
} : _config$deviceRatio;
|
|
2270
2054
|
this.config = this.config || {};
|
|
2271
2055
|
this.config.designWidth = designWidth;
|
|
2272
2056
|
this.config.deviceRatio = deviceRatio;
|
|
2273
2057
|
}
|
|
2274
2058
|
|
|
2059
|
+
// Object.is polyfill
|
|
2275
2060
|
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
2276
|
-
|
|
2277
2061
|
function objectIs(x, y) {
|
|
2278
2062
|
if (x === y) {
|
|
2279
2063
|
// Steps 1-5, 7-10
|
|
2280
2064
|
// Steps 6.b-6.e: +0 != -0
|
|
2281
2065
|
return x !== 0 || 1 / x === 1 / y;
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
|
|
2066
|
+
}
|
|
2067
|
+
// eslint-disable-next-line no-self-compare
|
|
2285
2068
|
return x !== x && y !== y;
|
|
2286
2069
|
}
|
|
2287
2070
|
function isFunction$1(arg) {
|
|
@@ -2312,7 +2095,6 @@ if (process.env.TARO_ENV === 'alipay') {
|
|
|
2312
2095
|
index: 0
|
|
2313
2096
|
};
|
|
2314
2097
|
}
|
|
2315
|
-
|
|
2316
2098
|
exports.Current = my.Current;
|
|
2317
2099
|
} else {
|
|
2318
2100
|
exports.Current = {
|
|
@@ -2321,30 +2103,24 @@ if (process.env.TARO_ENV === 'alipay') {
|
|
|
2321
2103
|
};
|
|
2322
2104
|
}
|
|
2323
2105
|
|
|
2324
|
-
function forceUpdateCallback() {
|
|
2106
|
+
function forceUpdateCallback() {
|
|
2107
|
+
//
|
|
2325
2108
|
}
|
|
2326
|
-
|
|
2327
2109
|
function getHooks(index) {
|
|
2328
2110
|
if (exports.Current.current === null) {
|
|
2329
2111
|
throw new Error("invalid hooks call: hooks can only be called in a stateless component.");
|
|
2330
2112
|
}
|
|
2331
|
-
|
|
2332
2113
|
var hooks = exports.Current.current.hooks;
|
|
2333
|
-
|
|
2334
2114
|
if (index >= hooks.length) {
|
|
2335
2115
|
hooks.push({});
|
|
2336
2116
|
}
|
|
2337
|
-
|
|
2338
2117
|
return hooks[index];
|
|
2339
2118
|
}
|
|
2340
|
-
|
|
2341
2119
|
function useState(initialState) {
|
|
2342
2120
|
if (isFunction$1(initialState)) {
|
|
2343
2121
|
initialState = initialState();
|
|
2344
2122
|
}
|
|
2345
|
-
|
|
2346
2123
|
var hook = getHooks(exports.Current.index++);
|
|
2347
|
-
|
|
2348
2124
|
if (!hook.state) {
|
|
2349
2125
|
hook.component = exports.Current.current;
|
|
2350
2126
|
hook.state = [initialState, function (action) {
|
|
@@ -2355,20 +2131,16 @@ function useState(initialState) {
|
|
|
2355
2131
|
hook.component.setState({}, forceUpdateCallback);
|
|
2356
2132
|
}];
|
|
2357
2133
|
}
|
|
2358
|
-
|
|
2359
2134
|
return hook.state;
|
|
2360
2135
|
}
|
|
2361
|
-
|
|
2362
2136
|
function usePageLifecycle(callback, lifecycle) {
|
|
2363
2137
|
var hook = getHooks(exports.Current.index++);
|
|
2364
|
-
|
|
2365
2138
|
if (!hook.marked) {
|
|
2366
2139
|
hook.marked = true;
|
|
2367
2140
|
hook.component = exports.Current.current;
|
|
2368
2141
|
hook.callback = callback;
|
|
2369
2142
|
var component = hook.component;
|
|
2370
2143
|
var originalLifecycle = component[lifecycle];
|
|
2371
|
-
|
|
2372
2144
|
hook.component[lifecycle] = function () {
|
|
2373
2145
|
var callback = hook.callback;
|
|
2374
2146
|
originalLifecycle && originalLifecycle.call.apply(originalLifecycle, [component].concat(Array.prototype.slice.call(arguments)));
|
|
@@ -2378,7 +2150,6 @@ function usePageLifecycle(callback, lifecycle) {
|
|
|
2378
2150
|
hook.callback = callback;
|
|
2379
2151
|
}
|
|
2380
2152
|
}
|
|
2381
|
-
|
|
2382
2153
|
function useDidShow(callback) {
|
|
2383
2154
|
usePageLifecycle(callback, 'componentDidShow');
|
|
2384
2155
|
}
|
|
@@ -2411,31 +2182,25 @@ function useAddToFavorites(callback) {
|
|
|
2411
2182
|
}
|
|
2412
2183
|
function useRouter() {
|
|
2413
2184
|
var hook = getHooks(exports.Current.index++);
|
|
2414
|
-
|
|
2415
2185
|
if (!hook.router) {
|
|
2416
2186
|
hook.component = exports.Current.current;
|
|
2417
2187
|
hook.router = hook.component.$router;
|
|
2418
2188
|
}
|
|
2419
|
-
|
|
2420
2189
|
return hook.router;
|
|
2421
2190
|
}
|
|
2422
2191
|
function useScope() {
|
|
2423
2192
|
var hook = getHooks(exports.Current.index++);
|
|
2424
|
-
|
|
2425
2193
|
if (!hook.scope) {
|
|
2426
2194
|
hook.component = exports.Current.current;
|
|
2427
2195
|
hook.scope = hook.component.$scope;
|
|
2428
2196
|
}
|
|
2429
|
-
|
|
2430
2197
|
return hook.scope;
|
|
2431
2198
|
}
|
|
2432
2199
|
function useReducer(reducer, initialState, initializer) {
|
|
2433
2200
|
if (isFunction$1(initialState)) {
|
|
2434
2201
|
initialState = initialState();
|
|
2435
2202
|
}
|
|
2436
|
-
|
|
2437
2203
|
var hook = getHooks(exports.Current.index++);
|
|
2438
|
-
|
|
2439
2204
|
if (!hook.state) {
|
|
2440
2205
|
hook.component = exports.Current.current;
|
|
2441
2206
|
hook.state = [isUndefined(initializer) ? initialState : initializer(initialState), function (action) {
|
|
@@ -2444,34 +2209,27 @@ function useReducer(reducer, initialState, initializer) {
|
|
|
2444
2209
|
hook.component.setState({}, forceUpdateCallback);
|
|
2445
2210
|
}];
|
|
2446
2211
|
}
|
|
2447
|
-
|
|
2448
2212
|
return hook.state;
|
|
2449
2213
|
}
|
|
2450
|
-
|
|
2451
2214
|
function areDepsChanged(prevDeps, deps) {
|
|
2452
2215
|
if (isNullOrUndef(prevDeps) || isNullOrUndef(deps)) {
|
|
2453
2216
|
return true;
|
|
2454
2217
|
}
|
|
2455
|
-
|
|
2456
2218
|
return deps.some(function (d, i) {
|
|
2457
2219
|
return !objectIs(d, prevDeps[i]);
|
|
2458
2220
|
});
|
|
2459
2221
|
}
|
|
2460
|
-
|
|
2461
2222
|
function invokeEffects(component, delay) {
|
|
2462
2223
|
var effects = delay ? component.effects : component.layoutEffects;
|
|
2463
2224
|
effects.forEach(function (hook) {
|
|
2464
2225
|
if (isFunction$1(hook.cleanup)) {
|
|
2465
2226
|
hook.cleanup();
|
|
2466
2227
|
}
|
|
2467
|
-
|
|
2468
2228
|
var result = hook.effect();
|
|
2469
|
-
|
|
2470
2229
|
if (isFunction$1(result)) {
|
|
2471
2230
|
hook.cleanup = result;
|
|
2472
2231
|
}
|
|
2473
2232
|
});
|
|
2474
|
-
|
|
2475
2233
|
if (delay) {
|
|
2476
2234
|
component.effects = [];
|
|
2477
2235
|
} else {
|
|
@@ -2479,12 +2237,10 @@ function invokeEffects(component, delay) {
|
|
|
2479
2237
|
}
|
|
2480
2238
|
}
|
|
2481
2239
|
var scheduleEffectComponents = [];
|
|
2482
|
-
|
|
2483
2240
|
function invokeScheduleEffects(component) {
|
|
2484
2241
|
if (!component._afterScheduleEffect) {
|
|
2485
2242
|
component._afterScheduleEffect = true;
|
|
2486
2243
|
scheduleEffectComponents.push(component);
|
|
2487
|
-
|
|
2488
2244
|
if (scheduleEffectComponents.length === 1) {
|
|
2489
2245
|
defer(function () {
|
|
2490
2246
|
setTimeout(function () {
|
|
@@ -2498,18 +2254,14 @@ function invokeScheduleEffects(component) {
|
|
|
2498
2254
|
}
|
|
2499
2255
|
}
|
|
2500
2256
|
}
|
|
2501
|
-
|
|
2502
2257
|
function useEffectImpl(effect, deps, delay) {
|
|
2503
2258
|
var hook = getHooks(exports.Current.index++);
|
|
2504
|
-
|
|
2505
2259
|
if (exports.Current.current._disableEffect || !exports.Current.current.__isReady) {
|
|
2506
2260
|
return;
|
|
2507
2261
|
}
|
|
2508
|
-
|
|
2509
2262
|
if (areDepsChanged(hook.deps, deps)) {
|
|
2510
2263
|
hook.effect = effect;
|
|
2511
2264
|
hook.deps = deps;
|
|
2512
|
-
|
|
2513
2265
|
if (delay) {
|
|
2514
2266
|
exports.Current.current.effects = exports.Current.current.effects.concat(hook);
|
|
2515
2267
|
invokeScheduleEffects(exports.Current.current);
|
|
@@ -2518,7 +2270,6 @@ function useEffectImpl(effect, deps, delay) {
|
|
|
2518
2270
|
}
|
|
2519
2271
|
}
|
|
2520
2272
|
}
|
|
2521
|
-
|
|
2522
2273
|
function useEffect(effect, deps) {
|
|
2523
2274
|
useEffectImpl(effect, deps, true);
|
|
2524
2275
|
}
|
|
@@ -2527,24 +2278,20 @@ function useLayoutEffect(effect, deps) {
|
|
|
2527
2278
|
}
|
|
2528
2279
|
function useRef(initialValue) {
|
|
2529
2280
|
var hook = getHooks(exports.Current.index++);
|
|
2530
|
-
|
|
2531
2281
|
if (!hook.ref) {
|
|
2532
2282
|
hook.ref = {
|
|
2533
2283
|
current: initialValue
|
|
2534
2284
|
};
|
|
2535
2285
|
}
|
|
2536
|
-
|
|
2537
2286
|
return hook.ref;
|
|
2538
2287
|
}
|
|
2539
2288
|
function useMemo(factory, deps) {
|
|
2540
2289
|
var hook = getHooks(exports.Current.index++);
|
|
2541
|
-
|
|
2542
2290
|
if (areDepsChanged(hook.deps, deps)) {
|
|
2543
2291
|
hook.deps = deps;
|
|
2544
2292
|
hook.callback = factory;
|
|
2545
2293
|
hook.value = factory();
|
|
2546
2294
|
}
|
|
2547
|
-
|
|
2548
2295
|
return hook.value;
|
|
2549
2296
|
}
|
|
2550
2297
|
function useCallback(callback, deps) {
|
|
@@ -2570,13 +2317,10 @@ function useImperativeHandle(ref, init, deps) {
|
|
|
2570
2317
|
function useContext(_ref) {
|
|
2571
2318
|
var context = _ref.context;
|
|
2572
2319
|
var emitter = context.emitter;
|
|
2573
|
-
|
|
2574
2320
|
if (emitter === null) {
|
|
2575
2321
|
return context._defaultValue;
|
|
2576
2322
|
}
|
|
2577
|
-
|
|
2578
2323
|
var hook = getHooks(exports.Current.index++);
|
|
2579
|
-
|
|
2580
2324
|
if (isUndefined(hook.context)) {
|
|
2581
2325
|
hook.context = true;
|
|
2582
2326
|
hook.component = exports.Current.current;
|
|
@@ -2587,20 +2331,16 @@ function useContext(_ref) {
|
|
|
2587
2331
|
}
|
|
2588
2332
|
});
|
|
2589
2333
|
}
|
|
2590
|
-
|
|
2591
2334
|
return emitter.value;
|
|
2592
2335
|
}
|
|
2593
2336
|
|
|
2594
2337
|
var Emitter = /*#__PURE__*/function () {
|
|
2595
2338
|
function Emitter() {
|
|
2596
2339
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2597
|
-
|
|
2598
2340
|
_classCallCheck(this, Emitter);
|
|
2599
|
-
|
|
2600
2341
|
this.value = value;
|
|
2601
2342
|
this.handlers = [];
|
|
2602
2343
|
}
|
|
2603
|
-
|
|
2604
2344
|
_createClass(Emitter, [{
|
|
2605
2345
|
key: "on",
|
|
2606
2346
|
value: function on(handler) {
|
|
@@ -2617,18 +2357,15 @@ var Emitter = /*#__PURE__*/function () {
|
|
|
2617
2357
|
key: "set",
|
|
2618
2358
|
value: function set(value) {
|
|
2619
2359
|
var _this = this;
|
|
2620
|
-
|
|
2621
2360
|
if (objectIs(value, this.value)) {
|
|
2622
2361
|
return;
|
|
2623
2362
|
}
|
|
2624
|
-
|
|
2625
2363
|
this.value = value;
|
|
2626
2364
|
this.handlers.forEach(function (h) {
|
|
2627
2365
|
return h(_this.value);
|
|
2628
2366
|
});
|
|
2629
2367
|
}
|
|
2630
2368
|
}]);
|
|
2631
|
-
|
|
2632
2369
|
return Emitter;
|
|
2633
2370
|
}();
|
|
2634
2371
|
|
|
@@ -2640,17 +2377,14 @@ function createContext(defaultValue) {
|
|
|
2640
2377
|
_id: contextId,
|
|
2641
2378
|
_defaultValue: defaultValue
|
|
2642
2379
|
};
|
|
2643
|
-
|
|
2644
2380
|
function Provider(newValue) {
|
|
2645
2381
|
var emitter = context.emitter;
|
|
2646
|
-
|
|
2647
2382
|
if (!emitter) {
|
|
2648
2383
|
context.emitter = new Emitter(defaultValue);
|
|
2649
2384
|
} else {
|
|
2650
2385
|
emitter.set(newValue);
|
|
2651
2386
|
}
|
|
2652
2387
|
}
|
|
2653
|
-
|
|
2654
2388
|
return {
|
|
2655
2389
|
Provider: Provider,
|
|
2656
2390
|
context: context
|
|
@@ -2662,42 +2396,32 @@ var objectIs$1 = Object.is || function (x, y) {
|
|
|
2662
2396
|
if (x === y) {
|
|
2663
2397
|
return x !== 0 || 1 / x === 1 / y;
|
|
2664
2398
|
}
|
|
2665
|
-
|
|
2666
2399
|
return x !== x && y !== y;
|
|
2667
2400
|
};
|
|
2668
|
-
|
|
2669
2401
|
function shallowEqual(obj1, obj2) {
|
|
2670
2402
|
if (_typeof(obj1) !== 'object' && _typeof(obj2) !== 'object') {
|
|
2671
2403
|
return obj1 === obj2;
|
|
2672
2404
|
}
|
|
2673
|
-
|
|
2674
2405
|
if (obj1 === null && obj2 === null) {
|
|
2675
2406
|
return true;
|
|
2676
2407
|
}
|
|
2677
|
-
|
|
2678
2408
|
if (obj1 === null || obj2 === null) {
|
|
2679
2409
|
return false;
|
|
2680
2410
|
}
|
|
2681
|
-
|
|
2682
2411
|
if (objectIs$1(obj1, obj2)) {
|
|
2683
2412
|
return true;
|
|
2684
2413
|
}
|
|
2685
|
-
|
|
2686
2414
|
var obj1Keys = obj1 ? Object.keys(obj1) : [];
|
|
2687
2415
|
var obj2Keys = obj2 ? Object.keys(obj2) : [];
|
|
2688
|
-
|
|
2689
2416
|
if (obj1Keys.length !== obj2Keys.length) {
|
|
2690
2417
|
return false;
|
|
2691
2418
|
}
|
|
2692
|
-
|
|
2693
2419
|
for (var i = 0; i < obj1Keys.length; i++) {
|
|
2694
2420
|
var obj1KeyItem = obj1Keys[i];
|
|
2695
|
-
|
|
2696
2421
|
if (!obj2.hasOwnProperty(obj1KeyItem) || !objectIs$1(obj1[obj1KeyItem], obj2[obj1KeyItem])) {
|
|
2697
2422
|
return false;
|
|
2698
2423
|
}
|
|
2699
2424
|
}
|
|
2700
|
-
|
|
2701
2425
|
return true;
|
|
2702
2426
|
}
|
|
2703
2427
|
|
|
@@ -2705,18 +2429,15 @@ function memo(component, propsAreEqual) {
|
|
|
2705
2429
|
component.prototype.shouldComponentUpdate = function (nextProps) {
|
|
2706
2430
|
return isFunction$1(propsAreEqual) ? !propsAreEqual(this.props, nextProps) : !shallowEqual(this.props, nextProps);
|
|
2707
2431
|
};
|
|
2708
|
-
|
|
2709
2432
|
return component;
|
|
2710
2433
|
}
|
|
2711
2434
|
|
|
2712
2435
|
/* eslint-disable camelcase */
|
|
2713
2436
|
|
|
2714
|
-
|
|
2715
2437
|
if (process.env.TARO_ENV === 'alipay') {
|
|
2716
2438
|
if (!my.taroEventCenter) {
|
|
2717
2439
|
my.taroEventCenter = new Events();
|
|
2718
2440
|
}
|
|
2719
|
-
|
|
2720
2441
|
exports.eventCenter = my.taroEventCenter;
|
|
2721
2442
|
} else {
|
|
2722
2443
|
exports.eventCenter = new Events();
|