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