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