@qlover/create-app 0.1.12 → 0.1.15
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/CHANGELOG.md +21 -0
- package/bin/create-app.js +0 -0
- package/dist/index.cjs +3631 -0
- package/dist/{cjs/index.d.ts → index.d.ts} +3 -2
- package/dist/index.js +3625 -0
- package/package.json +17 -16
- package/templates/node-lib/bin/test.js +1 -1
- package/templates/node-lib/package.json +2 -2
- package/templates/node-lib/rollup.config.js +1 -2
- package/templates/pack-app/package.json +1 -1
- package/templates/react-app/.env.local +24 -0
- package/templates/react-app/lib/router-loader/Page.ts +8 -4
- package/templates/react-app/lib/router-loader/RouterLoader.ts +1 -1
- package/templates/react-app/pnpm-lock.yaml +5892 -0
- package/configs/_common/.release-it.json.template +0 -42
- package/dist/cjs/index.js +0 -1
- package/dist/es/index.d.ts +0 -112
- package/dist/es/index.js +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,3631 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scriptsContext = require('@qlover/scripts-context');
|
|
4
|
+
var inquirer = require('inquirer');
|
|
5
|
+
var path = require('path');
|
|
6
|
+
var ora = require('ora');
|
|
7
|
+
var fs = require('fs');
|
|
8
|
+
var ignore = require('ignore');
|
|
9
|
+
|
|
10
|
+
const validRequiredString = (value, key) => {
|
|
11
|
+
if (typeof value !== 'string' || value.trim() === '') {
|
|
12
|
+
return `${key} is required`;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
16
|
+
function createDefaultPrompts(templates, packages) {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
type: 'input',
|
|
20
|
+
name: 'projectName',
|
|
21
|
+
message: 'Project name',
|
|
22
|
+
validate: (value) => validRequiredString(value, 'Project name')
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'list',
|
|
26
|
+
name: 'template',
|
|
27
|
+
message: 'Template name',
|
|
28
|
+
choices: [...templates, ...packages]
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
function createPackagePrompts(templates) {
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
type: 'checkbox',
|
|
36
|
+
name: 'subPackages',
|
|
37
|
+
message: 'Sub package names',
|
|
38
|
+
choices: templates
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class Util {
|
|
44
|
+
static ensureDir(dir) {
|
|
45
|
+
if (!fs.existsSync(dir)) {
|
|
46
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const { copyFile, stat } = fs.promises;
|
|
52
|
+
class Copyer {
|
|
53
|
+
ignoreTargetPath;
|
|
54
|
+
ignoreFile;
|
|
55
|
+
static IGNORE_FILE = '.gitignore.template';
|
|
56
|
+
constructor(ignoreTargetPath, ignoreFile = Copyer.IGNORE_FILE) {
|
|
57
|
+
this.ignoreTargetPath = ignoreTargetPath;
|
|
58
|
+
this.ignoreFile = ignoreFile;
|
|
59
|
+
}
|
|
60
|
+
getIg(targetDir = this.ignoreTargetPath) {
|
|
61
|
+
const gitignorePath = path.join(targetDir, this.ignoreFile);
|
|
62
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const gitignoreContent = fs.readFileSync(gitignorePath, 'utf8');
|
|
66
|
+
const ignoreToClean = gitignoreContent
|
|
67
|
+
.split('\n')
|
|
68
|
+
.map((line) => line.trim())
|
|
69
|
+
.filter((line) => line && !line.startsWith('#'));
|
|
70
|
+
const allRules = ignoreToClean;
|
|
71
|
+
// Create ignore instance and add rules
|
|
72
|
+
return ignore().add(allRules);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Asynchronously copy files from source to target directory.
|
|
76
|
+
* @param {string} sourcePath - Source directory.
|
|
77
|
+
* @param {string} targetDir - Target directory.
|
|
78
|
+
* @param {ignore.Ignore} ig - Ignore rules.
|
|
79
|
+
* @returns {Promise<void>} - A promise that resolves when the copy is complete.
|
|
80
|
+
* @example
|
|
81
|
+
* await copyer.copyFilesPromise('src', 'dest', ignoreInstance);
|
|
82
|
+
*/
|
|
83
|
+
async copyFiles(sourcePath, targetDir, ig, copyCallback) {
|
|
84
|
+
const items = await fs.promises.readdir(sourcePath);
|
|
85
|
+
await Promise.all(items.map(async (item) => {
|
|
86
|
+
const sourceFilePath = path.join(sourcePath, item);
|
|
87
|
+
const targetFilePath = path.join(targetDir, item);
|
|
88
|
+
if (ig && ig.ignores(item)) {
|
|
89
|
+
return; // ignore files listed in .gitignore
|
|
90
|
+
}
|
|
91
|
+
// Check if target directory exists, if not create it
|
|
92
|
+
Util.ensureDir(path.dirname(targetFilePath));
|
|
93
|
+
const fileStat = await stat(sourceFilePath);
|
|
94
|
+
if (fileStat.isDirectory()) {
|
|
95
|
+
await this.copyFiles(sourceFilePath, targetFilePath, ig, copyCallback);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
if (copyCallback &&
|
|
99
|
+
(await copyCallback(sourceFilePath, targetFilePath))) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
await copyFile(sourceFilePath, targetFilePath);
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
copyPaths({ sourcePath, targetPath, copyCallback }) {
|
|
107
|
+
Util.ensureDir(targetPath);
|
|
108
|
+
// if not pack template, copy templates
|
|
109
|
+
const ig = this.getIg();
|
|
110
|
+
return this.copyFiles(sourcePath, targetPath, ig, copyCallback);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
115
|
+
|
|
116
|
+
function getDefaultExportFromCjs (x) {
|
|
117
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Removes all key-value entries from the list cache.
|
|
122
|
+
*
|
|
123
|
+
* @private
|
|
124
|
+
* @name clear
|
|
125
|
+
* @memberOf ListCache
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
var _listCacheClear;
|
|
129
|
+
var hasRequired_listCacheClear;
|
|
130
|
+
|
|
131
|
+
function require_listCacheClear () {
|
|
132
|
+
if (hasRequired_listCacheClear) return _listCacheClear;
|
|
133
|
+
hasRequired_listCacheClear = 1;
|
|
134
|
+
function listCacheClear() {
|
|
135
|
+
this.__data__ = [];
|
|
136
|
+
this.size = 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
_listCacheClear = listCacheClear;
|
|
140
|
+
return _listCacheClear;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Performs a
|
|
145
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
146
|
+
* comparison between two values to determine if they are equivalent.
|
|
147
|
+
*
|
|
148
|
+
* @static
|
|
149
|
+
* @memberOf _
|
|
150
|
+
* @since 4.0.0
|
|
151
|
+
* @category Lang
|
|
152
|
+
* @param {*} value The value to compare.
|
|
153
|
+
* @param {*} other The other value to compare.
|
|
154
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
155
|
+
* @example
|
|
156
|
+
*
|
|
157
|
+
* var object = { 'a': 1 };
|
|
158
|
+
* var other = { 'a': 1 };
|
|
159
|
+
*
|
|
160
|
+
* _.eq(object, object);
|
|
161
|
+
* // => true
|
|
162
|
+
*
|
|
163
|
+
* _.eq(object, other);
|
|
164
|
+
* // => false
|
|
165
|
+
*
|
|
166
|
+
* _.eq('a', 'a');
|
|
167
|
+
* // => true
|
|
168
|
+
*
|
|
169
|
+
* _.eq('a', Object('a'));
|
|
170
|
+
* // => false
|
|
171
|
+
*
|
|
172
|
+
* _.eq(NaN, NaN);
|
|
173
|
+
* // => true
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
var eq_1;
|
|
177
|
+
var hasRequiredEq;
|
|
178
|
+
|
|
179
|
+
function requireEq () {
|
|
180
|
+
if (hasRequiredEq) return eq_1;
|
|
181
|
+
hasRequiredEq = 1;
|
|
182
|
+
function eq(value, other) {
|
|
183
|
+
return value === other || (value !== value && other !== other);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
eq_1 = eq;
|
|
187
|
+
return eq_1;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
var _assocIndexOf;
|
|
191
|
+
var hasRequired_assocIndexOf;
|
|
192
|
+
|
|
193
|
+
function require_assocIndexOf () {
|
|
194
|
+
if (hasRequired_assocIndexOf) return _assocIndexOf;
|
|
195
|
+
hasRequired_assocIndexOf = 1;
|
|
196
|
+
var eq = /*@__PURE__*/ requireEq();
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
200
|
+
*
|
|
201
|
+
* @private
|
|
202
|
+
* @param {Array} array The array to inspect.
|
|
203
|
+
* @param {*} key The key to search for.
|
|
204
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
205
|
+
*/
|
|
206
|
+
function assocIndexOf(array, key) {
|
|
207
|
+
var length = array.length;
|
|
208
|
+
while (length--) {
|
|
209
|
+
if (eq(array[length][0], key)) {
|
|
210
|
+
return length;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return -1;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
_assocIndexOf = assocIndexOf;
|
|
217
|
+
return _assocIndexOf;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
var _listCacheDelete;
|
|
221
|
+
var hasRequired_listCacheDelete;
|
|
222
|
+
|
|
223
|
+
function require_listCacheDelete () {
|
|
224
|
+
if (hasRequired_listCacheDelete) return _listCacheDelete;
|
|
225
|
+
hasRequired_listCacheDelete = 1;
|
|
226
|
+
var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
|
|
227
|
+
|
|
228
|
+
/** Used for built-in method references. */
|
|
229
|
+
var arrayProto = Array.prototype;
|
|
230
|
+
|
|
231
|
+
/** Built-in value references. */
|
|
232
|
+
var splice = arrayProto.splice;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Removes `key` and its value from the list cache.
|
|
236
|
+
*
|
|
237
|
+
* @private
|
|
238
|
+
* @name delete
|
|
239
|
+
* @memberOf ListCache
|
|
240
|
+
* @param {string} key The key of the value to remove.
|
|
241
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
242
|
+
*/
|
|
243
|
+
function listCacheDelete(key) {
|
|
244
|
+
var data = this.__data__,
|
|
245
|
+
index = assocIndexOf(data, key);
|
|
246
|
+
|
|
247
|
+
if (index < 0) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
var lastIndex = data.length - 1;
|
|
251
|
+
if (index == lastIndex) {
|
|
252
|
+
data.pop();
|
|
253
|
+
} else {
|
|
254
|
+
splice.call(data, index, 1);
|
|
255
|
+
}
|
|
256
|
+
--this.size;
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
_listCacheDelete = listCacheDelete;
|
|
261
|
+
return _listCacheDelete;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
var _listCacheGet;
|
|
265
|
+
var hasRequired_listCacheGet;
|
|
266
|
+
|
|
267
|
+
function require_listCacheGet () {
|
|
268
|
+
if (hasRequired_listCacheGet) return _listCacheGet;
|
|
269
|
+
hasRequired_listCacheGet = 1;
|
|
270
|
+
var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Gets the list cache value for `key`.
|
|
274
|
+
*
|
|
275
|
+
* @private
|
|
276
|
+
* @name get
|
|
277
|
+
* @memberOf ListCache
|
|
278
|
+
* @param {string} key The key of the value to get.
|
|
279
|
+
* @returns {*} Returns the entry value.
|
|
280
|
+
*/
|
|
281
|
+
function listCacheGet(key) {
|
|
282
|
+
var data = this.__data__,
|
|
283
|
+
index = assocIndexOf(data, key);
|
|
284
|
+
|
|
285
|
+
return index < 0 ? undefined : data[index][1];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
_listCacheGet = listCacheGet;
|
|
289
|
+
return _listCacheGet;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
var _listCacheHas;
|
|
293
|
+
var hasRequired_listCacheHas;
|
|
294
|
+
|
|
295
|
+
function require_listCacheHas () {
|
|
296
|
+
if (hasRequired_listCacheHas) return _listCacheHas;
|
|
297
|
+
hasRequired_listCacheHas = 1;
|
|
298
|
+
var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Checks if a list cache value for `key` exists.
|
|
302
|
+
*
|
|
303
|
+
* @private
|
|
304
|
+
* @name has
|
|
305
|
+
* @memberOf ListCache
|
|
306
|
+
* @param {string} key The key of the entry to check.
|
|
307
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
308
|
+
*/
|
|
309
|
+
function listCacheHas(key) {
|
|
310
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
_listCacheHas = listCacheHas;
|
|
314
|
+
return _listCacheHas;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
var _listCacheSet;
|
|
318
|
+
var hasRequired_listCacheSet;
|
|
319
|
+
|
|
320
|
+
function require_listCacheSet () {
|
|
321
|
+
if (hasRequired_listCacheSet) return _listCacheSet;
|
|
322
|
+
hasRequired_listCacheSet = 1;
|
|
323
|
+
var assocIndexOf = /*@__PURE__*/ require_assocIndexOf();
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Sets the list cache `key` to `value`.
|
|
327
|
+
*
|
|
328
|
+
* @private
|
|
329
|
+
* @name set
|
|
330
|
+
* @memberOf ListCache
|
|
331
|
+
* @param {string} key The key of the value to set.
|
|
332
|
+
* @param {*} value The value to set.
|
|
333
|
+
* @returns {Object} Returns the list cache instance.
|
|
334
|
+
*/
|
|
335
|
+
function listCacheSet(key, value) {
|
|
336
|
+
var data = this.__data__,
|
|
337
|
+
index = assocIndexOf(data, key);
|
|
338
|
+
|
|
339
|
+
if (index < 0) {
|
|
340
|
+
++this.size;
|
|
341
|
+
data.push([key, value]);
|
|
342
|
+
} else {
|
|
343
|
+
data[index][1] = value;
|
|
344
|
+
}
|
|
345
|
+
return this;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
_listCacheSet = listCacheSet;
|
|
349
|
+
return _listCacheSet;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
var _ListCache;
|
|
353
|
+
var hasRequired_ListCache;
|
|
354
|
+
|
|
355
|
+
function require_ListCache () {
|
|
356
|
+
if (hasRequired_ListCache) return _ListCache;
|
|
357
|
+
hasRequired_ListCache = 1;
|
|
358
|
+
var listCacheClear = /*@__PURE__*/ require_listCacheClear(),
|
|
359
|
+
listCacheDelete = /*@__PURE__*/ require_listCacheDelete(),
|
|
360
|
+
listCacheGet = /*@__PURE__*/ require_listCacheGet(),
|
|
361
|
+
listCacheHas = /*@__PURE__*/ require_listCacheHas(),
|
|
362
|
+
listCacheSet = /*@__PURE__*/ require_listCacheSet();
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Creates an list cache object.
|
|
366
|
+
*
|
|
367
|
+
* @private
|
|
368
|
+
* @constructor
|
|
369
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
370
|
+
*/
|
|
371
|
+
function ListCache(entries) {
|
|
372
|
+
var index = -1,
|
|
373
|
+
length = entries == null ? 0 : entries.length;
|
|
374
|
+
|
|
375
|
+
this.clear();
|
|
376
|
+
while (++index < length) {
|
|
377
|
+
var entry = entries[index];
|
|
378
|
+
this.set(entry[0], entry[1]);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Add methods to `ListCache`.
|
|
383
|
+
ListCache.prototype.clear = listCacheClear;
|
|
384
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
385
|
+
ListCache.prototype.get = listCacheGet;
|
|
386
|
+
ListCache.prototype.has = listCacheHas;
|
|
387
|
+
ListCache.prototype.set = listCacheSet;
|
|
388
|
+
|
|
389
|
+
_ListCache = ListCache;
|
|
390
|
+
return _ListCache;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
var _stackClear;
|
|
394
|
+
var hasRequired_stackClear;
|
|
395
|
+
|
|
396
|
+
function require_stackClear () {
|
|
397
|
+
if (hasRequired_stackClear) return _stackClear;
|
|
398
|
+
hasRequired_stackClear = 1;
|
|
399
|
+
var ListCache = /*@__PURE__*/ require_ListCache();
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Removes all key-value entries from the stack.
|
|
403
|
+
*
|
|
404
|
+
* @private
|
|
405
|
+
* @name clear
|
|
406
|
+
* @memberOf Stack
|
|
407
|
+
*/
|
|
408
|
+
function stackClear() {
|
|
409
|
+
this.__data__ = new ListCache;
|
|
410
|
+
this.size = 0;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
_stackClear = stackClear;
|
|
414
|
+
return _stackClear;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Removes `key` and its value from the stack.
|
|
419
|
+
*
|
|
420
|
+
* @private
|
|
421
|
+
* @name delete
|
|
422
|
+
* @memberOf Stack
|
|
423
|
+
* @param {string} key The key of the value to remove.
|
|
424
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
425
|
+
*/
|
|
426
|
+
|
|
427
|
+
var _stackDelete;
|
|
428
|
+
var hasRequired_stackDelete;
|
|
429
|
+
|
|
430
|
+
function require_stackDelete () {
|
|
431
|
+
if (hasRequired_stackDelete) return _stackDelete;
|
|
432
|
+
hasRequired_stackDelete = 1;
|
|
433
|
+
function stackDelete(key) {
|
|
434
|
+
var data = this.__data__,
|
|
435
|
+
result = data['delete'](key);
|
|
436
|
+
|
|
437
|
+
this.size = data.size;
|
|
438
|
+
return result;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
_stackDelete = stackDelete;
|
|
442
|
+
return _stackDelete;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Gets the stack value for `key`.
|
|
447
|
+
*
|
|
448
|
+
* @private
|
|
449
|
+
* @name get
|
|
450
|
+
* @memberOf Stack
|
|
451
|
+
* @param {string} key The key of the value to get.
|
|
452
|
+
* @returns {*} Returns the entry value.
|
|
453
|
+
*/
|
|
454
|
+
|
|
455
|
+
var _stackGet;
|
|
456
|
+
var hasRequired_stackGet;
|
|
457
|
+
|
|
458
|
+
function require_stackGet () {
|
|
459
|
+
if (hasRequired_stackGet) return _stackGet;
|
|
460
|
+
hasRequired_stackGet = 1;
|
|
461
|
+
function stackGet(key) {
|
|
462
|
+
return this.__data__.get(key);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
_stackGet = stackGet;
|
|
466
|
+
return _stackGet;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Checks if a stack value for `key` exists.
|
|
471
|
+
*
|
|
472
|
+
* @private
|
|
473
|
+
* @name has
|
|
474
|
+
* @memberOf Stack
|
|
475
|
+
* @param {string} key The key of the entry to check.
|
|
476
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
477
|
+
*/
|
|
478
|
+
|
|
479
|
+
var _stackHas;
|
|
480
|
+
var hasRequired_stackHas;
|
|
481
|
+
|
|
482
|
+
function require_stackHas () {
|
|
483
|
+
if (hasRequired_stackHas) return _stackHas;
|
|
484
|
+
hasRequired_stackHas = 1;
|
|
485
|
+
function stackHas(key) {
|
|
486
|
+
return this.__data__.has(key);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
_stackHas = stackHas;
|
|
490
|
+
return _stackHas;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/** Detect free variable `global` from Node.js. */
|
|
494
|
+
|
|
495
|
+
var _freeGlobal;
|
|
496
|
+
var hasRequired_freeGlobal;
|
|
497
|
+
|
|
498
|
+
function require_freeGlobal () {
|
|
499
|
+
if (hasRequired_freeGlobal) return _freeGlobal;
|
|
500
|
+
hasRequired_freeGlobal = 1;
|
|
501
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
502
|
+
|
|
503
|
+
_freeGlobal = freeGlobal;
|
|
504
|
+
return _freeGlobal;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
var _root;
|
|
508
|
+
var hasRequired_root;
|
|
509
|
+
|
|
510
|
+
function require_root () {
|
|
511
|
+
if (hasRequired_root) return _root;
|
|
512
|
+
hasRequired_root = 1;
|
|
513
|
+
var freeGlobal = /*@__PURE__*/ require_freeGlobal();
|
|
514
|
+
|
|
515
|
+
/** Detect free variable `self`. */
|
|
516
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
517
|
+
|
|
518
|
+
/** Used as a reference to the global object. */
|
|
519
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
520
|
+
|
|
521
|
+
_root = root;
|
|
522
|
+
return _root;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
var _Symbol;
|
|
526
|
+
var hasRequired_Symbol;
|
|
527
|
+
|
|
528
|
+
function require_Symbol () {
|
|
529
|
+
if (hasRequired_Symbol) return _Symbol;
|
|
530
|
+
hasRequired_Symbol = 1;
|
|
531
|
+
var root = /*@__PURE__*/ require_root();
|
|
532
|
+
|
|
533
|
+
/** Built-in value references. */
|
|
534
|
+
var Symbol = root.Symbol;
|
|
535
|
+
|
|
536
|
+
_Symbol = Symbol;
|
|
537
|
+
return _Symbol;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
var _getRawTag;
|
|
541
|
+
var hasRequired_getRawTag;
|
|
542
|
+
|
|
543
|
+
function require_getRawTag () {
|
|
544
|
+
if (hasRequired_getRawTag) return _getRawTag;
|
|
545
|
+
hasRequired_getRawTag = 1;
|
|
546
|
+
var Symbol = /*@__PURE__*/ require_Symbol();
|
|
547
|
+
|
|
548
|
+
/** Used for built-in method references. */
|
|
549
|
+
var objectProto = Object.prototype;
|
|
550
|
+
|
|
551
|
+
/** Used to check objects for own properties. */
|
|
552
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Used to resolve the
|
|
556
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
557
|
+
* of values.
|
|
558
|
+
*/
|
|
559
|
+
var nativeObjectToString = objectProto.toString;
|
|
560
|
+
|
|
561
|
+
/** Built-in value references. */
|
|
562
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
566
|
+
*
|
|
567
|
+
* @private
|
|
568
|
+
* @param {*} value The value to query.
|
|
569
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
570
|
+
*/
|
|
571
|
+
function getRawTag(value) {
|
|
572
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
|
573
|
+
tag = value[symToStringTag];
|
|
574
|
+
|
|
575
|
+
try {
|
|
576
|
+
value[symToStringTag] = undefined;
|
|
577
|
+
var unmasked = true;
|
|
578
|
+
} catch (e) {}
|
|
579
|
+
|
|
580
|
+
var result = nativeObjectToString.call(value);
|
|
581
|
+
if (unmasked) {
|
|
582
|
+
if (isOwn) {
|
|
583
|
+
value[symToStringTag] = tag;
|
|
584
|
+
} else {
|
|
585
|
+
delete value[symToStringTag];
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return result;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
_getRawTag = getRawTag;
|
|
592
|
+
return _getRawTag;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/** Used for built-in method references. */
|
|
596
|
+
|
|
597
|
+
var _objectToString;
|
|
598
|
+
var hasRequired_objectToString;
|
|
599
|
+
|
|
600
|
+
function require_objectToString () {
|
|
601
|
+
if (hasRequired_objectToString) return _objectToString;
|
|
602
|
+
hasRequired_objectToString = 1;
|
|
603
|
+
var objectProto = Object.prototype;
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Used to resolve the
|
|
607
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
608
|
+
* of values.
|
|
609
|
+
*/
|
|
610
|
+
var nativeObjectToString = objectProto.toString;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
614
|
+
*
|
|
615
|
+
* @private
|
|
616
|
+
* @param {*} value The value to convert.
|
|
617
|
+
* @returns {string} Returns the converted string.
|
|
618
|
+
*/
|
|
619
|
+
function objectToString(value) {
|
|
620
|
+
return nativeObjectToString.call(value);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
_objectToString = objectToString;
|
|
624
|
+
return _objectToString;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
var _baseGetTag;
|
|
628
|
+
var hasRequired_baseGetTag;
|
|
629
|
+
|
|
630
|
+
function require_baseGetTag () {
|
|
631
|
+
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
632
|
+
hasRequired_baseGetTag = 1;
|
|
633
|
+
var Symbol = /*@__PURE__*/ require_Symbol(),
|
|
634
|
+
getRawTag = /*@__PURE__*/ require_getRawTag(),
|
|
635
|
+
objectToString = /*@__PURE__*/ require_objectToString();
|
|
636
|
+
|
|
637
|
+
/** `Object#toString` result references. */
|
|
638
|
+
var nullTag = '[object Null]',
|
|
639
|
+
undefinedTag = '[object Undefined]';
|
|
640
|
+
|
|
641
|
+
/** Built-in value references. */
|
|
642
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
646
|
+
*
|
|
647
|
+
* @private
|
|
648
|
+
* @param {*} value The value to query.
|
|
649
|
+
* @returns {string} Returns the `toStringTag`.
|
|
650
|
+
*/
|
|
651
|
+
function baseGetTag(value) {
|
|
652
|
+
if (value == null) {
|
|
653
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
654
|
+
}
|
|
655
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
656
|
+
? getRawTag(value)
|
|
657
|
+
: objectToString(value);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
_baseGetTag = baseGetTag;
|
|
661
|
+
return _baseGetTag;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Checks if `value` is the
|
|
666
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
667
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
668
|
+
*
|
|
669
|
+
* @static
|
|
670
|
+
* @memberOf _
|
|
671
|
+
* @since 0.1.0
|
|
672
|
+
* @category Lang
|
|
673
|
+
* @param {*} value The value to check.
|
|
674
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
675
|
+
* @example
|
|
676
|
+
*
|
|
677
|
+
* _.isObject({});
|
|
678
|
+
* // => true
|
|
679
|
+
*
|
|
680
|
+
* _.isObject([1, 2, 3]);
|
|
681
|
+
* // => true
|
|
682
|
+
*
|
|
683
|
+
* _.isObject(_.noop);
|
|
684
|
+
* // => true
|
|
685
|
+
*
|
|
686
|
+
* _.isObject(null);
|
|
687
|
+
* // => false
|
|
688
|
+
*/
|
|
689
|
+
|
|
690
|
+
var isObject_1;
|
|
691
|
+
var hasRequiredIsObject;
|
|
692
|
+
|
|
693
|
+
function requireIsObject () {
|
|
694
|
+
if (hasRequiredIsObject) return isObject_1;
|
|
695
|
+
hasRequiredIsObject = 1;
|
|
696
|
+
function isObject(value) {
|
|
697
|
+
var type = typeof value;
|
|
698
|
+
return value != null && (type == 'object' || type == 'function');
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
isObject_1 = isObject;
|
|
702
|
+
return isObject_1;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
var isFunction_1;
|
|
706
|
+
var hasRequiredIsFunction;
|
|
707
|
+
|
|
708
|
+
function requireIsFunction () {
|
|
709
|
+
if (hasRequiredIsFunction) return isFunction_1;
|
|
710
|
+
hasRequiredIsFunction = 1;
|
|
711
|
+
var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
|
|
712
|
+
isObject = /*@__PURE__*/ requireIsObject();
|
|
713
|
+
|
|
714
|
+
/** `Object#toString` result references. */
|
|
715
|
+
var asyncTag = '[object AsyncFunction]',
|
|
716
|
+
funcTag = '[object Function]',
|
|
717
|
+
genTag = '[object GeneratorFunction]',
|
|
718
|
+
proxyTag = '[object Proxy]';
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Checks if `value` is classified as a `Function` object.
|
|
722
|
+
*
|
|
723
|
+
* @static
|
|
724
|
+
* @memberOf _
|
|
725
|
+
* @since 0.1.0
|
|
726
|
+
* @category Lang
|
|
727
|
+
* @param {*} value The value to check.
|
|
728
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
729
|
+
* @example
|
|
730
|
+
*
|
|
731
|
+
* _.isFunction(_);
|
|
732
|
+
* // => true
|
|
733
|
+
*
|
|
734
|
+
* _.isFunction(/abc/);
|
|
735
|
+
* // => false
|
|
736
|
+
*/
|
|
737
|
+
function isFunction(value) {
|
|
738
|
+
if (!isObject(value)) {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
742
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
743
|
+
var tag = baseGetTag(value);
|
|
744
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
isFunction_1 = isFunction;
|
|
748
|
+
return isFunction_1;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
var _coreJsData;
|
|
752
|
+
var hasRequired_coreJsData;
|
|
753
|
+
|
|
754
|
+
function require_coreJsData () {
|
|
755
|
+
if (hasRequired_coreJsData) return _coreJsData;
|
|
756
|
+
hasRequired_coreJsData = 1;
|
|
757
|
+
var root = /*@__PURE__*/ require_root();
|
|
758
|
+
|
|
759
|
+
/** Used to detect overreaching core-js shims. */
|
|
760
|
+
var coreJsData = root['__core-js_shared__'];
|
|
761
|
+
|
|
762
|
+
_coreJsData = coreJsData;
|
|
763
|
+
return _coreJsData;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
var _isMasked;
|
|
767
|
+
var hasRequired_isMasked;
|
|
768
|
+
|
|
769
|
+
function require_isMasked () {
|
|
770
|
+
if (hasRequired_isMasked) return _isMasked;
|
|
771
|
+
hasRequired_isMasked = 1;
|
|
772
|
+
var coreJsData = /*@__PURE__*/ require_coreJsData();
|
|
773
|
+
|
|
774
|
+
/** Used to detect methods masquerading as native. */
|
|
775
|
+
var maskSrcKey = (function() {
|
|
776
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
777
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
778
|
+
}());
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Checks if `func` has its source masked.
|
|
782
|
+
*
|
|
783
|
+
* @private
|
|
784
|
+
* @param {Function} func The function to check.
|
|
785
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
786
|
+
*/
|
|
787
|
+
function isMasked(func) {
|
|
788
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
_isMasked = isMasked;
|
|
792
|
+
return _isMasked;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/** Used for built-in method references. */
|
|
796
|
+
|
|
797
|
+
var _toSource;
|
|
798
|
+
var hasRequired_toSource;
|
|
799
|
+
|
|
800
|
+
function require_toSource () {
|
|
801
|
+
if (hasRequired_toSource) return _toSource;
|
|
802
|
+
hasRequired_toSource = 1;
|
|
803
|
+
var funcProto = Function.prototype;
|
|
804
|
+
|
|
805
|
+
/** Used to resolve the decompiled source of functions. */
|
|
806
|
+
var funcToString = funcProto.toString;
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Converts `func` to its source code.
|
|
810
|
+
*
|
|
811
|
+
* @private
|
|
812
|
+
* @param {Function} func The function to convert.
|
|
813
|
+
* @returns {string} Returns the source code.
|
|
814
|
+
*/
|
|
815
|
+
function toSource(func) {
|
|
816
|
+
if (func != null) {
|
|
817
|
+
try {
|
|
818
|
+
return funcToString.call(func);
|
|
819
|
+
} catch (e) {}
|
|
820
|
+
try {
|
|
821
|
+
return (func + '');
|
|
822
|
+
} catch (e) {}
|
|
823
|
+
}
|
|
824
|
+
return '';
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
_toSource = toSource;
|
|
828
|
+
return _toSource;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
var _baseIsNative;
|
|
832
|
+
var hasRequired_baseIsNative;
|
|
833
|
+
|
|
834
|
+
function require_baseIsNative () {
|
|
835
|
+
if (hasRequired_baseIsNative) return _baseIsNative;
|
|
836
|
+
hasRequired_baseIsNative = 1;
|
|
837
|
+
var isFunction = /*@__PURE__*/ requireIsFunction(),
|
|
838
|
+
isMasked = /*@__PURE__*/ require_isMasked(),
|
|
839
|
+
isObject = /*@__PURE__*/ requireIsObject(),
|
|
840
|
+
toSource = /*@__PURE__*/ require_toSource();
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Used to match `RegExp`
|
|
844
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
845
|
+
*/
|
|
846
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
847
|
+
|
|
848
|
+
/** Used to detect host constructors (Safari). */
|
|
849
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
850
|
+
|
|
851
|
+
/** Used for built-in method references. */
|
|
852
|
+
var funcProto = Function.prototype,
|
|
853
|
+
objectProto = Object.prototype;
|
|
854
|
+
|
|
855
|
+
/** Used to resolve the decompiled source of functions. */
|
|
856
|
+
var funcToString = funcProto.toString;
|
|
857
|
+
|
|
858
|
+
/** Used to check objects for own properties. */
|
|
859
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
860
|
+
|
|
861
|
+
/** Used to detect if a method is native. */
|
|
862
|
+
var reIsNative = RegExp('^' +
|
|
863
|
+
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
864
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
865
|
+
);
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
869
|
+
*
|
|
870
|
+
* @private
|
|
871
|
+
* @param {*} value The value to check.
|
|
872
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
873
|
+
* else `false`.
|
|
874
|
+
*/
|
|
875
|
+
function baseIsNative(value) {
|
|
876
|
+
if (!isObject(value) || isMasked(value)) {
|
|
877
|
+
return false;
|
|
878
|
+
}
|
|
879
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
880
|
+
return pattern.test(toSource(value));
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
_baseIsNative = baseIsNative;
|
|
884
|
+
return _baseIsNative;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Gets the value at `key` of `object`.
|
|
889
|
+
*
|
|
890
|
+
* @private
|
|
891
|
+
* @param {Object} [object] The object to query.
|
|
892
|
+
* @param {string} key The key of the property to get.
|
|
893
|
+
* @returns {*} Returns the property value.
|
|
894
|
+
*/
|
|
895
|
+
|
|
896
|
+
var _getValue;
|
|
897
|
+
var hasRequired_getValue;
|
|
898
|
+
|
|
899
|
+
function require_getValue () {
|
|
900
|
+
if (hasRequired_getValue) return _getValue;
|
|
901
|
+
hasRequired_getValue = 1;
|
|
902
|
+
function getValue(object, key) {
|
|
903
|
+
return object == null ? undefined : object[key];
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
_getValue = getValue;
|
|
907
|
+
return _getValue;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
var _getNative;
|
|
911
|
+
var hasRequired_getNative;
|
|
912
|
+
|
|
913
|
+
function require_getNative () {
|
|
914
|
+
if (hasRequired_getNative) return _getNative;
|
|
915
|
+
hasRequired_getNative = 1;
|
|
916
|
+
var baseIsNative = /*@__PURE__*/ require_baseIsNative(),
|
|
917
|
+
getValue = /*@__PURE__*/ require_getValue();
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Gets the native function at `key` of `object`.
|
|
921
|
+
*
|
|
922
|
+
* @private
|
|
923
|
+
* @param {Object} object The object to query.
|
|
924
|
+
* @param {string} key The key of the method to get.
|
|
925
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
926
|
+
*/
|
|
927
|
+
function getNative(object, key) {
|
|
928
|
+
var value = getValue(object, key);
|
|
929
|
+
return baseIsNative(value) ? value : undefined;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
_getNative = getNative;
|
|
933
|
+
return _getNative;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
var _Map;
|
|
937
|
+
var hasRequired_Map;
|
|
938
|
+
|
|
939
|
+
function require_Map () {
|
|
940
|
+
if (hasRequired_Map) return _Map;
|
|
941
|
+
hasRequired_Map = 1;
|
|
942
|
+
var getNative = /*@__PURE__*/ require_getNative(),
|
|
943
|
+
root = /*@__PURE__*/ require_root();
|
|
944
|
+
|
|
945
|
+
/* Built-in method references that are verified to be native. */
|
|
946
|
+
var Map = getNative(root, 'Map');
|
|
947
|
+
|
|
948
|
+
_Map = Map;
|
|
949
|
+
return _Map;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
var _nativeCreate;
|
|
953
|
+
var hasRequired_nativeCreate;
|
|
954
|
+
|
|
955
|
+
function require_nativeCreate () {
|
|
956
|
+
if (hasRequired_nativeCreate) return _nativeCreate;
|
|
957
|
+
hasRequired_nativeCreate = 1;
|
|
958
|
+
var getNative = /*@__PURE__*/ require_getNative();
|
|
959
|
+
|
|
960
|
+
/* Built-in method references that are verified to be native. */
|
|
961
|
+
var nativeCreate = getNative(Object, 'create');
|
|
962
|
+
|
|
963
|
+
_nativeCreate = nativeCreate;
|
|
964
|
+
return _nativeCreate;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
var _hashClear;
|
|
968
|
+
var hasRequired_hashClear;
|
|
969
|
+
|
|
970
|
+
function require_hashClear () {
|
|
971
|
+
if (hasRequired_hashClear) return _hashClear;
|
|
972
|
+
hasRequired_hashClear = 1;
|
|
973
|
+
var nativeCreate = /*@__PURE__*/ require_nativeCreate();
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Removes all key-value entries from the hash.
|
|
977
|
+
*
|
|
978
|
+
* @private
|
|
979
|
+
* @name clear
|
|
980
|
+
* @memberOf Hash
|
|
981
|
+
*/
|
|
982
|
+
function hashClear() {
|
|
983
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
984
|
+
this.size = 0;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
_hashClear = hashClear;
|
|
988
|
+
return _hashClear;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Removes `key` and its value from the hash.
|
|
993
|
+
*
|
|
994
|
+
* @private
|
|
995
|
+
* @name delete
|
|
996
|
+
* @memberOf Hash
|
|
997
|
+
* @param {Object} hash The hash to modify.
|
|
998
|
+
* @param {string} key The key of the value to remove.
|
|
999
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1000
|
+
*/
|
|
1001
|
+
|
|
1002
|
+
var _hashDelete;
|
|
1003
|
+
var hasRequired_hashDelete;
|
|
1004
|
+
|
|
1005
|
+
function require_hashDelete () {
|
|
1006
|
+
if (hasRequired_hashDelete) return _hashDelete;
|
|
1007
|
+
hasRequired_hashDelete = 1;
|
|
1008
|
+
function hashDelete(key) {
|
|
1009
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
1010
|
+
this.size -= result ? 1 : 0;
|
|
1011
|
+
return result;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
_hashDelete = hashDelete;
|
|
1015
|
+
return _hashDelete;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
var _hashGet;
|
|
1019
|
+
var hasRequired_hashGet;
|
|
1020
|
+
|
|
1021
|
+
function require_hashGet () {
|
|
1022
|
+
if (hasRequired_hashGet) return _hashGet;
|
|
1023
|
+
hasRequired_hashGet = 1;
|
|
1024
|
+
var nativeCreate = /*@__PURE__*/ require_nativeCreate();
|
|
1025
|
+
|
|
1026
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
1027
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1028
|
+
|
|
1029
|
+
/** Used for built-in method references. */
|
|
1030
|
+
var objectProto = Object.prototype;
|
|
1031
|
+
|
|
1032
|
+
/** Used to check objects for own properties. */
|
|
1033
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Gets the hash value for `key`.
|
|
1037
|
+
*
|
|
1038
|
+
* @private
|
|
1039
|
+
* @name get
|
|
1040
|
+
* @memberOf Hash
|
|
1041
|
+
* @param {string} key The key of the value to get.
|
|
1042
|
+
* @returns {*} Returns the entry value.
|
|
1043
|
+
*/
|
|
1044
|
+
function hashGet(key) {
|
|
1045
|
+
var data = this.__data__;
|
|
1046
|
+
if (nativeCreate) {
|
|
1047
|
+
var result = data[key];
|
|
1048
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
|
1049
|
+
}
|
|
1050
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
_hashGet = hashGet;
|
|
1054
|
+
return _hashGet;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
var _hashHas;
|
|
1058
|
+
var hasRequired_hashHas;
|
|
1059
|
+
|
|
1060
|
+
function require_hashHas () {
|
|
1061
|
+
if (hasRequired_hashHas) return _hashHas;
|
|
1062
|
+
hasRequired_hashHas = 1;
|
|
1063
|
+
var nativeCreate = /*@__PURE__*/ require_nativeCreate();
|
|
1064
|
+
|
|
1065
|
+
/** Used for built-in method references. */
|
|
1066
|
+
var objectProto = Object.prototype;
|
|
1067
|
+
|
|
1068
|
+
/** Used to check objects for own properties. */
|
|
1069
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Checks if a hash value for `key` exists.
|
|
1073
|
+
*
|
|
1074
|
+
* @private
|
|
1075
|
+
* @name has
|
|
1076
|
+
* @memberOf Hash
|
|
1077
|
+
* @param {string} key The key of the entry to check.
|
|
1078
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1079
|
+
*/
|
|
1080
|
+
function hashHas(key) {
|
|
1081
|
+
var data = this.__data__;
|
|
1082
|
+
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
_hashHas = hashHas;
|
|
1086
|
+
return _hashHas;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
var _hashSet;
|
|
1090
|
+
var hasRequired_hashSet;
|
|
1091
|
+
|
|
1092
|
+
function require_hashSet () {
|
|
1093
|
+
if (hasRequired_hashSet) return _hashSet;
|
|
1094
|
+
hasRequired_hashSet = 1;
|
|
1095
|
+
var nativeCreate = /*@__PURE__*/ require_nativeCreate();
|
|
1096
|
+
|
|
1097
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
1098
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Sets the hash `key` to `value`.
|
|
1102
|
+
*
|
|
1103
|
+
* @private
|
|
1104
|
+
* @name set
|
|
1105
|
+
* @memberOf Hash
|
|
1106
|
+
* @param {string} key The key of the value to set.
|
|
1107
|
+
* @param {*} value The value to set.
|
|
1108
|
+
* @returns {Object} Returns the hash instance.
|
|
1109
|
+
*/
|
|
1110
|
+
function hashSet(key, value) {
|
|
1111
|
+
var data = this.__data__;
|
|
1112
|
+
this.size += this.has(key) ? 0 : 1;
|
|
1113
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
1114
|
+
return this;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
_hashSet = hashSet;
|
|
1118
|
+
return _hashSet;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
var _Hash;
|
|
1122
|
+
var hasRequired_Hash;
|
|
1123
|
+
|
|
1124
|
+
function require_Hash () {
|
|
1125
|
+
if (hasRequired_Hash) return _Hash;
|
|
1126
|
+
hasRequired_Hash = 1;
|
|
1127
|
+
var hashClear = /*@__PURE__*/ require_hashClear(),
|
|
1128
|
+
hashDelete = /*@__PURE__*/ require_hashDelete(),
|
|
1129
|
+
hashGet = /*@__PURE__*/ require_hashGet(),
|
|
1130
|
+
hashHas = /*@__PURE__*/ require_hashHas(),
|
|
1131
|
+
hashSet = /*@__PURE__*/ require_hashSet();
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Creates a hash object.
|
|
1135
|
+
*
|
|
1136
|
+
* @private
|
|
1137
|
+
* @constructor
|
|
1138
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
1139
|
+
*/
|
|
1140
|
+
function Hash(entries) {
|
|
1141
|
+
var index = -1,
|
|
1142
|
+
length = entries == null ? 0 : entries.length;
|
|
1143
|
+
|
|
1144
|
+
this.clear();
|
|
1145
|
+
while (++index < length) {
|
|
1146
|
+
var entry = entries[index];
|
|
1147
|
+
this.set(entry[0], entry[1]);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
// Add methods to `Hash`.
|
|
1152
|
+
Hash.prototype.clear = hashClear;
|
|
1153
|
+
Hash.prototype['delete'] = hashDelete;
|
|
1154
|
+
Hash.prototype.get = hashGet;
|
|
1155
|
+
Hash.prototype.has = hashHas;
|
|
1156
|
+
Hash.prototype.set = hashSet;
|
|
1157
|
+
|
|
1158
|
+
_Hash = Hash;
|
|
1159
|
+
return _Hash;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
var _mapCacheClear;
|
|
1163
|
+
var hasRequired_mapCacheClear;
|
|
1164
|
+
|
|
1165
|
+
function require_mapCacheClear () {
|
|
1166
|
+
if (hasRequired_mapCacheClear) return _mapCacheClear;
|
|
1167
|
+
hasRequired_mapCacheClear = 1;
|
|
1168
|
+
var Hash = /*@__PURE__*/ require_Hash(),
|
|
1169
|
+
ListCache = /*@__PURE__*/ require_ListCache(),
|
|
1170
|
+
Map = /*@__PURE__*/ require_Map();
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* Removes all key-value entries from the map.
|
|
1174
|
+
*
|
|
1175
|
+
* @private
|
|
1176
|
+
* @name clear
|
|
1177
|
+
* @memberOf MapCache
|
|
1178
|
+
*/
|
|
1179
|
+
function mapCacheClear() {
|
|
1180
|
+
this.size = 0;
|
|
1181
|
+
this.__data__ = {
|
|
1182
|
+
'hash': new Hash,
|
|
1183
|
+
'map': new (Map || ListCache),
|
|
1184
|
+
'string': new Hash
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
_mapCacheClear = mapCacheClear;
|
|
1189
|
+
return _mapCacheClear;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
1194
|
+
*
|
|
1195
|
+
* @private
|
|
1196
|
+
* @param {*} value The value to check.
|
|
1197
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
1198
|
+
*/
|
|
1199
|
+
|
|
1200
|
+
var _isKeyable;
|
|
1201
|
+
var hasRequired_isKeyable;
|
|
1202
|
+
|
|
1203
|
+
function require_isKeyable () {
|
|
1204
|
+
if (hasRequired_isKeyable) return _isKeyable;
|
|
1205
|
+
hasRequired_isKeyable = 1;
|
|
1206
|
+
function isKeyable(value) {
|
|
1207
|
+
var type = typeof value;
|
|
1208
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
1209
|
+
? (value !== '__proto__')
|
|
1210
|
+
: (value === null);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
_isKeyable = isKeyable;
|
|
1214
|
+
return _isKeyable;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
var _getMapData;
|
|
1218
|
+
var hasRequired_getMapData;
|
|
1219
|
+
|
|
1220
|
+
function require_getMapData () {
|
|
1221
|
+
if (hasRequired_getMapData) return _getMapData;
|
|
1222
|
+
hasRequired_getMapData = 1;
|
|
1223
|
+
var isKeyable = /*@__PURE__*/ require_isKeyable();
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* Gets the data for `map`.
|
|
1227
|
+
*
|
|
1228
|
+
* @private
|
|
1229
|
+
* @param {Object} map The map to query.
|
|
1230
|
+
* @param {string} key The reference key.
|
|
1231
|
+
* @returns {*} Returns the map data.
|
|
1232
|
+
*/
|
|
1233
|
+
function getMapData(map, key) {
|
|
1234
|
+
var data = map.__data__;
|
|
1235
|
+
return isKeyable(key)
|
|
1236
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
1237
|
+
: data.map;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
_getMapData = getMapData;
|
|
1241
|
+
return _getMapData;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
var _mapCacheDelete;
|
|
1245
|
+
var hasRequired_mapCacheDelete;
|
|
1246
|
+
|
|
1247
|
+
function require_mapCacheDelete () {
|
|
1248
|
+
if (hasRequired_mapCacheDelete) return _mapCacheDelete;
|
|
1249
|
+
hasRequired_mapCacheDelete = 1;
|
|
1250
|
+
var getMapData = /*@__PURE__*/ require_getMapData();
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Removes `key` and its value from the map.
|
|
1254
|
+
*
|
|
1255
|
+
* @private
|
|
1256
|
+
* @name delete
|
|
1257
|
+
* @memberOf MapCache
|
|
1258
|
+
* @param {string} key The key of the value to remove.
|
|
1259
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1260
|
+
*/
|
|
1261
|
+
function mapCacheDelete(key) {
|
|
1262
|
+
var result = getMapData(this, key)['delete'](key);
|
|
1263
|
+
this.size -= result ? 1 : 0;
|
|
1264
|
+
return result;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
_mapCacheDelete = mapCacheDelete;
|
|
1268
|
+
return _mapCacheDelete;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
var _mapCacheGet;
|
|
1272
|
+
var hasRequired_mapCacheGet;
|
|
1273
|
+
|
|
1274
|
+
function require_mapCacheGet () {
|
|
1275
|
+
if (hasRequired_mapCacheGet) return _mapCacheGet;
|
|
1276
|
+
hasRequired_mapCacheGet = 1;
|
|
1277
|
+
var getMapData = /*@__PURE__*/ require_getMapData();
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Gets the map value for `key`.
|
|
1281
|
+
*
|
|
1282
|
+
* @private
|
|
1283
|
+
* @name get
|
|
1284
|
+
* @memberOf MapCache
|
|
1285
|
+
* @param {string} key The key of the value to get.
|
|
1286
|
+
* @returns {*} Returns the entry value.
|
|
1287
|
+
*/
|
|
1288
|
+
function mapCacheGet(key) {
|
|
1289
|
+
return getMapData(this, key).get(key);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
_mapCacheGet = mapCacheGet;
|
|
1293
|
+
return _mapCacheGet;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
var _mapCacheHas;
|
|
1297
|
+
var hasRequired_mapCacheHas;
|
|
1298
|
+
|
|
1299
|
+
function require_mapCacheHas () {
|
|
1300
|
+
if (hasRequired_mapCacheHas) return _mapCacheHas;
|
|
1301
|
+
hasRequired_mapCacheHas = 1;
|
|
1302
|
+
var getMapData = /*@__PURE__*/ require_getMapData();
|
|
1303
|
+
|
|
1304
|
+
/**
|
|
1305
|
+
* Checks if a map value for `key` exists.
|
|
1306
|
+
*
|
|
1307
|
+
* @private
|
|
1308
|
+
* @name has
|
|
1309
|
+
* @memberOf MapCache
|
|
1310
|
+
* @param {string} key The key of the entry to check.
|
|
1311
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1312
|
+
*/
|
|
1313
|
+
function mapCacheHas(key) {
|
|
1314
|
+
return getMapData(this, key).has(key);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
_mapCacheHas = mapCacheHas;
|
|
1318
|
+
return _mapCacheHas;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
var _mapCacheSet;
|
|
1322
|
+
var hasRequired_mapCacheSet;
|
|
1323
|
+
|
|
1324
|
+
function require_mapCacheSet () {
|
|
1325
|
+
if (hasRequired_mapCacheSet) return _mapCacheSet;
|
|
1326
|
+
hasRequired_mapCacheSet = 1;
|
|
1327
|
+
var getMapData = /*@__PURE__*/ require_getMapData();
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* Sets the map `key` to `value`.
|
|
1331
|
+
*
|
|
1332
|
+
* @private
|
|
1333
|
+
* @name set
|
|
1334
|
+
* @memberOf MapCache
|
|
1335
|
+
* @param {string} key The key of the value to set.
|
|
1336
|
+
* @param {*} value The value to set.
|
|
1337
|
+
* @returns {Object} Returns the map cache instance.
|
|
1338
|
+
*/
|
|
1339
|
+
function mapCacheSet(key, value) {
|
|
1340
|
+
var data = getMapData(this, key),
|
|
1341
|
+
size = data.size;
|
|
1342
|
+
|
|
1343
|
+
data.set(key, value);
|
|
1344
|
+
this.size += data.size == size ? 0 : 1;
|
|
1345
|
+
return this;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
_mapCacheSet = mapCacheSet;
|
|
1349
|
+
return _mapCacheSet;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
var _MapCache;
|
|
1353
|
+
var hasRequired_MapCache;
|
|
1354
|
+
|
|
1355
|
+
function require_MapCache () {
|
|
1356
|
+
if (hasRequired_MapCache) return _MapCache;
|
|
1357
|
+
hasRequired_MapCache = 1;
|
|
1358
|
+
var mapCacheClear = /*@__PURE__*/ require_mapCacheClear(),
|
|
1359
|
+
mapCacheDelete = /*@__PURE__*/ require_mapCacheDelete(),
|
|
1360
|
+
mapCacheGet = /*@__PURE__*/ require_mapCacheGet(),
|
|
1361
|
+
mapCacheHas = /*@__PURE__*/ require_mapCacheHas(),
|
|
1362
|
+
mapCacheSet = /*@__PURE__*/ require_mapCacheSet();
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* Creates a map cache object to store key-value pairs.
|
|
1366
|
+
*
|
|
1367
|
+
* @private
|
|
1368
|
+
* @constructor
|
|
1369
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
1370
|
+
*/
|
|
1371
|
+
function MapCache(entries) {
|
|
1372
|
+
var index = -1,
|
|
1373
|
+
length = entries == null ? 0 : entries.length;
|
|
1374
|
+
|
|
1375
|
+
this.clear();
|
|
1376
|
+
while (++index < length) {
|
|
1377
|
+
var entry = entries[index];
|
|
1378
|
+
this.set(entry[0], entry[1]);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
// Add methods to `MapCache`.
|
|
1383
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
1384
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
1385
|
+
MapCache.prototype.get = mapCacheGet;
|
|
1386
|
+
MapCache.prototype.has = mapCacheHas;
|
|
1387
|
+
MapCache.prototype.set = mapCacheSet;
|
|
1388
|
+
|
|
1389
|
+
_MapCache = MapCache;
|
|
1390
|
+
return _MapCache;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
var _stackSet;
|
|
1394
|
+
var hasRequired_stackSet;
|
|
1395
|
+
|
|
1396
|
+
function require_stackSet () {
|
|
1397
|
+
if (hasRequired_stackSet) return _stackSet;
|
|
1398
|
+
hasRequired_stackSet = 1;
|
|
1399
|
+
var ListCache = /*@__PURE__*/ require_ListCache(),
|
|
1400
|
+
Map = /*@__PURE__*/ require_Map(),
|
|
1401
|
+
MapCache = /*@__PURE__*/ require_MapCache();
|
|
1402
|
+
|
|
1403
|
+
/** Used as the size to enable large array optimizations. */
|
|
1404
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Sets the stack `key` to `value`.
|
|
1408
|
+
*
|
|
1409
|
+
* @private
|
|
1410
|
+
* @name set
|
|
1411
|
+
* @memberOf Stack
|
|
1412
|
+
* @param {string} key The key of the value to set.
|
|
1413
|
+
* @param {*} value The value to set.
|
|
1414
|
+
* @returns {Object} Returns the stack cache instance.
|
|
1415
|
+
*/
|
|
1416
|
+
function stackSet(key, value) {
|
|
1417
|
+
var data = this.__data__;
|
|
1418
|
+
if (data instanceof ListCache) {
|
|
1419
|
+
var pairs = data.__data__;
|
|
1420
|
+
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
1421
|
+
pairs.push([key, value]);
|
|
1422
|
+
this.size = ++data.size;
|
|
1423
|
+
return this;
|
|
1424
|
+
}
|
|
1425
|
+
data = this.__data__ = new MapCache(pairs);
|
|
1426
|
+
}
|
|
1427
|
+
data.set(key, value);
|
|
1428
|
+
this.size = data.size;
|
|
1429
|
+
return this;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
_stackSet = stackSet;
|
|
1433
|
+
return _stackSet;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
var _Stack;
|
|
1437
|
+
var hasRequired_Stack;
|
|
1438
|
+
|
|
1439
|
+
function require_Stack () {
|
|
1440
|
+
if (hasRequired_Stack) return _Stack;
|
|
1441
|
+
hasRequired_Stack = 1;
|
|
1442
|
+
var ListCache = /*@__PURE__*/ require_ListCache(),
|
|
1443
|
+
stackClear = /*@__PURE__*/ require_stackClear(),
|
|
1444
|
+
stackDelete = /*@__PURE__*/ require_stackDelete(),
|
|
1445
|
+
stackGet = /*@__PURE__*/ require_stackGet(),
|
|
1446
|
+
stackHas = /*@__PURE__*/ require_stackHas(),
|
|
1447
|
+
stackSet = /*@__PURE__*/ require_stackSet();
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* Creates a stack cache object to store key-value pairs.
|
|
1451
|
+
*
|
|
1452
|
+
* @private
|
|
1453
|
+
* @constructor
|
|
1454
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
1455
|
+
*/
|
|
1456
|
+
function Stack(entries) {
|
|
1457
|
+
var data = this.__data__ = new ListCache(entries);
|
|
1458
|
+
this.size = data.size;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
// Add methods to `Stack`.
|
|
1462
|
+
Stack.prototype.clear = stackClear;
|
|
1463
|
+
Stack.prototype['delete'] = stackDelete;
|
|
1464
|
+
Stack.prototype.get = stackGet;
|
|
1465
|
+
Stack.prototype.has = stackHas;
|
|
1466
|
+
Stack.prototype.set = stackSet;
|
|
1467
|
+
|
|
1468
|
+
_Stack = Stack;
|
|
1469
|
+
return _Stack;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
var _defineProperty;
|
|
1473
|
+
var hasRequired_defineProperty;
|
|
1474
|
+
|
|
1475
|
+
function require_defineProperty () {
|
|
1476
|
+
if (hasRequired_defineProperty) return _defineProperty;
|
|
1477
|
+
hasRequired_defineProperty = 1;
|
|
1478
|
+
var getNative = /*@__PURE__*/ require_getNative();
|
|
1479
|
+
|
|
1480
|
+
var defineProperty = (function() {
|
|
1481
|
+
try {
|
|
1482
|
+
var func = getNative(Object, 'defineProperty');
|
|
1483
|
+
func({}, '', {});
|
|
1484
|
+
return func;
|
|
1485
|
+
} catch (e) {}
|
|
1486
|
+
}());
|
|
1487
|
+
|
|
1488
|
+
_defineProperty = defineProperty;
|
|
1489
|
+
return _defineProperty;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
var _baseAssignValue;
|
|
1493
|
+
var hasRequired_baseAssignValue;
|
|
1494
|
+
|
|
1495
|
+
function require_baseAssignValue () {
|
|
1496
|
+
if (hasRequired_baseAssignValue) return _baseAssignValue;
|
|
1497
|
+
hasRequired_baseAssignValue = 1;
|
|
1498
|
+
var defineProperty = /*@__PURE__*/ require_defineProperty();
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
1502
|
+
* value checks.
|
|
1503
|
+
*
|
|
1504
|
+
* @private
|
|
1505
|
+
* @param {Object} object The object to modify.
|
|
1506
|
+
* @param {string} key The key of the property to assign.
|
|
1507
|
+
* @param {*} value The value to assign.
|
|
1508
|
+
*/
|
|
1509
|
+
function baseAssignValue(object, key, value) {
|
|
1510
|
+
if (key == '__proto__' && defineProperty) {
|
|
1511
|
+
defineProperty(object, key, {
|
|
1512
|
+
'configurable': true,
|
|
1513
|
+
'enumerable': true,
|
|
1514
|
+
'value': value,
|
|
1515
|
+
'writable': true
|
|
1516
|
+
});
|
|
1517
|
+
} else {
|
|
1518
|
+
object[key] = value;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
_baseAssignValue = baseAssignValue;
|
|
1523
|
+
return _baseAssignValue;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
var _assignMergeValue;
|
|
1527
|
+
var hasRequired_assignMergeValue;
|
|
1528
|
+
|
|
1529
|
+
function require_assignMergeValue () {
|
|
1530
|
+
if (hasRequired_assignMergeValue) return _assignMergeValue;
|
|
1531
|
+
hasRequired_assignMergeValue = 1;
|
|
1532
|
+
var baseAssignValue = /*@__PURE__*/ require_baseAssignValue(),
|
|
1533
|
+
eq = /*@__PURE__*/ requireEq();
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* This function is like `assignValue` except that it doesn't assign
|
|
1537
|
+
* `undefined` values.
|
|
1538
|
+
*
|
|
1539
|
+
* @private
|
|
1540
|
+
* @param {Object} object The object to modify.
|
|
1541
|
+
* @param {string} key The key of the property to assign.
|
|
1542
|
+
* @param {*} value The value to assign.
|
|
1543
|
+
*/
|
|
1544
|
+
function assignMergeValue(object, key, value) {
|
|
1545
|
+
if ((value !== undefined && !eq(object[key], value)) ||
|
|
1546
|
+
(value === undefined && !(key in object))) {
|
|
1547
|
+
baseAssignValue(object, key, value);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
_assignMergeValue = assignMergeValue;
|
|
1552
|
+
return _assignMergeValue;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
1557
|
+
*
|
|
1558
|
+
* @private
|
|
1559
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
1560
|
+
* @returns {Function} Returns the new base function.
|
|
1561
|
+
*/
|
|
1562
|
+
|
|
1563
|
+
var _createBaseFor;
|
|
1564
|
+
var hasRequired_createBaseFor;
|
|
1565
|
+
|
|
1566
|
+
function require_createBaseFor () {
|
|
1567
|
+
if (hasRequired_createBaseFor) return _createBaseFor;
|
|
1568
|
+
hasRequired_createBaseFor = 1;
|
|
1569
|
+
function createBaseFor(fromRight) {
|
|
1570
|
+
return function(object, iteratee, keysFunc) {
|
|
1571
|
+
var index = -1,
|
|
1572
|
+
iterable = Object(object),
|
|
1573
|
+
props = keysFunc(object),
|
|
1574
|
+
length = props.length;
|
|
1575
|
+
|
|
1576
|
+
while (length--) {
|
|
1577
|
+
var key = props[fromRight ? length : ++index];
|
|
1578
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
1579
|
+
break;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
return object;
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
_createBaseFor = createBaseFor;
|
|
1587
|
+
return _createBaseFor;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
var _baseFor;
|
|
1591
|
+
var hasRequired_baseFor;
|
|
1592
|
+
|
|
1593
|
+
function require_baseFor () {
|
|
1594
|
+
if (hasRequired_baseFor) return _baseFor;
|
|
1595
|
+
hasRequired_baseFor = 1;
|
|
1596
|
+
var createBaseFor = /*@__PURE__*/ require_createBaseFor();
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
1600
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
1601
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
1602
|
+
*
|
|
1603
|
+
* @private
|
|
1604
|
+
* @param {Object} object The object to iterate over.
|
|
1605
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
1606
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
1607
|
+
* @returns {Object} Returns `object`.
|
|
1608
|
+
*/
|
|
1609
|
+
var baseFor = createBaseFor();
|
|
1610
|
+
|
|
1611
|
+
_baseFor = baseFor;
|
|
1612
|
+
return _baseFor;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
var _cloneBuffer = {exports: {}};
|
|
1616
|
+
|
|
1617
|
+
var hasRequired_cloneBuffer;
|
|
1618
|
+
|
|
1619
|
+
function require_cloneBuffer () {
|
|
1620
|
+
if (hasRequired_cloneBuffer) return _cloneBuffer.exports;
|
|
1621
|
+
hasRequired_cloneBuffer = 1;
|
|
1622
|
+
(function (module, exports) {
|
|
1623
|
+
var root = /*@__PURE__*/ require_root();
|
|
1624
|
+
|
|
1625
|
+
/** Detect free variable `exports`. */
|
|
1626
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1627
|
+
|
|
1628
|
+
/** Detect free variable `module`. */
|
|
1629
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
1630
|
+
|
|
1631
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
1632
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1633
|
+
|
|
1634
|
+
/** Built-in value references. */
|
|
1635
|
+
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
1636
|
+
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* Creates a clone of `buffer`.
|
|
1640
|
+
*
|
|
1641
|
+
* @private
|
|
1642
|
+
* @param {Buffer} buffer The buffer to clone.
|
|
1643
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1644
|
+
* @returns {Buffer} Returns the cloned buffer.
|
|
1645
|
+
*/
|
|
1646
|
+
function cloneBuffer(buffer, isDeep) {
|
|
1647
|
+
if (isDeep) {
|
|
1648
|
+
return buffer.slice();
|
|
1649
|
+
}
|
|
1650
|
+
var length = buffer.length,
|
|
1651
|
+
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
1652
|
+
|
|
1653
|
+
buffer.copy(result);
|
|
1654
|
+
return result;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
module.exports = cloneBuffer;
|
|
1658
|
+
} (_cloneBuffer, _cloneBuffer.exports));
|
|
1659
|
+
return _cloneBuffer.exports;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
var _Uint8Array;
|
|
1663
|
+
var hasRequired_Uint8Array;
|
|
1664
|
+
|
|
1665
|
+
function require_Uint8Array () {
|
|
1666
|
+
if (hasRequired_Uint8Array) return _Uint8Array;
|
|
1667
|
+
hasRequired_Uint8Array = 1;
|
|
1668
|
+
var root = /*@__PURE__*/ require_root();
|
|
1669
|
+
|
|
1670
|
+
/** Built-in value references. */
|
|
1671
|
+
var Uint8Array = root.Uint8Array;
|
|
1672
|
+
|
|
1673
|
+
_Uint8Array = Uint8Array;
|
|
1674
|
+
return _Uint8Array;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
var _cloneArrayBuffer;
|
|
1678
|
+
var hasRequired_cloneArrayBuffer;
|
|
1679
|
+
|
|
1680
|
+
function require_cloneArrayBuffer () {
|
|
1681
|
+
if (hasRequired_cloneArrayBuffer) return _cloneArrayBuffer;
|
|
1682
|
+
hasRequired_cloneArrayBuffer = 1;
|
|
1683
|
+
var Uint8Array = /*@__PURE__*/ require_Uint8Array();
|
|
1684
|
+
|
|
1685
|
+
/**
|
|
1686
|
+
* Creates a clone of `arrayBuffer`.
|
|
1687
|
+
*
|
|
1688
|
+
* @private
|
|
1689
|
+
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
|
|
1690
|
+
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
|
1691
|
+
*/
|
|
1692
|
+
function cloneArrayBuffer(arrayBuffer) {
|
|
1693
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
1694
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
1695
|
+
return result;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
_cloneArrayBuffer = cloneArrayBuffer;
|
|
1699
|
+
return _cloneArrayBuffer;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
var _cloneTypedArray;
|
|
1703
|
+
var hasRequired_cloneTypedArray;
|
|
1704
|
+
|
|
1705
|
+
function require_cloneTypedArray () {
|
|
1706
|
+
if (hasRequired_cloneTypedArray) return _cloneTypedArray;
|
|
1707
|
+
hasRequired_cloneTypedArray = 1;
|
|
1708
|
+
var cloneArrayBuffer = /*@__PURE__*/ require_cloneArrayBuffer();
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* Creates a clone of `typedArray`.
|
|
1712
|
+
*
|
|
1713
|
+
* @private
|
|
1714
|
+
* @param {Object} typedArray The typed array to clone.
|
|
1715
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
|
1716
|
+
* @returns {Object} Returns the cloned typed array.
|
|
1717
|
+
*/
|
|
1718
|
+
function cloneTypedArray(typedArray, isDeep) {
|
|
1719
|
+
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
1720
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
_cloneTypedArray = cloneTypedArray;
|
|
1724
|
+
return _cloneTypedArray;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* Copies the values of `source` to `array`.
|
|
1729
|
+
*
|
|
1730
|
+
* @private
|
|
1731
|
+
* @param {Array} source The array to copy values from.
|
|
1732
|
+
* @param {Array} [array=[]] The array to copy values to.
|
|
1733
|
+
* @returns {Array} Returns `array`.
|
|
1734
|
+
*/
|
|
1735
|
+
|
|
1736
|
+
var _copyArray;
|
|
1737
|
+
var hasRequired_copyArray;
|
|
1738
|
+
|
|
1739
|
+
function require_copyArray () {
|
|
1740
|
+
if (hasRequired_copyArray) return _copyArray;
|
|
1741
|
+
hasRequired_copyArray = 1;
|
|
1742
|
+
function copyArray(source, array) {
|
|
1743
|
+
var index = -1,
|
|
1744
|
+
length = source.length;
|
|
1745
|
+
|
|
1746
|
+
array || (array = Array(length));
|
|
1747
|
+
while (++index < length) {
|
|
1748
|
+
array[index] = source[index];
|
|
1749
|
+
}
|
|
1750
|
+
return array;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
_copyArray = copyArray;
|
|
1754
|
+
return _copyArray;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
var _baseCreate;
|
|
1758
|
+
var hasRequired_baseCreate;
|
|
1759
|
+
|
|
1760
|
+
function require_baseCreate () {
|
|
1761
|
+
if (hasRequired_baseCreate) return _baseCreate;
|
|
1762
|
+
hasRequired_baseCreate = 1;
|
|
1763
|
+
var isObject = /*@__PURE__*/ requireIsObject();
|
|
1764
|
+
|
|
1765
|
+
/** Built-in value references. */
|
|
1766
|
+
var objectCreate = Object.create;
|
|
1767
|
+
|
|
1768
|
+
/**
|
|
1769
|
+
* The base implementation of `_.create` without support for assigning
|
|
1770
|
+
* properties to the created object.
|
|
1771
|
+
*
|
|
1772
|
+
* @private
|
|
1773
|
+
* @param {Object} proto The object to inherit from.
|
|
1774
|
+
* @returns {Object} Returns the new object.
|
|
1775
|
+
*/
|
|
1776
|
+
var baseCreate = (function() {
|
|
1777
|
+
function object() {}
|
|
1778
|
+
return function(proto) {
|
|
1779
|
+
if (!isObject(proto)) {
|
|
1780
|
+
return {};
|
|
1781
|
+
}
|
|
1782
|
+
if (objectCreate) {
|
|
1783
|
+
return objectCreate(proto);
|
|
1784
|
+
}
|
|
1785
|
+
object.prototype = proto;
|
|
1786
|
+
var result = new object;
|
|
1787
|
+
object.prototype = undefined;
|
|
1788
|
+
return result;
|
|
1789
|
+
};
|
|
1790
|
+
}());
|
|
1791
|
+
|
|
1792
|
+
_baseCreate = baseCreate;
|
|
1793
|
+
return _baseCreate;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
1798
|
+
*
|
|
1799
|
+
* @private
|
|
1800
|
+
* @param {Function} func The function to wrap.
|
|
1801
|
+
* @param {Function} transform The argument transform.
|
|
1802
|
+
* @returns {Function} Returns the new function.
|
|
1803
|
+
*/
|
|
1804
|
+
|
|
1805
|
+
var _overArg;
|
|
1806
|
+
var hasRequired_overArg;
|
|
1807
|
+
|
|
1808
|
+
function require_overArg () {
|
|
1809
|
+
if (hasRequired_overArg) return _overArg;
|
|
1810
|
+
hasRequired_overArg = 1;
|
|
1811
|
+
function overArg(func, transform) {
|
|
1812
|
+
return function(arg) {
|
|
1813
|
+
return func(transform(arg));
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
_overArg = overArg;
|
|
1818
|
+
return _overArg;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
var _getPrototype;
|
|
1822
|
+
var hasRequired_getPrototype;
|
|
1823
|
+
|
|
1824
|
+
function require_getPrototype () {
|
|
1825
|
+
if (hasRequired_getPrototype) return _getPrototype;
|
|
1826
|
+
hasRequired_getPrototype = 1;
|
|
1827
|
+
var overArg = /*@__PURE__*/ require_overArg();
|
|
1828
|
+
|
|
1829
|
+
/** Built-in value references. */
|
|
1830
|
+
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
1831
|
+
|
|
1832
|
+
_getPrototype = getPrototype;
|
|
1833
|
+
return _getPrototype;
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
/** Used for built-in method references. */
|
|
1837
|
+
|
|
1838
|
+
var _isPrototype;
|
|
1839
|
+
var hasRequired_isPrototype;
|
|
1840
|
+
|
|
1841
|
+
function require_isPrototype () {
|
|
1842
|
+
if (hasRequired_isPrototype) return _isPrototype;
|
|
1843
|
+
hasRequired_isPrototype = 1;
|
|
1844
|
+
var objectProto = Object.prototype;
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Checks if `value` is likely a prototype object.
|
|
1848
|
+
*
|
|
1849
|
+
* @private
|
|
1850
|
+
* @param {*} value The value to check.
|
|
1851
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
1852
|
+
*/
|
|
1853
|
+
function isPrototype(value) {
|
|
1854
|
+
var Ctor = value && value.constructor,
|
|
1855
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
1856
|
+
|
|
1857
|
+
return value === proto;
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
_isPrototype = isPrototype;
|
|
1861
|
+
return _isPrototype;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
var _initCloneObject;
|
|
1865
|
+
var hasRequired_initCloneObject;
|
|
1866
|
+
|
|
1867
|
+
function require_initCloneObject () {
|
|
1868
|
+
if (hasRequired_initCloneObject) return _initCloneObject;
|
|
1869
|
+
hasRequired_initCloneObject = 1;
|
|
1870
|
+
var baseCreate = /*@__PURE__*/ require_baseCreate(),
|
|
1871
|
+
getPrototype = /*@__PURE__*/ require_getPrototype(),
|
|
1872
|
+
isPrototype = /*@__PURE__*/ require_isPrototype();
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Initializes an object clone.
|
|
1876
|
+
*
|
|
1877
|
+
* @private
|
|
1878
|
+
* @param {Object} object The object to clone.
|
|
1879
|
+
* @returns {Object} Returns the initialized clone.
|
|
1880
|
+
*/
|
|
1881
|
+
function initCloneObject(object) {
|
|
1882
|
+
return (typeof object.constructor == 'function' && !isPrototype(object))
|
|
1883
|
+
? baseCreate(getPrototype(object))
|
|
1884
|
+
: {};
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
_initCloneObject = initCloneObject;
|
|
1888
|
+
return _initCloneObject;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1893
|
+
* and has a `typeof` result of "object".
|
|
1894
|
+
*
|
|
1895
|
+
* @static
|
|
1896
|
+
* @memberOf _
|
|
1897
|
+
* @since 4.0.0
|
|
1898
|
+
* @category Lang
|
|
1899
|
+
* @param {*} value The value to check.
|
|
1900
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1901
|
+
* @example
|
|
1902
|
+
*
|
|
1903
|
+
* _.isObjectLike({});
|
|
1904
|
+
* // => true
|
|
1905
|
+
*
|
|
1906
|
+
* _.isObjectLike([1, 2, 3]);
|
|
1907
|
+
* // => true
|
|
1908
|
+
*
|
|
1909
|
+
* _.isObjectLike(_.noop);
|
|
1910
|
+
* // => false
|
|
1911
|
+
*
|
|
1912
|
+
* _.isObjectLike(null);
|
|
1913
|
+
* // => false
|
|
1914
|
+
*/
|
|
1915
|
+
|
|
1916
|
+
var isObjectLike_1;
|
|
1917
|
+
var hasRequiredIsObjectLike;
|
|
1918
|
+
|
|
1919
|
+
function requireIsObjectLike () {
|
|
1920
|
+
if (hasRequiredIsObjectLike) return isObjectLike_1;
|
|
1921
|
+
hasRequiredIsObjectLike = 1;
|
|
1922
|
+
function isObjectLike(value) {
|
|
1923
|
+
return value != null && typeof value == 'object';
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
isObjectLike_1 = isObjectLike;
|
|
1927
|
+
return isObjectLike_1;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
var _baseIsArguments;
|
|
1931
|
+
var hasRequired_baseIsArguments;
|
|
1932
|
+
|
|
1933
|
+
function require_baseIsArguments () {
|
|
1934
|
+
if (hasRequired_baseIsArguments) return _baseIsArguments;
|
|
1935
|
+
hasRequired_baseIsArguments = 1;
|
|
1936
|
+
var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
|
|
1937
|
+
isObjectLike = /*@__PURE__*/ requireIsObjectLike();
|
|
1938
|
+
|
|
1939
|
+
/** `Object#toString` result references. */
|
|
1940
|
+
var argsTag = '[object Arguments]';
|
|
1941
|
+
|
|
1942
|
+
/**
|
|
1943
|
+
* The base implementation of `_.isArguments`.
|
|
1944
|
+
*
|
|
1945
|
+
* @private
|
|
1946
|
+
* @param {*} value The value to check.
|
|
1947
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1948
|
+
*/
|
|
1949
|
+
function baseIsArguments(value) {
|
|
1950
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
_baseIsArguments = baseIsArguments;
|
|
1954
|
+
return _baseIsArguments;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
var isArguments_1;
|
|
1958
|
+
var hasRequiredIsArguments;
|
|
1959
|
+
|
|
1960
|
+
function requireIsArguments () {
|
|
1961
|
+
if (hasRequiredIsArguments) return isArguments_1;
|
|
1962
|
+
hasRequiredIsArguments = 1;
|
|
1963
|
+
var baseIsArguments = /*@__PURE__*/ require_baseIsArguments(),
|
|
1964
|
+
isObjectLike = /*@__PURE__*/ requireIsObjectLike();
|
|
1965
|
+
|
|
1966
|
+
/** Used for built-in method references. */
|
|
1967
|
+
var objectProto = Object.prototype;
|
|
1968
|
+
|
|
1969
|
+
/** Used to check objects for own properties. */
|
|
1970
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1971
|
+
|
|
1972
|
+
/** Built-in value references. */
|
|
1973
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Checks if `value` is likely an `arguments` object.
|
|
1977
|
+
*
|
|
1978
|
+
* @static
|
|
1979
|
+
* @memberOf _
|
|
1980
|
+
* @since 0.1.0
|
|
1981
|
+
* @category Lang
|
|
1982
|
+
* @param {*} value The value to check.
|
|
1983
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1984
|
+
* else `false`.
|
|
1985
|
+
* @example
|
|
1986
|
+
*
|
|
1987
|
+
* _.isArguments(function() { return arguments; }());
|
|
1988
|
+
* // => true
|
|
1989
|
+
*
|
|
1990
|
+
* _.isArguments([1, 2, 3]);
|
|
1991
|
+
* // => false
|
|
1992
|
+
*/
|
|
1993
|
+
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
1994
|
+
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
|
1995
|
+
!propertyIsEnumerable.call(value, 'callee');
|
|
1996
|
+
};
|
|
1997
|
+
|
|
1998
|
+
isArguments_1 = isArguments;
|
|
1999
|
+
return isArguments_1;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
/**
|
|
2003
|
+
* Checks if `value` is classified as an `Array` object.
|
|
2004
|
+
*
|
|
2005
|
+
* @static
|
|
2006
|
+
* @memberOf _
|
|
2007
|
+
* @since 0.1.0
|
|
2008
|
+
* @category Lang
|
|
2009
|
+
* @param {*} value The value to check.
|
|
2010
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
2011
|
+
* @example
|
|
2012
|
+
*
|
|
2013
|
+
* _.isArray([1, 2, 3]);
|
|
2014
|
+
* // => true
|
|
2015
|
+
*
|
|
2016
|
+
* _.isArray(document.body.children);
|
|
2017
|
+
* // => false
|
|
2018
|
+
*
|
|
2019
|
+
* _.isArray('abc');
|
|
2020
|
+
* // => false
|
|
2021
|
+
*
|
|
2022
|
+
* _.isArray(_.noop);
|
|
2023
|
+
* // => false
|
|
2024
|
+
*/
|
|
2025
|
+
|
|
2026
|
+
var isArray_1;
|
|
2027
|
+
var hasRequiredIsArray;
|
|
2028
|
+
|
|
2029
|
+
function requireIsArray () {
|
|
2030
|
+
if (hasRequiredIsArray) return isArray_1;
|
|
2031
|
+
hasRequiredIsArray = 1;
|
|
2032
|
+
var isArray = Array.isArray;
|
|
2033
|
+
|
|
2034
|
+
isArray_1 = isArray;
|
|
2035
|
+
return isArray_1;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
/** Used as references for various `Number` constants. */
|
|
2039
|
+
|
|
2040
|
+
var isLength_1;
|
|
2041
|
+
var hasRequiredIsLength;
|
|
2042
|
+
|
|
2043
|
+
function requireIsLength () {
|
|
2044
|
+
if (hasRequiredIsLength) return isLength_1;
|
|
2045
|
+
hasRequiredIsLength = 1;
|
|
2046
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2047
|
+
|
|
2048
|
+
/**
|
|
2049
|
+
* Checks if `value` is a valid array-like length.
|
|
2050
|
+
*
|
|
2051
|
+
* **Note:** This method is loosely based on
|
|
2052
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
2053
|
+
*
|
|
2054
|
+
* @static
|
|
2055
|
+
* @memberOf _
|
|
2056
|
+
* @since 4.0.0
|
|
2057
|
+
* @category Lang
|
|
2058
|
+
* @param {*} value The value to check.
|
|
2059
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
2060
|
+
* @example
|
|
2061
|
+
*
|
|
2062
|
+
* _.isLength(3);
|
|
2063
|
+
* // => true
|
|
2064
|
+
*
|
|
2065
|
+
* _.isLength(Number.MIN_VALUE);
|
|
2066
|
+
* // => false
|
|
2067
|
+
*
|
|
2068
|
+
* _.isLength(Infinity);
|
|
2069
|
+
* // => false
|
|
2070
|
+
*
|
|
2071
|
+
* _.isLength('3');
|
|
2072
|
+
* // => false
|
|
2073
|
+
*/
|
|
2074
|
+
function isLength(value) {
|
|
2075
|
+
return typeof value == 'number' &&
|
|
2076
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
isLength_1 = isLength;
|
|
2080
|
+
return isLength_1;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
var isArrayLike_1;
|
|
2084
|
+
var hasRequiredIsArrayLike;
|
|
2085
|
+
|
|
2086
|
+
function requireIsArrayLike () {
|
|
2087
|
+
if (hasRequiredIsArrayLike) return isArrayLike_1;
|
|
2088
|
+
hasRequiredIsArrayLike = 1;
|
|
2089
|
+
var isFunction = /*@__PURE__*/ requireIsFunction(),
|
|
2090
|
+
isLength = /*@__PURE__*/ requireIsLength();
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
2094
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
2095
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
2096
|
+
*
|
|
2097
|
+
* @static
|
|
2098
|
+
* @memberOf _
|
|
2099
|
+
* @since 4.0.0
|
|
2100
|
+
* @category Lang
|
|
2101
|
+
* @param {*} value The value to check.
|
|
2102
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
2103
|
+
* @example
|
|
2104
|
+
*
|
|
2105
|
+
* _.isArrayLike([1, 2, 3]);
|
|
2106
|
+
* // => true
|
|
2107
|
+
*
|
|
2108
|
+
* _.isArrayLike(document.body.children);
|
|
2109
|
+
* // => true
|
|
2110
|
+
*
|
|
2111
|
+
* _.isArrayLike('abc');
|
|
2112
|
+
* // => true
|
|
2113
|
+
*
|
|
2114
|
+
* _.isArrayLike(_.noop);
|
|
2115
|
+
* // => false
|
|
2116
|
+
*/
|
|
2117
|
+
function isArrayLike(value) {
|
|
2118
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
isArrayLike_1 = isArrayLike;
|
|
2122
|
+
return isArrayLike_1;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
var isArrayLikeObject_1;
|
|
2126
|
+
var hasRequiredIsArrayLikeObject;
|
|
2127
|
+
|
|
2128
|
+
function requireIsArrayLikeObject () {
|
|
2129
|
+
if (hasRequiredIsArrayLikeObject) return isArrayLikeObject_1;
|
|
2130
|
+
hasRequiredIsArrayLikeObject = 1;
|
|
2131
|
+
var isArrayLike = /*@__PURE__*/ requireIsArrayLike(),
|
|
2132
|
+
isObjectLike = /*@__PURE__*/ requireIsObjectLike();
|
|
2133
|
+
|
|
2134
|
+
/**
|
|
2135
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
2136
|
+
* is an object.
|
|
2137
|
+
*
|
|
2138
|
+
* @static
|
|
2139
|
+
* @memberOf _
|
|
2140
|
+
* @since 4.0.0
|
|
2141
|
+
* @category Lang
|
|
2142
|
+
* @param {*} value The value to check.
|
|
2143
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
2144
|
+
* else `false`.
|
|
2145
|
+
* @example
|
|
2146
|
+
*
|
|
2147
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
2148
|
+
* // => true
|
|
2149
|
+
*
|
|
2150
|
+
* _.isArrayLikeObject(document.body.children);
|
|
2151
|
+
* // => true
|
|
2152
|
+
*
|
|
2153
|
+
* _.isArrayLikeObject('abc');
|
|
2154
|
+
* // => false
|
|
2155
|
+
*
|
|
2156
|
+
* _.isArrayLikeObject(_.noop);
|
|
2157
|
+
* // => false
|
|
2158
|
+
*/
|
|
2159
|
+
function isArrayLikeObject(value) {
|
|
2160
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
isArrayLikeObject_1 = isArrayLikeObject;
|
|
2164
|
+
return isArrayLikeObject_1;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
var isBuffer = {exports: {}};
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* This method returns `false`.
|
|
2171
|
+
*
|
|
2172
|
+
* @static
|
|
2173
|
+
* @memberOf _
|
|
2174
|
+
* @since 4.13.0
|
|
2175
|
+
* @category Util
|
|
2176
|
+
* @returns {boolean} Returns `false`.
|
|
2177
|
+
* @example
|
|
2178
|
+
*
|
|
2179
|
+
* _.times(2, _.stubFalse);
|
|
2180
|
+
* // => [false, false]
|
|
2181
|
+
*/
|
|
2182
|
+
|
|
2183
|
+
var stubFalse_1;
|
|
2184
|
+
var hasRequiredStubFalse;
|
|
2185
|
+
|
|
2186
|
+
function requireStubFalse () {
|
|
2187
|
+
if (hasRequiredStubFalse) return stubFalse_1;
|
|
2188
|
+
hasRequiredStubFalse = 1;
|
|
2189
|
+
function stubFalse() {
|
|
2190
|
+
return false;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
stubFalse_1 = stubFalse;
|
|
2194
|
+
return stubFalse_1;
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
var hasRequiredIsBuffer;
|
|
2198
|
+
|
|
2199
|
+
function requireIsBuffer () {
|
|
2200
|
+
if (hasRequiredIsBuffer) return isBuffer.exports;
|
|
2201
|
+
hasRequiredIsBuffer = 1;
|
|
2202
|
+
(function (module, exports) {
|
|
2203
|
+
var root = /*@__PURE__*/ require_root(),
|
|
2204
|
+
stubFalse = /*@__PURE__*/ requireStubFalse();
|
|
2205
|
+
|
|
2206
|
+
/** Detect free variable `exports`. */
|
|
2207
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
2208
|
+
|
|
2209
|
+
/** Detect free variable `module`. */
|
|
2210
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2211
|
+
|
|
2212
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2213
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2214
|
+
|
|
2215
|
+
/** Built-in value references. */
|
|
2216
|
+
var Buffer = moduleExports ? root.Buffer : undefined;
|
|
2217
|
+
|
|
2218
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2219
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* Checks if `value` is a buffer.
|
|
2223
|
+
*
|
|
2224
|
+
* @static
|
|
2225
|
+
* @memberOf _
|
|
2226
|
+
* @since 4.3.0
|
|
2227
|
+
* @category Lang
|
|
2228
|
+
* @param {*} value The value to check.
|
|
2229
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
2230
|
+
* @example
|
|
2231
|
+
*
|
|
2232
|
+
* _.isBuffer(new Buffer(2));
|
|
2233
|
+
* // => true
|
|
2234
|
+
*
|
|
2235
|
+
* _.isBuffer(new Uint8Array(2));
|
|
2236
|
+
* // => false
|
|
2237
|
+
*/
|
|
2238
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
2239
|
+
|
|
2240
|
+
module.exports = isBuffer;
|
|
2241
|
+
} (isBuffer, isBuffer.exports));
|
|
2242
|
+
return isBuffer.exports;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
var isPlainObject_1;
|
|
2246
|
+
var hasRequiredIsPlainObject;
|
|
2247
|
+
|
|
2248
|
+
function requireIsPlainObject () {
|
|
2249
|
+
if (hasRequiredIsPlainObject) return isPlainObject_1;
|
|
2250
|
+
hasRequiredIsPlainObject = 1;
|
|
2251
|
+
var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
|
|
2252
|
+
getPrototype = /*@__PURE__*/ require_getPrototype(),
|
|
2253
|
+
isObjectLike = /*@__PURE__*/ requireIsObjectLike();
|
|
2254
|
+
|
|
2255
|
+
/** `Object#toString` result references. */
|
|
2256
|
+
var objectTag = '[object Object]';
|
|
2257
|
+
|
|
2258
|
+
/** Used for built-in method references. */
|
|
2259
|
+
var funcProto = Function.prototype,
|
|
2260
|
+
objectProto = Object.prototype;
|
|
2261
|
+
|
|
2262
|
+
/** Used to resolve the decompiled source of functions. */
|
|
2263
|
+
var funcToString = funcProto.toString;
|
|
2264
|
+
|
|
2265
|
+
/** Used to check objects for own properties. */
|
|
2266
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2267
|
+
|
|
2268
|
+
/** Used to infer the `Object` constructor. */
|
|
2269
|
+
var objectCtorString = funcToString.call(Object);
|
|
2270
|
+
|
|
2271
|
+
/**
|
|
2272
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
2273
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
2274
|
+
*
|
|
2275
|
+
* @static
|
|
2276
|
+
* @memberOf _
|
|
2277
|
+
* @since 0.8.0
|
|
2278
|
+
* @category Lang
|
|
2279
|
+
* @param {*} value The value to check.
|
|
2280
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
2281
|
+
* @example
|
|
2282
|
+
*
|
|
2283
|
+
* function Foo() {
|
|
2284
|
+
* this.a = 1;
|
|
2285
|
+
* }
|
|
2286
|
+
*
|
|
2287
|
+
* _.isPlainObject(new Foo);
|
|
2288
|
+
* // => false
|
|
2289
|
+
*
|
|
2290
|
+
* _.isPlainObject([1, 2, 3]);
|
|
2291
|
+
* // => false
|
|
2292
|
+
*
|
|
2293
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
2294
|
+
* // => true
|
|
2295
|
+
*
|
|
2296
|
+
* _.isPlainObject(Object.create(null));
|
|
2297
|
+
* // => true
|
|
2298
|
+
*/
|
|
2299
|
+
function isPlainObject(value) {
|
|
2300
|
+
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
2301
|
+
return false;
|
|
2302
|
+
}
|
|
2303
|
+
var proto = getPrototype(value);
|
|
2304
|
+
if (proto === null) {
|
|
2305
|
+
return true;
|
|
2306
|
+
}
|
|
2307
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
2308
|
+
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
2309
|
+
funcToString.call(Ctor) == objectCtorString;
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
isPlainObject_1 = isPlainObject;
|
|
2313
|
+
return isPlainObject_1;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
var _baseIsTypedArray;
|
|
2317
|
+
var hasRequired_baseIsTypedArray;
|
|
2318
|
+
|
|
2319
|
+
function require_baseIsTypedArray () {
|
|
2320
|
+
if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
|
|
2321
|
+
hasRequired_baseIsTypedArray = 1;
|
|
2322
|
+
var baseGetTag = /*@__PURE__*/ require_baseGetTag(),
|
|
2323
|
+
isLength = /*@__PURE__*/ requireIsLength(),
|
|
2324
|
+
isObjectLike = /*@__PURE__*/ requireIsObjectLike();
|
|
2325
|
+
|
|
2326
|
+
/** `Object#toString` result references. */
|
|
2327
|
+
var argsTag = '[object Arguments]',
|
|
2328
|
+
arrayTag = '[object Array]',
|
|
2329
|
+
boolTag = '[object Boolean]',
|
|
2330
|
+
dateTag = '[object Date]',
|
|
2331
|
+
errorTag = '[object Error]',
|
|
2332
|
+
funcTag = '[object Function]',
|
|
2333
|
+
mapTag = '[object Map]',
|
|
2334
|
+
numberTag = '[object Number]',
|
|
2335
|
+
objectTag = '[object Object]',
|
|
2336
|
+
regexpTag = '[object RegExp]',
|
|
2337
|
+
setTag = '[object Set]',
|
|
2338
|
+
stringTag = '[object String]',
|
|
2339
|
+
weakMapTag = '[object WeakMap]';
|
|
2340
|
+
|
|
2341
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
2342
|
+
dataViewTag = '[object DataView]',
|
|
2343
|
+
float32Tag = '[object Float32Array]',
|
|
2344
|
+
float64Tag = '[object Float64Array]',
|
|
2345
|
+
int8Tag = '[object Int8Array]',
|
|
2346
|
+
int16Tag = '[object Int16Array]',
|
|
2347
|
+
int32Tag = '[object Int32Array]',
|
|
2348
|
+
uint8Tag = '[object Uint8Array]',
|
|
2349
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
2350
|
+
uint16Tag = '[object Uint16Array]',
|
|
2351
|
+
uint32Tag = '[object Uint32Array]';
|
|
2352
|
+
|
|
2353
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
2354
|
+
var typedArrayTags = {};
|
|
2355
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
2356
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
2357
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
2358
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
2359
|
+
typedArrayTags[uint32Tag] = true;
|
|
2360
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
|
2361
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
2362
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
|
2363
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
2364
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
|
2365
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
|
2366
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
|
2367
|
+
typedArrayTags[weakMapTag] = false;
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
2371
|
+
*
|
|
2372
|
+
* @private
|
|
2373
|
+
* @param {*} value The value to check.
|
|
2374
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
2375
|
+
*/
|
|
2376
|
+
function baseIsTypedArray(value) {
|
|
2377
|
+
return isObjectLike(value) &&
|
|
2378
|
+
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
_baseIsTypedArray = baseIsTypedArray;
|
|
2382
|
+
return _baseIsTypedArray;
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
/**
|
|
2386
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
2387
|
+
*
|
|
2388
|
+
* @private
|
|
2389
|
+
* @param {Function} func The function to cap arguments for.
|
|
2390
|
+
* @returns {Function} Returns the new capped function.
|
|
2391
|
+
*/
|
|
2392
|
+
|
|
2393
|
+
var _baseUnary;
|
|
2394
|
+
var hasRequired_baseUnary;
|
|
2395
|
+
|
|
2396
|
+
function require_baseUnary () {
|
|
2397
|
+
if (hasRequired_baseUnary) return _baseUnary;
|
|
2398
|
+
hasRequired_baseUnary = 1;
|
|
2399
|
+
function baseUnary(func) {
|
|
2400
|
+
return function(value) {
|
|
2401
|
+
return func(value);
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
_baseUnary = baseUnary;
|
|
2406
|
+
return _baseUnary;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
var _nodeUtil = {exports: {}};
|
|
2410
|
+
|
|
2411
|
+
var hasRequired_nodeUtil;
|
|
2412
|
+
|
|
2413
|
+
function require_nodeUtil () {
|
|
2414
|
+
if (hasRequired_nodeUtil) return _nodeUtil.exports;
|
|
2415
|
+
hasRequired_nodeUtil = 1;
|
|
2416
|
+
(function (module, exports) {
|
|
2417
|
+
var freeGlobal = /*@__PURE__*/ require_freeGlobal();
|
|
2418
|
+
|
|
2419
|
+
/** Detect free variable `exports`. */
|
|
2420
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
2421
|
+
|
|
2422
|
+
/** Detect free variable `module`. */
|
|
2423
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2424
|
+
|
|
2425
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2426
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2427
|
+
|
|
2428
|
+
/** Detect free variable `process` from Node.js. */
|
|
2429
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
2430
|
+
|
|
2431
|
+
/** Used to access faster Node.js helpers. */
|
|
2432
|
+
var nodeUtil = (function() {
|
|
2433
|
+
try {
|
|
2434
|
+
// Use `util.types` for Node.js 10+.
|
|
2435
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
2436
|
+
|
|
2437
|
+
if (types) {
|
|
2438
|
+
return types;
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
|
2442
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
2443
|
+
} catch (e) {}
|
|
2444
|
+
}());
|
|
2445
|
+
|
|
2446
|
+
module.exports = nodeUtil;
|
|
2447
|
+
} (_nodeUtil, _nodeUtil.exports));
|
|
2448
|
+
return _nodeUtil.exports;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
var isTypedArray_1;
|
|
2452
|
+
var hasRequiredIsTypedArray;
|
|
2453
|
+
|
|
2454
|
+
function requireIsTypedArray () {
|
|
2455
|
+
if (hasRequiredIsTypedArray) return isTypedArray_1;
|
|
2456
|
+
hasRequiredIsTypedArray = 1;
|
|
2457
|
+
var baseIsTypedArray = /*@__PURE__*/ require_baseIsTypedArray(),
|
|
2458
|
+
baseUnary = /*@__PURE__*/ require_baseUnary(),
|
|
2459
|
+
nodeUtil = /*@__PURE__*/ require_nodeUtil();
|
|
2460
|
+
|
|
2461
|
+
/* Node.js helper references. */
|
|
2462
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
2463
|
+
|
|
2464
|
+
/**
|
|
2465
|
+
* Checks if `value` is classified as a typed array.
|
|
2466
|
+
*
|
|
2467
|
+
* @static
|
|
2468
|
+
* @memberOf _
|
|
2469
|
+
* @since 3.0.0
|
|
2470
|
+
* @category Lang
|
|
2471
|
+
* @param {*} value The value to check.
|
|
2472
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
2473
|
+
* @example
|
|
2474
|
+
*
|
|
2475
|
+
* _.isTypedArray(new Uint8Array);
|
|
2476
|
+
* // => true
|
|
2477
|
+
*
|
|
2478
|
+
* _.isTypedArray([]);
|
|
2479
|
+
* // => false
|
|
2480
|
+
*/
|
|
2481
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
2482
|
+
|
|
2483
|
+
isTypedArray_1 = isTypedArray;
|
|
2484
|
+
return isTypedArray_1;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
/**
|
|
2488
|
+
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
2489
|
+
*
|
|
2490
|
+
* @private
|
|
2491
|
+
* @param {Object} object The object to query.
|
|
2492
|
+
* @param {string} key The key of the property to get.
|
|
2493
|
+
* @returns {*} Returns the property value.
|
|
2494
|
+
*/
|
|
2495
|
+
|
|
2496
|
+
var _safeGet;
|
|
2497
|
+
var hasRequired_safeGet;
|
|
2498
|
+
|
|
2499
|
+
function require_safeGet () {
|
|
2500
|
+
if (hasRequired_safeGet) return _safeGet;
|
|
2501
|
+
hasRequired_safeGet = 1;
|
|
2502
|
+
function safeGet(object, key) {
|
|
2503
|
+
if (key === 'constructor' && typeof object[key] === 'function') {
|
|
2504
|
+
return;
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
if (key == '__proto__') {
|
|
2508
|
+
return;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
return object[key];
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
_safeGet = safeGet;
|
|
2515
|
+
return _safeGet;
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
var _assignValue;
|
|
2519
|
+
var hasRequired_assignValue;
|
|
2520
|
+
|
|
2521
|
+
function require_assignValue () {
|
|
2522
|
+
if (hasRequired_assignValue) return _assignValue;
|
|
2523
|
+
hasRequired_assignValue = 1;
|
|
2524
|
+
var baseAssignValue = /*@__PURE__*/ require_baseAssignValue(),
|
|
2525
|
+
eq = /*@__PURE__*/ requireEq();
|
|
2526
|
+
|
|
2527
|
+
/** Used for built-in method references. */
|
|
2528
|
+
var objectProto = Object.prototype;
|
|
2529
|
+
|
|
2530
|
+
/** Used to check objects for own properties. */
|
|
2531
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2532
|
+
|
|
2533
|
+
/**
|
|
2534
|
+
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
2535
|
+
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
2536
|
+
* for equality comparisons.
|
|
2537
|
+
*
|
|
2538
|
+
* @private
|
|
2539
|
+
* @param {Object} object The object to modify.
|
|
2540
|
+
* @param {string} key The key of the property to assign.
|
|
2541
|
+
* @param {*} value The value to assign.
|
|
2542
|
+
*/
|
|
2543
|
+
function assignValue(object, key, value) {
|
|
2544
|
+
var objValue = object[key];
|
|
2545
|
+
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
|
|
2546
|
+
(value === undefined && !(key in object))) {
|
|
2547
|
+
baseAssignValue(object, key, value);
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
_assignValue = assignValue;
|
|
2552
|
+
return _assignValue;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
var _copyObject;
|
|
2556
|
+
var hasRequired_copyObject;
|
|
2557
|
+
|
|
2558
|
+
function require_copyObject () {
|
|
2559
|
+
if (hasRequired_copyObject) return _copyObject;
|
|
2560
|
+
hasRequired_copyObject = 1;
|
|
2561
|
+
var assignValue = /*@__PURE__*/ require_assignValue(),
|
|
2562
|
+
baseAssignValue = /*@__PURE__*/ require_baseAssignValue();
|
|
2563
|
+
|
|
2564
|
+
/**
|
|
2565
|
+
* Copies properties of `source` to `object`.
|
|
2566
|
+
*
|
|
2567
|
+
* @private
|
|
2568
|
+
* @param {Object} source The object to copy properties from.
|
|
2569
|
+
* @param {Array} props The property identifiers to copy.
|
|
2570
|
+
* @param {Object} [object={}] The object to copy properties to.
|
|
2571
|
+
* @param {Function} [customizer] The function to customize copied values.
|
|
2572
|
+
* @returns {Object} Returns `object`.
|
|
2573
|
+
*/
|
|
2574
|
+
function copyObject(source, props, object, customizer) {
|
|
2575
|
+
var isNew = !object;
|
|
2576
|
+
object || (object = {});
|
|
2577
|
+
|
|
2578
|
+
var index = -1,
|
|
2579
|
+
length = props.length;
|
|
2580
|
+
|
|
2581
|
+
while (++index < length) {
|
|
2582
|
+
var key = props[index];
|
|
2583
|
+
|
|
2584
|
+
var newValue = customizer
|
|
2585
|
+
? customizer(object[key], source[key], key, object, source)
|
|
2586
|
+
: undefined;
|
|
2587
|
+
|
|
2588
|
+
if (newValue === undefined) {
|
|
2589
|
+
newValue = source[key];
|
|
2590
|
+
}
|
|
2591
|
+
if (isNew) {
|
|
2592
|
+
baseAssignValue(object, key, newValue);
|
|
2593
|
+
} else {
|
|
2594
|
+
assignValue(object, key, newValue);
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
return object;
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
_copyObject = copyObject;
|
|
2601
|
+
return _copyObject;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
/**
|
|
2605
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
|
2606
|
+
* or max array length checks.
|
|
2607
|
+
*
|
|
2608
|
+
* @private
|
|
2609
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
|
2610
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
2611
|
+
* @returns {Array} Returns the array of results.
|
|
2612
|
+
*/
|
|
2613
|
+
|
|
2614
|
+
var _baseTimes;
|
|
2615
|
+
var hasRequired_baseTimes;
|
|
2616
|
+
|
|
2617
|
+
function require_baseTimes () {
|
|
2618
|
+
if (hasRequired_baseTimes) return _baseTimes;
|
|
2619
|
+
hasRequired_baseTimes = 1;
|
|
2620
|
+
function baseTimes(n, iteratee) {
|
|
2621
|
+
var index = -1,
|
|
2622
|
+
result = Array(n);
|
|
2623
|
+
|
|
2624
|
+
while (++index < n) {
|
|
2625
|
+
result[index] = iteratee(index);
|
|
2626
|
+
}
|
|
2627
|
+
return result;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
_baseTimes = baseTimes;
|
|
2631
|
+
return _baseTimes;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
/** Used as references for various `Number` constants. */
|
|
2635
|
+
|
|
2636
|
+
var _isIndex;
|
|
2637
|
+
var hasRequired_isIndex;
|
|
2638
|
+
|
|
2639
|
+
function require_isIndex () {
|
|
2640
|
+
if (hasRequired_isIndex) return _isIndex;
|
|
2641
|
+
hasRequired_isIndex = 1;
|
|
2642
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2643
|
+
|
|
2644
|
+
/** Used to detect unsigned integer values. */
|
|
2645
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2646
|
+
|
|
2647
|
+
/**
|
|
2648
|
+
* Checks if `value` is a valid array-like index.
|
|
2649
|
+
*
|
|
2650
|
+
* @private
|
|
2651
|
+
* @param {*} value The value to check.
|
|
2652
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
2653
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
2654
|
+
*/
|
|
2655
|
+
function isIndex(value, length) {
|
|
2656
|
+
var type = typeof value;
|
|
2657
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
2658
|
+
|
|
2659
|
+
return !!length &&
|
|
2660
|
+
(type == 'number' ||
|
|
2661
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
|
2662
|
+
(value > -1 && value % 1 == 0 && value < length);
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
_isIndex = isIndex;
|
|
2666
|
+
return _isIndex;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
var _arrayLikeKeys;
|
|
2670
|
+
var hasRequired_arrayLikeKeys;
|
|
2671
|
+
|
|
2672
|
+
function require_arrayLikeKeys () {
|
|
2673
|
+
if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
|
|
2674
|
+
hasRequired_arrayLikeKeys = 1;
|
|
2675
|
+
var baseTimes = /*@__PURE__*/ require_baseTimes(),
|
|
2676
|
+
isArguments = /*@__PURE__*/ requireIsArguments(),
|
|
2677
|
+
isArray = /*@__PURE__*/ requireIsArray(),
|
|
2678
|
+
isBuffer = /*@__PURE__*/ requireIsBuffer(),
|
|
2679
|
+
isIndex = /*@__PURE__*/ require_isIndex(),
|
|
2680
|
+
isTypedArray = /*@__PURE__*/ requireIsTypedArray();
|
|
2681
|
+
|
|
2682
|
+
/** Used for built-in method references. */
|
|
2683
|
+
var objectProto = Object.prototype;
|
|
2684
|
+
|
|
2685
|
+
/** Used to check objects for own properties. */
|
|
2686
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2687
|
+
|
|
2688
|
+
/**
|
|
2689
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
|
2690
|
+
*
|
|
2691
|
+
* @private
|
|
2692
|
+
* @param {*} value The value to query.
|
|
2693
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
|
2694
|
+
* @returns {Array} Returns the array of property names.
|
|
2695
|
+
*/
|
|
2696
|
+
function arrayLikeKeys(value, inherited) {
|
|
2697
|
+
var isArr = isArray(value),
|
|
2698
|
+
isArg = !isArr && isArguments(value),
|
|
2699
|
+
isBuff = !isArr && !isArg && isBuffer(value),
|
|
2700
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
|
2701
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
2702
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
2703
|
+
length = result.length;
|
|
2704
|
+
|
|
2705
|
+
for (var key in value) {
|
|
2706
|
+
if ((inherited || hasOwnProperty.call(value, key)) &&
|
|
2707
|
+
!(skipIndexes && (
|
|
2708
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2709
|
+
key == 'length' ||
|
|
2710
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
2711
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
2712
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
2713
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
2714
|
+
// Skip index properties.
|
|
2715
|
+
isIndex(key, length)
|
|
2716
|
+
))) {
|
|
2717
|
+
result.push(key);
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
return result;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
_arrayLikeKeys = arrayLikeKeys;
|
|
2724
|
+
return _arrayLikeKeys;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
/**
|
|
2728
|
+
* This function is like
|
|
2729
|
+
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
2730
|
+
* except that it includes inherited enumerable properties.
|
|
2731
|
+
*
|
|
2732
|
+
* @private
|
|
2733
|
+
* @param {Object} object The object to query.
|
|
2734
|
+
* @returns {Array} Returns the array of property names.
|
|
2735
|
+
*/
|
|
2736
|
+
|
|
2737
|
+
var _nativeKeysIn;
|
|
2738
|
+
var hasRequired_nativeKeysIn;
|
|
2739
|
+
|
|
2740
|
+
function require_nativeKeysIn () {
|
|
2741
|
+
if (hasRequired_nativeKeysIn) return _nativeKeysIn;
|
|
2742
|
+
hasRequired_nativeKeysIn = 1;
|
|
2743
|
+
function nativeKeysIn(object) {
|
|
2744
|
+
var result = [];
|
|
2745
|
+
if (object != null) {
|
|
2746
|
+
for (var key in Object(object)) {
|
|
2747
|
+
result.push(key);
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
return result;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
_nativeKeysIn = nativeKeysIn;
|
|
2754
|
+
return _nativeKeysIn;
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
var _baseKeysIn;
|
|
2758
|
+
var hasRequired_baseKeysIn;
|
|
2759
|
+
|
|
2760
|
+
function require_baseKeysIn () {
|
|
2761
|
+
if (hasRequired_baseKeysIn) return _baseKeysIn;
|
|
2762
|
+
hasRequired_baseKeysIn = 1;
|
|
2763
|
+
var isObject = /*@__PURE__*/ requireIsObject(),
|
|
2764
|
+
isPrototype = /*@__PURE__*/ require_isPrototype(),
|
|
2765
|
+
nativeKeysIn = /*@__PURE__*/ require_nativeKeysIn();
|
|
2766
|
+
|
|
2767
|
+
/** Used for built-in method references. */
|
|
2768
|
+
var objectProto = Object.prototype;
|
|
2769
|
+
|
|
2770
|
+
/** Used to check objects for own properties. */
|
|
2771
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2772
|
+
|
|
2773
|
+
/**
|
|
2774
|
+
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
2775
|
+
*
|
|
2776
|
+
* @private
|
|
2777
|
+
* @param {Object} object The object to query.
|
|
2778
|
+
* @returns {Array} Returns the array of property names.
|
|
2779
|
+
*/
|
|
2780
|
+
function baseKeysIn(object) {
|
|
2781
|
+
if (!isObject(object)) {
|
|
2782
|
+
return nativeKeysIn(object);
|
|
2783
|
+
}
|
|
2784
|
+
var isProto = isPrototype(object),
|
|
2785
|
+
result = [];
|
|
2786
|
+
|
|
2787
|
+
for (var key in object) {
|
|
2788
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
|
2789
|
+
result.push(key);
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
return result;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
_baseKeysIn = baseKeysIn;
|
|
2796
|
+
return _baseKeysIn;
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
var keysIn_1;
|
|
2800
|
+
var hasRequiredKeysIn;
|
|
2801
|
+
|
|
2802
|
+
function requireKeysIn () {
|
|
2803
|
+
if (hasRequiredKeysIn) return keysIn_1;
|
|
2804
|
+
hasRequiredKeysIn = 1;
|
|
2805
|
+
var arrayLikeKeys = /*@__PURE__*/ require_arrayLikeKeys(),
|
|
2806
|
+
baseKeysIn = /*@__PURE__*/ require_baseKeysIn(),
|
|
2807
|
+
isArrayLike = /*@__PURE__*/ requireIsArrayLike();
|
|
2808
|
+
|
|
2809
|
+
/**
|
|
2810
|
+
* Creates an array of the own and inherited enumerable property names of `object`.
|
|
2811
|
+
*
|
|
2812
|
+
* **Note:** Non-object values are coerced to objects.
|
|
2813
|
+
*
|
|
2814
|
+
* @static
|
|
2815
|
+
* @memberOf _
|
|
2816
|
+
* @since 3.0.0
|
|
2817
|
+
* @category Object
|
|
2818
|
+
* @param {Object} object The object to query.
|
|
2819
|
+
* @returns {Array} Returns the array of property names.
|
|
2820
|
+
* @example
|
|
2821
|
+
*
|
|
2822
|
+
* function Foo() {
|
|
2823
|
+
* this.a = 1;
|
|
2824
|
+
* this.b = 2;
|
|
2825
|
+
* }
|
|
2826
|
+
*
|
|
2827
|
+
* Foo.prototype.c = 3;
|
|
2828
|
+
*
|
|
2829
|
+
* _.keysIn(new Foo);
|
|
2830
|
+
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
|
2831
|
+
*/
|
|
2832
|
+
function keysIn(object) {
|
|
2833
|
+
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
keysIn_1 = keysIn;
|
|
2837
|
+
return keysIn_1;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
var toPlainObject_1;
|
|
2841
|
+
var hasRequiredToPlainObject;
|
|
2842
|
+
|
|
2843
|
+
function requireToPlainObject () {
|
|
2844
|
+
if (hasRequiredToPlainObject) return toPlainObject_1;
|
|
2845
|
+
hasRequiredToPlainObject = 1;
|
|
2846
|
+
var copyObject = /*@__PURE__*/ require_copyObject(),
|
|
2847
|
+
keysIn = /*@__PURE__*/ requireKeysIn();
|
|
2848
|
+
|
|
2849
|
+
/**
|
|
2850
|
+
* Converts `value` to a plain object flattening inherited enumerable string
|
|
2851
|
+
* keyed properties of `value` to own properties of the plain object.
|
|
2852
|
+
*
|
|
2853
|
+
* @static
|
|
2854
|
+
* @memberOf _
|
|
2855
|
+
* @since 3.0.0
|
|
2856
|
+
* @category Lang
|
|
2857
|
+
* @param {*} value The value to convert.
|
|
2858
|
+
* @returns {Object} Returns the converted plain object.
|
|
2859
|
+
* @example
|
|
2860
|
+
*
|
|
2861
|
+
* function Foo() {
|
|
2862
|
+
* this.b = 2;
|
|
2863
|
+
* }
|
|
2864
|
+
*
|
|
2865
|
+
* Foo.prototype.c = 3;
|
|
2866
|
+
*
|
|
2867
|
+
* _.assign({ 'a': 1 }, new Foo);
|
|
2868
|
+
* // => { 'a': 1, 'b': 2 }
|
|
2869
|
+
*
|
|
2870
|
+
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
|
|
2871
|
+
* // => { 'a': 1, 'b': 2, 'c': 3 }
|
|
2872
|
+
*/
|
|
2873
|
+
function toPlainObject(value) {
|
|
2874
|
+
return copyObject(value, keysIn(value));
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
toPlainObject_1 = toPlainObject;
|
|
2878
|
+
return toPlainObject_1;
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
var _baseMergeDeep;
|
|
2882
|
+
var hasRequired_baseMergeDeep;
|
|
2883
|
+
|
|
2884
|
+
function require_baseMergeDeep () {
|
|
2885
|
+
if (hasRequired_baseMergeDeep) return _baseMergeDeep;
|
|
2886
|
+
hasRequired_baseMergeDeep = 1;
|
|
2887
|
+
var assignMergeValue = /*@__PURE__*/ require_assignMergeValue(),
|
|
2888
|
+
cloneBuffer = /*@__PURE__*/ require_cloneBuffer(),
|
|
2889
|
+
cloneTypedArray = /*@__PURE__*/ require_cloneTypedArray(),
|
|
2890
|
+
copyArray = /*@__PURE__*/ require_copyArray(),
|
|
2891
|
+
initCloneObject = /*@__PURE__*/ require_initCloneObject(),
|
|
2892
|
+
isArguments = /*@__PURE__*/ requireIsArguments(),
|
|
2893
|
+
isArray = /*@__PURE__*/ requireIsArray(),
|
|
2894
|
+
isArrayLikeObject = /*@__PURE__*/ requireIsArrayLikeObject(),
|
|
2895
|
+
isBuffer = /*@__PURE__*/ requireIsBuffer(),
|
|
2896
|
+
isFunction = /*@__PURE__*/ requireIsFunction(),
|
|
2897
|
+
isObject = /*@__PURE__*/ requireIsObject(),
|
|
2898
|
+
isPlainObject = /*@__PURE__*/ requireIsPlainObject(),
|
|
2899
|
+
isTypedArray = /*@__PURE__*/ requireIsTypedArray(),
|
|
2900
|
+
safeGet = /*@__PURE__*/ require_safeGet(),
|
|
2901
|
+
toPlainObject = /*@__PURE__*/ requireToPlainObject();
|
|
2902
|
+
|
|
2903
|
+
/**
|
|
2904
|
+
* A specialized version of `baseMerge` for arrays and objects which performs
|
|
2905
|
+
* deep merges and tracks traversed objects enabling objects with circular
|
|
2906
|
+
* references to be merged.
|
|
2907
|
+
*
|
|
2908
|
+
* @private
|
|
2909
|
+
* @param {Object} object The destination object.
|
|
2910
|
+
* @param {Object} source The source object.
|
|
2911
|
+
* @param {string} key The key of the value to merge.
|
|
2912
|
+
* @param {number} srcIndex The index of `source`.
|
|
2913
|
+
* @param {Function} mergeFunc The function to merge values.
|
|
2914
|
+
* @param {Function} [customizer] The function to customize assigned values.
|
|
2915
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
2916
|
+
* counterparts.
|
|
2917
|
+
*/
|
|
2918
|
+
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
2919
|
+
var objValue = safeGet(object, key),
|
|
2920
|
+
srcValue = safeGet(source, key),
|
|
2921
|
+
stacked = stack.get(srcValue);
|
|
2922
|
+
|
|
2923
|
+
if (stacked) {
|
|
2924
|
+
assignMergeValue(object, key, stacked);
|
|
2925
|
+
return;
|
|
2926
|
+
}
|
|
2927
|
+
var newValue = customizer
|
|
2928
|
+
? customizer(objValue, srcValue, (key + ''), object, source, stack)
|
|
2929
|
+
: undefined;
|
|
2930
|
+
|
|
2931
|
+
var isCommon = newValue === undefined;
|
|
2932
|
+
|
|
2933
|
+
if (isCommon) {
|
|
2934
|
+
var isArr = isArray(srcValue),
|
|
2935
|
+
isBuff = !isArr && isBuffer(srcValue),
|
|
2936
|
+
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
2937
|
+
|
|
2938
|
+
newValue = srcValue;
|
|
2939
|
+
if (isArr || isBuff || isTyped) {
|
|
2940
|
+
if (isArray(objValue)) {
|
|
2941
|
+
newValue = objValue;
|
|
2942
|
+
}
|
|
2943
|
+
else if (isArrayLikeObject(objValue)) {
|
|
2944
|
+
newValue = copyArray(objValue);
|
|
2945
|
+
}
|
|
2946
|
+
else if (isBuff) {
|
|
2947
|
+
isCommon = false;
|
|
2948
|
+
newValue = cloneBuffer(srcValue, true);
|
|
2949
|
+
}
|
|
2950
|
+
else if (isTyped) {
|
|
2951
|
+
isCommon = false;
|
|
2952
|
+
newValue = cloneTypedArray(srcValue, true);
|
|
2953
|
+
}
|
|
2954
|
+
else {
|
|
2955
|
+
newValue = [];
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
2959
|
+
newValue = objValue;
|
|
2960
|
+
if (isArguments(objValue)) {
|
|
2961
|
+
newValue = toPlainObject(objValue);
|
|
2962
|
+
}
|
|
2963
|
+
else if (!isObject(objValue) || isFunction(objValue)) {
|
|
2964
|
+
newValue = initCloneObject(srcValue);
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
else {
|
|
2968
|
+
isCommon = false;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
if (isCommon) {
|
|
2972
|
+
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
2973
|
+
stack.set(srcValue, newValue);
|
|
2974
|
+
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
2975
|
+
stack['delete'](srcValue);
|
|
2976
|
+
}
|
|
2977
|
+
assignMergeValue(object, key, newValue);
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
_baseMergeDeep = baseMergeDeep;
|
|
2981
|
+
return _baseMergeDeep;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
var _baseMerge;
|
|
2985
|
+
var hasRequired_baseMerge;
|
|
2986
|
+
|
|
2987
|
+
function require_baseMerge () {
|
|
2988
|
+
if (hasRequired_baseMerge) return _baseMerge;
|
|
2989
|
+
hasRequired_baseMerge = 1;
|
|
2990
|
+
var Stack = /*@__PURE__*/ require_Stack(),
|
|
2991
|
+
assignMergeValue = /*@__PURE__*/ require_assignMergeValue(),
|
|
2992
|
+
baseFor = /*@__PURE__*/ require_baseFor(),
|
|
2993
|
+
baseMergeDeep = /*@__PURE__*/ require_baseMergeDeep(),
|
|
2994
|
+
isObject = /*@__PURE__*/ requireIsObject(),
|
|
2995
|
+
keysIn = /*@__PURE__*/ requireKeysIn(),
|
|
2996
|
+
safeGet = /*@__PURE__*/ require_safeGet();
|
|
2997
|
+
|
|
2998
|
+
/**
|
|
2999
|
+
* The base implementation of `_.merge` without support for multiple sources.
|
|
3000
|
+
*
|
|
3001
|
+
* @private
|
|
3002
|
+
* @param {Object} object The destination object.
|
|
3003
|
+
* @param {Object} source The source object.
|
|
3004
|
+
* @param {number} srcIndex The index of `source`.
|
|
3005
|
+
* @param {Function} [customizer] The function to customize merged values.
|
|
3006
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
3007
|
+
* counterparts.
|
|
3008
|
+
*/
|
|
3009
|
+
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
3010
|
+
if (object === source) {
|
|
3011
|
+
return;
|
|
3012
|
+
}
|
|
3013
|
+
baseFor(source, function(srcValue, key) {
|
|
3014
|
+
stack || (stack = new Stack);
|
|
3015
|
+
if (isObject(srcValue)) {
|
|
3016
|
+
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
3017
|
+
}
|
|
3018
|
+
else {
|
|
3019
|
+
var newValue = customizer
|
|
3020
|
+
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
|
|
3021
|
+
: undefined;
|
|
3022
|
+
|
|
3023
|
+
if (newValue === undefined) {
|
|
3024
|
+
newValue = srcValue;
|
|
3025
|
+
}
|
|
3026
|
+
assignMergeValue(object, key, newValue);
|
|
3027
|
+
}
|
|
3028
|
+
}, keysIn);
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
_baseMerge = baseMerge;
|
|
3032
|
+
return _baseMerge;
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
/**
|
|
3036
|
+
* This method returns the first argument it receives.
|
|
3037
|
+
*
|
|
3038
|
+
* @static
|
|
3039
|
+
* @since 0.1.0
|
|
3040
|
+
* @memberOf _
|
|
3041
|
+
* @category Util
|
|
3042
|
+
* @param {*} value Any value.
|
|
3043
|
+
* @returns {*} Returns `value`.
|
|
3044
|
+
* @example
|
|
3045
|
+
*
|
|
3046
|
+
* var object = { 'a': 1 };
|
|
3047
|
+
*
|
|
3048
|
+
* console.log(_.identity(object) === object);
|
|
3049
|
+
* // => true
|
|
3050
|
+
*/
|
|
3051
|
+
|
|
3052
|
+
var identity_1;
|
|
3053
|
+
var hasRequiredIdentity;
|
|
3054
|
+
|
|
3055
|
+
function requireIdentity () {
|
|
3056
|
+
if (hasRequiredIdentity) return identity_1;
|
|
3057
|
+
hasRequiredIdentity = 1;
|
|
3058
|
+
function identity(value) {
|
|
3059
|
+
return value;
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
identity_1 = identity;
|
|
3063
|
+
return identity_1;
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
/**
|
|
3067
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
3068
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
3069
|
+
*
|
|
3070
|
+
* @private
|
|
3071
|
+
* @param {Function} func The function to invoke.
|
|
3072
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
3073
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
3074
|
+
* @returns {*} Returns the result of `func`.
|
|
3075
|
+
*/
|
|
3076
|
+
|
|
3077
|
+
var _apply;
|
|
3078
|
+
var hasRequired_apply;
|
|
3079
|
+
|
|
3080
|
+
function require_apply () {
|
|
3081
|
+
if (hasRequired_apply) return _apply;
|
|
3082
|
+
hasRequired_apply = 1;
|
|
3083
|
+
function apply(func, thisArg, args) {
|
|
3084
|
+
switch (args.length) {
|
|
3085
|
+
case 0: return func.call(thisArg);
|
|
3086
|
+
case 1: return func.call(thisArg, args[0]);
|
|
3087
|
+
case 2: return func.call(thisArg, args[0], args[1]);
|
|
3088
|
+
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
3089
|
+
}
|
|
3090
|
+
return func.apply(thisArg, args);
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
_apply = apply;
|
|
3094
|
+
return _apply;
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
var _overRest;
|
|
3098
|
+
var hasRequired_overRest;
|
|
3099
|
+
|
|
3100
|
+
function require_overRest () {
|
|
3101
|
+
if (hasRequired_overRest) return _overRest;
|
|
3102
|
+
hasRequired_overRest = 1;
|
|
3103
|
+
var apply = /*@__PURE__*/ require_apply();
|
|
3104
|
+
|
|
3105
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3106
|
+
var nativeMax = Math.max;
|
|
3107
|
+
|
|
3108
|
+
/**
|
|
3109
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
|
3110
|
+
*
|
|
3111
|
+
* @private
|
|
3112
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
3113
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
3114
|
+
* @param {Function} transform The rest array transform.
|
|
3115
|
+
* @returns {Function} Returns the new function.
|
|
3116
|
+
*/
|
|
3117
|
+
function overRest(func, start, transform) {
|
|
3118
|
+
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
3119
|
+
return function() {
|
|
3120
|
+
var args = arguments,
|
|
3121
|
+
index = -1,
|
|
3122
|
+
length = nativeMax(args.length - start, 0),
|
|
3123
|
+
array = Array(length);
|
|
3124
|
+
|
|
3125
|
+
while (++index < length) {
|
|
3126
|
+
array[index] = args[start + index];
|
|
3127
|
+
}
|
|
3128
|
+
index = -1;
|
|
3129
|
+
var otherArgs = Array(start + 1);
|
|
3130
|
+
while (++index < start) {
|
|
3131
|
+
otherArgs[index] = args[index];
|
|
3132
|
+
}
|
|
3133
|
+
otherArgs[start] = transform(array);
|
|
3134
|
+
return apply(func, this, otherArgs);
|
|
3135
|
+
};
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
_overRest = overRest;
|
|
3139
|
+
return _overRest;
|
|
3140
|
+
}
|
|
3141
|
+
|
|
3142
|
+
/**
|
|
3143
|
+
* Creates a function that returns `value`.
|
|
3144
|
+
*
|
|
3145
|
+
* @static
|
|
3146
|
+
* @memberOf _
|
|
3147
|
+
* @since 2.4.0
|
|
3148
|
+
* @category Util
|
|
3149
|
+
* @param {*} value The value to return from the new function.
|
|
3150
|
+
* @returns {Function} Returns the new constant function.
|
|
3151
|
+
* @example
|
|
3152
|
+
*
|
|
3153
|
+
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
3154
|
+
*
|
|
3155
|
+
* console.log(objects);
|
|
3156
|
+
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
3157
|
+
*
|
|
3158
|
+
* console.log(objects[0] === objects[1]);
|
|
3159
|
+
* // => true
|
|
3160
|
+
*/
|
|
3161
|
+
|
|
3162
|
+
var constant_1;
|
|
3163
|
+
var hasRequiredConstant;
|
|
3164
|
+
|
|
3165
|
+
function requireConstant () {
|
|
3166
|
+
if (hasRequiredConstant) return constant_1;
|
|
3167
|
+
hasRequiredConstant = 1;
|
|
3168
|
+
function constant(value) {
|
|
3169
|
+
return function() {
|
|
3170
|
+
return value;
|
|
3171
|
+
};
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
constant_1 = constant;
|
|
3175
|
+
return constant_1;
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
var _baseSetToString;
|
|
3179
|
+
var hasRequired_baseSetToString;
|
|
3180
|
+
|
|
3181
|
+
function require_baseSetToString () {
|
|
3182
|
+
if (hasRequired_baseSetToString) return _baseSetToString;
|
|
3183
|
+
hasRequired_baseSetToString = 1;
|
|
3184
|
+
var constant = /*@__PURE__*/ requireConstant(),
|
|
3185
|
+
defineProperty = /*@__PURE__*/ require_defineProperty(),
|
|
3186
|
+
identity = /*@__PURE__*/ requireIdentity();
|
|
3187
|
+
|
|
3188
|
+
/**
|
|
3189
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
|
3190
|
+
*
|
|
3191
|
+
* @private
|
|
3192
|
+
* @param {Function} func The function to modify.
|
|
3193
|
+
* @param {Function} string The `toString` result.
|
|
3194
|
+
* @returns {Function} Returns `func`.
|
|
3195
|
+
*/
|
|
3196
|
+
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
|
3197
|
+
return defineProperty(func, 'toString', {
|
|
3198
|
+
'configurable': true,
|
|
3199
|
+
'enumerable': false,
|
|
3200
|
+
'value': constant(string),
|
|
3201
|
+
'writable': true
|
|
3202
|
+
});
|
|
3203
|
+
};
|
|
3204
|
+
|
|
3205
|
+
_baseSetToString = baseSetToString;
|
|
3206
|
+
return _baseSetToString;
|
|
3207
|
+
}
|
|
3208
|
+
|
|
3209
|
+
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
3210
|
+
|
|
3211
|
+
var _shortOut;
|
|
3212
|
+
var hasRequired_shortOut;
|
|
3213
|
+
|
|
3214
|
+
function require_shortOut () {
|
|
3215
|
+
if (hasRequired_shortOut) return _shortOut;
|
|
3216
|
+
hasRequired_shortOut = 1;
|
|
3217
|
+
var HOT_COUNT = 800,
|
|
3218
|
+
HOT_SPAN = 16;
|
|
3219
|
+
|
|
3220
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3221
|
+
var nativeNow = Date.now;
|
|
3222
|
+
|
|
3223
|
+
/**
|
|
3224
|
+
* Creates a function that'll short out and invoke `identity` instead
|
|
3225
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
3226
|
+
* milliseconds.
|
|
3227
|
+
*
|
|
3228
|
+
* @private
|
|
3229
|
+
* @param {Function} func The function to restrict.
|
|
3230
|
+
* @returns {Function} Returns the new shortable function.
|
|
3231
|
+
*/
|
|
3232
|
+
function shortOut(func) {
|
|
3233
|
+
var count = 0,
|
|
3234
|
+
lastCalled = 0;
|
|
3235
|
+
|
|
3236
|
+
return function() {
|
|
3237
|
+
var stamp = nativeNow(),
|
|
3238
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
3239
|
+
|
|
3240
|
+
lastCalled = stamp;
|
|
3241
|
+
if (remaining > 0) {
|
|
3242
|
+
if (++count >= HOT_COUNT) {
|
|
3243
|
+
return arguments[0];
|
|
3244
|
+
}
|
|
3245
|
+
} else {
|
|
3246
|
+
count = 0;
|
|
3247
|
+
}
|
|
3248
|
+
return func.apply(undefined, arguments);
|
|
3249
|
+
};
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
_shortOut = shortOut;
|
|
3253
|
+
return _shortOut;
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3256
|
+
var _setToString;
|
|
3257
|
+
var hasRequired_setToString;
|
|
3258
|
+
|
|
3259
|
+
function require_setToString () {
|
|
3260
|
+
if (hasRequired_setToString) return _setToString;
|
|
3261
|
+
hasRequired_setToString = 1;
|
|
3262
|
+
var baseSetToString = /*@__PURE__*/ require_baseSetToString(),
|
|
3263
|
+
shortOut = /*@__PURE__*/ require_shortOut();
|
|
3264
|
+
|
|
3265
|
+
/**
|
|
3266
|
+
* Sets the `toString` method of `func` to return `string`.
|
|
3267
|
+
*
|
|
3268
|
+
* @private
|
|
3269
|
+
* @param {Function} func The function to modify.
|
|
3270
|
+
* @param {Function} string The `toString` result.
|
|
3271
|
+
* @returns {Function} Returns `func`.
|
|
3272
|
+
*/
|
|
3273
|
+
var setToString = shortOut(baseSetToString);
|
|
3274
|
+
|
|
3275
|
+
_setToString = setToString;
|
|
3276
|
+
return _setToString;
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3279
|
+
var _baseRest;
|
|
3280
|
+
var hasRequired_baseRest;
|
|
3281
|
+
|
|
3282
|
+
function require_baseRest () {
|
|
3283
|
+
if (hasRequired_baseRest) return _baseRest;
|
|
3284
|
+
hasRequired_baseRest = 1;
|
|
3285
|
+
var identity = /*@__PURE__*/ requireIdentity(),
|
|
3286
|
+
overRest = /*@__PURE__*/ require_overRest(),
|
|
3287
|
+
setToString = /*@__PURE__*/ require_setToString();
|
|
3288
|
+
|
|
3289
|
+
/**
|
|
3290
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
3291
|
+
*
|
|
3292
|
+
* @private
|
|
3293
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
3294
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
3295
|
+
* @returns {Function} Returns the new function.
|
|
3296
|
+
*/
|
|
3297
|
+
function baseRest(func, start) {
|
|
3298
|
+
return setToString(overRest(func, start, identity), func + '');
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
_baseRest = baseRest;
|
|
3302
|
+
return _baseRest;
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
var _isIterateeCall;
|
|
3306
|
+
var hasRequired_isIterateeCall;
|
|
3307
|
+
|
|
3308
|
+
function require_isIterateeCall () {
|
|
3309
|
+
if (hasRequired_isIterateeCall) return _isIterateeCall;
|
|
3310
|
+
hasRequired_isIterateeCall = 1;
|
|
3311
|
+
var eq = /*@__PURE__*/ requireEq(),
|
|
3312
|
+
isArrayLike = /*@__PURE__*/ requireIsArrayLike(),
|
|
3313
|
+
isIndex = /*@__PURE__*/ require_isIndex(),
|
|
3314
|
+
isObject = /*@__PURE__*/ requireIsObject();
|
|
3315
|
+
|
|
3316
|
+
/**
|
|
3317
|
+
* Checks if the given arguments are from an iteratee call.
|
|
3318
|
+
*
|
|
3319
|
+
* @private
|
|
3320
|
+
* @param {*} value The potential iteratee value argument.
|
|
3321
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
3322
|
+
* @param {*} object The potential iteratee object argument.
|
|
3323
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
3324
|
+
* else `false`.
|
|
3325
|
+
*/
|
|
3326
|
+
function isIterateeCall(value, index, object) {
|
|
3327
|
+
if (!isObject(object)) {
|
|
3328
|
+
return false;
|
|
3329
|
+
}
|
|
3330
|
+
var type = typeof index;
|
|
3331
|
+
if (type == 'number'
|
|
3332
|
+
? (isArrayLike(object) && isIndex(index, object.length))
|
|
3333
|
+
: (type == 'string' && index in object)
|
|
3334
|
+
) {
|
|
3335
|
+
return eq(object[index], value);
|
|
3336
|
+
}
|
|
3337
|
+
return false;
|
|
3338
|
+
}
|
|
3339
|
+
|
|
3340
|
+
_isIterateeCall = isIterateeCall;
|
|
3341
|
+
return _isIterateeCall;
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
var _createAssigner;
|
|
3345
|
+
var hasRequired_createAssigner;
|
|
3346
|
+
|
|
3347
|
+
function require_createAssigner () {
|
|
3348
|
+
if (hasRequired_createAssigner) return _createAssigner;
|
|
3349
|
+
hasRequired_createAssigner = 1;
|
|
3350
|
+
var baseRest = /*@__PURE__*/ require_baseRest(),
|
|
3351
|
+
isIterateeCall = /*@__PURE__*/ require_isIterateeCall();
|
|
3352
|
+
|
|
3353
|
+
/**
|
|
3354
|
+
* Creates a function like `_.assign`.
|
|
3355
|
+
*
|
|
3356
|
+
* @private
|
|
3357
|
+
* @param {Function} assigner The function to assign values.
|
|
3358
|
+
* @returns {Function} Returns the new assigner function.
|
|
3359
|
+
*/
|
|
3360
|
+
function createAssigner(assigner) {
|
|
3361
|
+
return baseRest(function(object, sources) {
|
|
3362
|
+
var index = -1,
|
|
3363
|
+
length = sources.length,
|
|
3364
|
+
customizer = length > 1 ? sources[length - 1] : undefined,
|
|
3365
|
+
guard = length > 2 ? sources[2] : undefined;
|
|
3366
|
+
|
|
3367
|
+
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
|
3368
|
+
? (length--, customizer)
|
|
3369
|
+
: undefined;
|
|
3370
|
+
|
|
3371
|
+
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
3372
|
+
customizer = length < 3 ? undefined : customizer;
|
|
3373
|
+
length = 1;
|
|
3374
|
+
}
|
|
3375
|
+
object = Object(object);
|
|
3376
|
+
while (++index < length) {
|
|
3377
|
+
var source = sources[index];
|
|
3378
|
+
if (source) {
|
|
3379
|
+
assigner(object, source, index, customizer);
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
return object;
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
_createAssigner = createAssigner;
|
|
3387
|
+
return _createAssigner;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
var merge_1;
|
|
3391
|
+
var hasRequiredMerge;
|
|
3392
|
+
|
|
3393
|
+
function requireMerge () {
|
|
3394
|
+
if (hasRequiredMerge) return merge_1;
|
|
3395
|
+
hasRequiredMerge = 1;
|
|
3396
|
+
var baseMerge = /*@__PURE__*/ require_baseMerge(),
|
|
3397
|
+
createAssigner = /*@__PURE__*/ require_createAssigner();
|
|
3398
|
+
|
|
3399
|
+
/**
|
|
3400
|
+
* This method is like `_.assign` except that it recursively merges own and
|
|
3401
|
+
* inherited enumerable string keyed properties of source objects into the
|
|
3402
|
+
* destination object. Source properties that resolve to `undefined` are
|
|
3403
|
+
* skipped if a destination value exists. Array and plain object properties
|
|
3404
|
+
* are merged recursively. Other objects and value types are overridden by
|
|
3405
|
+
* assignment. Source objects are applied from left to right. Subsequent
|
|
3406
|
+
* sources overwrite property assignments of previous sources.
|
|
3407
|
+
*
|
|
3408
|
+
* **Note:** This method mutates `object`.
|
|
3409
|
+
*
|
|
3410
|
+
* @static
|
|
3411
|
+
* @memberOf _
|
|
3412
|
+
* @since 0.5.0
|
|
3413
|
+
* @category Object
|
|
3414
|
+
* @param {Object} object The destination object.
|
|
3415
|
+
* @param {...Object} [sources] The source objects.
|
|
3416
|
+
* @returns {Object} Returns `object`.
|
|
3417
|
+
* @example
|
|
3418
|
+
*
|
|
3419
|
+
* var object = {
|
|
3420
|
+
* 'a': [{ 'b': 2 }, { 'd': 4 }]
|
|
3421
|
+
* };
|
|
3422
|
+
*
|
|
3423
|
+
* var other = {
|
|
3424
|
+
* 'a': [{ 'c': 3 }, { 'e': 5 }]
|
|
3425
|
+
* };
|
|
3426
|
+
*
|
|
3427
|
+
* _.merge(object, other);
|
|
3428
|
+
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
|
|
3429
|
+
*/
|
|
3430
|
+
var merge = createAssigner(function(object, source, srcIndex) {
|
|
3431
|
+
baseMerge(object, source, srcIndex);
|
|
3432
|
+
});
|
|
3433
|
+
|
|
3434
|
+
merge_1 = merge;
|
|
3435
|
+
return merge_1;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
var mergeExports = /*@__PURE__*/ requireMerge();
|
|
3439
|
+
var merge = /*@__PURE__*/getDefaultExportFromCjs(mergeExports);
|
|
3440
|
+
|
|
3441
|
+
class Compose {
|
|
3442
|
+
constructor() { }
|
|
3443
|
+
isJSONFilePath(filePath) {
|
|
3444
|
+
return filePath.endsWith('.json') || filePath.endsWith('.json.template');
|
|
3445
|
+
}
|
|
3446
|
+
isTemplateFilePath(filePath) {
|
|
3447
|
+
return filePath.endsWith('.template');
|
|
3448
|
+
}
|
|
3449
|
+
getRealTemplateFilePath(filePath) {
|
|
3450
|
+
return filePath.replace('.template', '');
|
|
3451
|
+
}
|
|
3452
|
+
readFile(filePath) {
|
|
3453
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
3454
|
+
}
|
|
3455
|
+
readJSONFile(filePath) {
|
|
3456
|
+
return JSON.parse(this.readFile(filePath));
|
|
3457
|
+
}
|
|
3458
|
+
writeFile(filePath, content) {
|
|
3459
|
+
fs.writeFileSync(this.getRealTemplateFilePath(filePath), content, {
|
|
3460
|
+
encoding: 'utf-8'
|
|
3461
|
+
});
|
|
3462
|
+
}
|
|
3463
|
+
replaceFile(targetFilePath, context) {
|
|
3464
|
+
let targetFileContent = this.readFile(targetFilePath);
|
|
3465
|
+
Object.keys(context).forEach((key) => {
|
|
3466
|
+
const value = context[key];
|
|
3467
|
+
targetFileContent = targetFileContent.replace(new RegExp(`\\[TPL:${key}\\]`, 'g'), typeof value === 'string' ? value : JSON.stringify(value));
|
|
3468
|
+
});
|
|
3469
|
+
return targetFileContent;
|
|
3470
|
+
}
|
|
3471
|
+
mergeJSONFile(targetJSONFilePath, sourceJSONContent) {
|
|
3472
|
+
const targetFileContent = this.readJSONFile(targetJSONFilePath);
|
|
3473
|
+
const composedFileContent = merge(sourceJSONContent, targetFileContent);
|
|
3474
|
+
this.writeFile(targetJSONFilePath, JSON.stringify(composedFileContent, null, 2));
|
|
3475
|
+
}
|
|
3476
|
+
composeConfigFile(context, sourceFilePath, targetFilePath) {
|
|
3477
|
+
// If the source and target are both same files, we need to merge them
|
|
3478
|
+
if (this.isTemplateFilePath(sourceFilePath)) {
|
|
3479
|
+
const fileContent = this.replaceFile(sourceFilePath, context);
|
|
3480
|
+
// if target file existed, merged!, only json!!
|
|
3481
|
+
if (this.isJSONFilePath(sourceFilePath) &&
|
|
3482
|
+
this.isJSONFilePath(targetFilePath)) {
|
|
3483
|
+
const realTargetFilePath = this.getRealTemplateFilePath(targetFilePath);
|
|
3484
|
+
if (fs.existsSync(realTargetFilePath)) {
|
|
3485
|
+
this.mergeJSONFile(realTargetFilePath, JSON.parse(fileContent));
|
|
3486
|
+
return true;
|
|
3487
|
+
}
|
|
3488
|
+
this.writeFile(realTargetFilePath, fileContent);
|
|
3489
|
+
return true;
|
|
3490
|
+
}
|
|
3491
|
+
this.writeFile(targetFilePath, fileContent);
|
|
3492
|
+
return true;
|
|
3493
|
+
}
|
|
3494
|
+
return false;
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
const packages = ['pack-app'];
|
|
3499
|
+
class Generator {
|
|
3500
|
+
ora;
|
|
3501
|
+
context;
|
|
3502
|
+
subPackages;
|
|
3503
|
+
copyer;
|
|
3504
|
+
compose;
|
|
3505
|
+
constructor(context) {
|
|
3506
|
+
const templatePath = context.options?.templateRootPath;
|
|
3507
|
+
if (!templatePath) {
|
|
3508
|
+
throw new Error('template path not exit');
|
|
3509
|
+
}
|
|
3510
|
+
// if template path not exit
|
|
3511
|
+
if (!fs.existsSync(templatePath)) {
|
|
3512
|
+
throw new Error('template path not exit');
|
|
3513
|
+
}
|
|
3514
|
+
this.ora = ora.oraPromise;
|
|
3515
|
+
this.context = new scriptsContext.FeScriptContext(context);
|
|
3516
|
+
// this.prompts = context.options?.prompts || defaultPrompts;
|
|
3517
|
+
this.subPackages = ['node-lib', 'react-app'];
|
|
3518
|
+
// use _common as ignore target path
|
|
3519
|
+
this.copyer = new Copyer(path.join(this.context.options.configsRootPath, '_common'));
|
|
3520
|
+
this.compose = new Compose();
|
|
3521
|
+
}
|
|
3522
|
+
get logger() {
|
|
3523
|
+
return this.context.logger;
|
|
3524
|
+
}
|
|
3525
|
+
async steps(prompts) {
|
|
3526
|
+
try {
|
|
3527
|
+
const answers = await inquirer.prompt(prompts);
|
|
3528
|
+
return answers;
|
|
3529
|
+
}
|
|
3530
|
+
catch (error) {
|
|
3531
|
+
this.logger.error(error);
|
|
3532
|
+
throw error;
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
async action({ label, task }) {
|
|
3536
|
+
let awaitTask = task();
|
|
3537
|
+
// check run returan a promise
|
|
3538
|
+
if (!(awaitTask instanceof Promise)) {
|
|
3539
|
+
awaitTask = Promise.resolve(awaitTask);
|
|
3540
|
+
}
|
|
3541
|
+
const text = label;
|
|
3542
|
+
this.ora(awaitTask, text);
|
|
3543
|
+
return awaitTask;
|
|
3544
|
+
}
|
|
3545
|
+
isPackageTemplate(template) {
|
|
3546
|
+
return packages.includes(template);
|
|
3547
|
+
}
|
|
3548
|
+
async getGeneratorContext() {
|
|
3549
|
+
// const { templateRootPath } = this.context.options;
|
|
3550
|
+
// get all templates
|
|
3551
|
+
const prompts = createDefaultPrompts(this.subPackages, packages);
|
|
3552
|
+
const context = await this.steps(prompts);
|
|
3553
|
+
// if package template, we need to add chooise sub packages type
|
|
3554
|
+
if (this.isPackageTemplate(context.template)) {
|
|
3555
|
+
const prompts = createPackagePrompts(this.subPackages);
|
|
3556
|
+
const choseSubPackages = await this.steps(prompts);
|
|
3557
|
+
Object.assign(context, choseSubPackages);
|
|
3558
|
+
}
|
|
3559
|
+
// generate target path
|
|
3560
|
+
context.targetPath = path.join(process.cwd(), context.projectName);
|
|
3561
|
+
// generate release path
|
|
3562
|
+
context.releasePath = context.releasePath || 'src';
|
|
3563
|
+
return context;
|
|
3564
|
+
}
|
|
3565
|
+
async generate() {
|
|
3566
|
+
const context = await this.getGeneratorContext();
|
|
3567
|
+
this.logger.debug('context is:', context, this.context.options.templateRootPath);
|
|
3568
|
+
// if subPackages is not empty, copy sub packages
|
|
3569
|
+
if (context.subPackages) {
|
|
3570
|
+
await this.action({
|
|
3571
|
+
label: 'Generate Directories(subPackages)',
|
|
3572
|
+
task: async () => {
|
|
3573
|
+
await this.generateTemplateDir(context);
|
|
3574
|
+
await this.generateSubPackages(context);
|
|
3575
|
+
await this.generateConfigs(context, context.targetPath, '_common');
|
|
3576
|
+
}
|
|
3577
|
+
});
|
|
3578
|
+
return;
|
|
3579
|
+
}
|
|
3580
|
+
await this.action({
|
|
3581
|
+
label: 'Generate Directory',
|
|
3582
|
+
task: async () => {
|
|
3583
|
+
await this.generateTemplateDir(context);
|
|
3584
|
+
await this.generateConfigs(context, context.targetPath, '_common');
|
|
3585
|
+
await this.generateConfigs(context, context.targetPath, context.template);
|
|
3586
|
+
}
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
async generateConfigs(context, targetPath, configName) {
|
|
3590
|
+
const copyCallback = (sourceFilePath, targetFilePath) => {
|
|
3591
|
+
this.logger.debug('copyCallback', sourceFilePath, targetFilePath);
|
|
3592
|
+
return this.compose.composeConfigFile(context, sourceFilePath, targetFilePath);
|
|
3593
|
+
};
|
|
3594
|
+
const { configsRootPath, config } = this.context.options;
|
|
3595
|
+
if (!config) {
|
|
3596
|
+
this.logger.debug('no copy config files');
|
|
3597
|
+
return;
|
|
3598
|
+
}
|
|
3599
|
+
await this.copyer.copyPaths({
|
|
3600
|
+
sourcePath: path.join(configsRootPath, configName),
|
|
3601
|
+
targetPath,
|
|
3602
|
+
copyCallback
|
|
3603
|
+
});
|
|
3604
|
+
}
|
|
3605
|
+
generateTemplateDir(context) {
|
|
3606
|
+
return this.copyer.copyPaths({
|
|
3607
|
+
sourcePath: path.join(this.context.options.templateRootPath, context.template),
|
|
3608
|
+
targetPath: context.targetPath
|
|
3609
|
+
});
|
|
3610
|
+
}
|
|
3611
|
+
async generateSubPackages(context) {
|
|
3612
|
+
// if pack template, copy sub packages
|
|
3613
|
+
const { packagesNames = 'packages', subPackages = [], targetPath = '' } = context;
|
|
3614
|
+
const { templateRootPath } = this.context.options;
|
|
3615
|
+
for (const subPackage of subPackages) {
|
|
3616
|
+
const sourePath = path.join(templateRootPath, subPackage);
|
|
3617
|
+
const packagesPath = path.join(targetPath, packagesNames, subPackage);
|
|
3618
|
+
this.logger.debug('copy sub package', sourePath, packagesPath);
|
|
3619
|
+
await this.copyer.copyPaths({
|
|
3620
|
+
sourcePath: sourePath,
|
|
3621
|
+
targetPath: packagesPath
|
|
3622
|
+
});
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
|
|
3627
|
+
exports.Copyer = Copyer;
|
|
3628
|
+
exports.Generator = Generator;
|
|
3629
|
+
exports.createDefaultPrompts = createDefaultPrompts;
|
|
3630
|
+
exports.createPackagePrompts = createPackagePrompts;
|
|
3631
|
+
exports.validRequiredString = validRequiredString;
|