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