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