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