foreslash 0.2.4 → 0.3.0
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 +17 -1
- package/LICENSE +1 -1
- package/lib/index.cmn.cjs +244 -9
- package/lib/index.d.ts +173 -3
- package/lib/index.mjs +239 -10
- package/lib/index.umd.js +2094 -1859
- package/package.json +5 -5
package/lib/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Copyright (c) 2024 moushu
|
|
2
|
+
Copyright (c) 2024-2025 moushu
|
|
3
3
|
foreslash is licensed under Mulan PSL v2.
|
|
4
4
|
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
5
5
|
You may obtain a copy of Mulan PSL v2 at:
|
|
@@ -10,1870 +10,2105 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
|
10
10
|
See the Mulan PSL v2 for more details.
|
|
11
11
|
*/
|
|
12
12
|
(function (global, factory) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
14
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
15
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.foreslash = {}));
|
|
16
16
|
})(this, (function (exports) { 'use strict';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
18
|
+
function range(start, end, stepOrOptions) {
|
|
19
|
+
if (!isFinite(start))
|
|
20
|
+
throw new Error('start must be finite');
|
|
21
|
+
if (end == null)
|
|
22
|
+
return range(0, start);
|
|
23
|
+
if (!isFinite(end))
|
|
24
|
+
throw new Error('end must be finite');
|
|
25
|
+
let step = 1;
|
|
26
|
+
let getter = null;
|
|
27
|
+
if (typeof stepOrOptions === 'number') {
|
|
28
|
+
step = stepOrOptions;
|
|
29
|
+
}
|
|
30
|
+
else if (stepOrOptions) {
|
|
31
|
+
const { step: _step } = stepOrOptions;
|
|
32
|
+
if (_step)
|
|
33
|
+
step = _step;
|
|
34
|
+
if ('value' in stepOrOptions)
|
|
35
|
+
getter = () => stepOrOptions.value;
|
|
36
|
+
else if ('getter' in stepOrOptions)
|
|
37
|
+
getter = stepOrOptions.getter;
|
|
38
|
+
}
|
|
39
|
+
if (!isFinite(step))
|
|
40
|
+
throw new Error('step must be finite');
|
|
41
|
+
if (step === 0)
|
|
42
|
+
throw new Error('step must not be 0');
|
|
43
|
+
if ((start > end && step > 0) || (start < end && step < 0))
|
|
44
|
+
step = -step;
|
|
45
|
+
const res = [];
|
|
46
|
+
for (let i = start; step > 0 ? i <= end : i >= end; i += step) {
|
|
47
|
+
res.push(getter ? getter(i, res) : i);
|
|
48
|
+
if (step > 0 ? i + step > end : i + step < end)
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
return res;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function remove(arr, ...item) {
|
|
55
|
+
const removeSet = new Set();
|
|
56
|
+
const judgerList = [];
|
|
57
|
+
for (let i = 0; i < item.length; i++) {
|
|
58
|
+
const cond = item[i];
|
|
59
|
+
if (typeof cond === 'function')
|
|
60
|
+
judgerList.push(cond);
|
|
61
|
+
else
|
|
62
|
+
removeSet.add(cond);
|
|
63
|
+
}
|
|
64
|
+
const res = [];
|
|
65
|
+
for (let i = 0; i < arr.length; i++) {
|
|
66
|
+
const el = arr[i];
|
|
67
|
+
if (removeSet.has(el) || judgerList.some((judger) => judger(el)))
|
|
68
|
+
continue;
|
|
69
|
+
res.push(el);
|
|
70
|
+
}
|
|
71
|
+
return res;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/******************************************************************************
|
|
75
|
+
Copyright (c) Microsoft Corporation.
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
78
|
+
purpose with or without fee is hereby granted.
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
81
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
82
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
83
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
84
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
85
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
86
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
87
|
+
***************************************************************************** */
|
|
88
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
92
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
93
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
94
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
95
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
96
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
97
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
101
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
102
|
+
var e = new Error(message);
|
|
103
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const isArray = Array.isArray;
|
|
107
|
+
|
|
108
|
+
const object2String = Object.prototype.toString;
|
|
109
|
+
function getTag(value) {
|
|
110
|
+
return object2String.call(value).slice(8, -1);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function getGlobalThis() {
|
|
114
|
+
if (typeof self !== 'undefined')
|
|
115
|
+
return self;
|
|
116
|
+
if (typeof window !== 'undefined')
|
|
117
|
+
return window;
|
|
118
|
+
if (typeof global !== 'undefined')
|
|
119
|
+
return global;
|
|
120
|
+
return Function('return this')();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const global$8 = getGlobalThis();
|
|
124
|
+
const ArrayBuffer$1 = global$8.ArrayBuffer;
|
|
125
|
+
function isArrayBuffer(val) {
|
|
126
|
+
return !!ArrayBuffer$1 && val instanceof ArrayBuffer$1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function isInteger(value) {
|
|
130
|
+
return typeof value === 'number' && isFinite(value) && value % 1 === 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function isArrayLike(value) {
|
|
134
|
+
return value != null && typeof value !== 'function' && isInteger(value.length) && value.length >= 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function isBigInt(value) {
|
|
138
|
+
return typeof value === 'bigint';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function isObject(value) {
|
|
142
|
+
return typeof value === 'object' && value !== null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const global$7 = getGlobalThis();
|
|
146
|
+
const Blob = global$7.Blob;
|
|
147
|
+
function isBlob(value) {
|
|
148
|
+
return !!Blob && isObject(value) && getTag(value) === 'Blob';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function isBoolean(value) {
|
|
152
|
+
return typeof value === 'boolean';
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const global$6 = getGlobalThis();
|
|
156
|
+
const Buffer = global$6.Buffer;
|
|
157
|
+
const isBuffer = (Buffer && Buffer.isBuffer) || (() => false);
|
|
158
|
+
|
|
159
|
+
function isDataView(value) {
|
|
160
|
+
return isObject(value) && getTag(value) === 'DataView';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function isDate(value) {
|
|
164
|
+
return isObject(value) && getTag(value) === 'Date';
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const global$5 = getGlobalThis();
|
|
168
|
+
const File$1 = global$5.File;
|
|
169
|
+
function isFile(value) {
|
|
170
|
+
return !!File$1 && isObject(value) && getTag(value) === 'File';
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const global$4 = getGlobalThis();
|
|
174
|
+
const FormData$1 = global$4.FormData;
|
|
175
|
+
function isFormData(value) {
|
|
176
|
+
return !!FormData$1 && value instanceof FormData$1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function isFunction(value) {
|
|
180
|
+
return typeof value === 'function';
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function isNil(value) {
|
|
184
|
+
return value === null || value === void 0;
|
|
185
|
+
}
|
|
186
|
+
function isNull(value) {
|
|
187
|
+
return value === null;
|
|
188
|
+
}
|
|
189
|
+
function isUndefined(value) {
|
|
190
|
+
return value === void 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function isIterable(value) {
|
|
194
|
+
return !isNil(value) && typeof value[Symbol.iterator] === 'function';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const global$3 = getGlobalThis();
|
|
198
|
+
function isMap(value) {
|
|
199
|
+
return !!global$3.Map && value instanceof Map;
|
|
200
|
+
}
|
|
201
|
+
function isWeakMap(value) {
|
|
202
|
+
return !!global$3.WeakMap && value instanceof WeakMap;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function isNumber(value) {
|
|
206
|
+
return typeof value === 'number';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function isPrimitive(value) {
|
|
210
|
+
return value === undefined || value === null || (typeof value !== 'object' && typeof value !== 'function');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function isPromise(value) {
|
|
214
|
+
return isObject(value) && isFunction(value.then) && getTag(value) === 'Promise';
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function isPromiseLike(value) {
|
|
218
|
+
return isObject(value) && isFunction(value.then);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function isRegExp(value) {
|
|
222
|
+
return isObject(value) && getTag(value) === 'RegExp';
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const global$2 = getGlobalThis();
|
|
226
|
+
function isSet(value) {
|
|
227
|
+
return !!global$2.Set && value instanceof Set;
|
|
228
|
+
}
|
|
229
|
+
function isWeakSet(value) {
|
|
230
|
+
return !!global$2.WeakSet && value instanceof WeakSet;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function isString(value) {
|
|
234
|
+
return typeof value === 'string';
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function isSymbol(value) {
|
|
238
|
+
return typeof value === 'symbol';
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const allTypedArrayTags = new Set([
|
|
242
|
+
'Int8Array',
|
|
243
|
+
'Int16Array',
|
|
244
|
+
'Int32Array',
|
|
245
|
+
'Uint8Array',
|
|
246
|
+
'Uint8ClampedArray',
|
|
247
|
+
'Uint16Array',
|
|
248
|
+
'Uint32Array',
|
|
249
|
+
'Float32Array',
|
|
250
|
+
'Float64Array',
|
|
251
|
+
'BigInt64Array',
|
|
252
|
+
'BigUint64Array',
|
|
253
|
+
]);
|
|
254
|
+
function isTypedArray(value) {
|
|
255
|
+
return isObject(value) && allTypedArrayTags.has(getTag(value));
|
|
256
|
+
}
|
|
257
|
+
function isInt8Array(value) {
|
|
258
|
+
return isObject(value) && getTag(value) === 'Int8Array';
|
|
259
|
+
}
|
|
260
|
+
function isInt16Array(value) {
|
|
261
|
+
return isObject(value) && getTag(value) === 'Int16Array';
|
|
262
|
+
}
|
|
263
|
+
function isInt32Array(value) {
|
|
264
|
+
return isObject(value) && getTag(value) === 'Int32Array';
|
|
265
|
+
}
|
|
266
|
+
function isUint8Array(value) {
|
|
267
|
+
return isObject(value) && getTag(value) === 'Uint8Array';
|
|
268
|
+
}
|
|
269
|
+
function isUint8ClampedArray(value) {
|
|
270
|
+
return isObject(value) && getTag(value) === 'Uint8ClampedArray';
|
|
271
|
+
}
|
|
272
|
+
function isUint16Array(value) {
|
|
273
|
+
return isObject(value) && getTag(value) === 'Uint16Array';
|
|
274
|
+
}
|
|
275
|
+
function isUint32Array(value) {
|
|
276
|
+
return isObject(value) && getTag(value) === 'Uint32Array';
|
|
277
|
+
}
|
|
278
|
+
function isFloat32Array(value) {
|
|
279
|
+
return isObject(value) && getTag(value) === 'Float32Array';
|
|
280
|
+
}
|
|
281
|
+
function isFloat64Array(value) {
|
|
282
|
+
return isObject(value) && getTag(value) === 'Float64Array';
|
|
283
|
+
}
|
|
284
|
+
function isBigInt64Array(value) {
|
|
285
|
+
return isObject(value) && getTag(value) === 'BigInt64Array';
|
|
286
|
+
}
|
|
287
|
+
function isBigUint64Array(value) {
|
|
288
|
+
return isObject(value) && getTag(value) === 'BigUint64Array';
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const global$1 = getGlobalThis();
|
|
292
|
+
function isWrapperObject(value) {
|
|
293
|
+
return (!!value &&
|
|
294
|
+
typeof value === 'object' &&
|
|
295
|
+
(isWrapperNumber(value) ||
|
|
296
|
+
isWrapperBoolean(value) ||
|
|
297
|
+
isWrapperString(value) ||
|
|
298
|
+
isWrapperSymbol(value) ||
|
|
299
|
+
isWrapperBigInt(value)));
|
|
300
|
+
}
|
|
301
|
+
function isWrapperNumber(value) {
|
|
302
|
+
return value instanceof Number;
|
|
303
|
+
}
|
|
304
|
+
function isWrapperBoolean(value) {
|
|
305
|
+
return value instanceof Boolean;
|
|
306
|
+
}
|
|
307
|
+
function isWrapperString(value) {
|
|
308
|
+
return value instanceof String;
|
|
309
|
+
}
|
|
310
|
+
function isWrapperSymbol(value) {
|
|
311
|
+
return !!global$1.Symbol && value instanceof Symbol;
|
|
312
|
+
}
|
|
313
|
+
function isWrapperBigInt(value) {
|
|
314
|
+
return !!global$1.BigInt && value instanceof BigInt;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function tryit(fn) {
|
|
318
|
+
return function tryitConvert(...args) {
|
|
319
|
+
try {
|
|
320
|
+
const res = fn.apply(this, args);
|
|
321
|
+
return isPromise(res)
|
|
322
|
+
? res.then((val) => [undefined, val], (err) => [err, undefined])
|
|
323
|
+
: [undefined, res];
|
|
324
|
+
}
|
|
325
|
+
catch (err) {
|
|
326
|
+
return [err, undefined];
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function defer(asyncFunction, options) {
|
|
332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
+
const queue = [];
|
|
334
|
+
const { rethrow = false } = options || {};
|
|
335
|
+
const defaultOption = { rethrow };
|
|
336
|
+
const cleanUp = (fn, options) => {
|
|
337
|
+
queue.push({ fn, opt: Object.assign(defaultOption, options) });
|
|
338
|
+
return queue.length - 1;
|
|
339
|
+
};
|
|
340
|
+
const cancelCleanUp = (fnOrIndex) => {
|
|
341
|
+
if (isInteger(fnOrIndex) && fnOrIndex > -1)
|
|
342
|
+
queue[fnOrIndex] = null;
|
|
343
|
+
else if (isFunction(fnOrIndex)) {
|
|
344
|
+
const i = queue.findIndex((item) => item && item.fn === fnOrIndex);
|
|
345
|
+
if (i > -1)
|
|
346
|
+
queue[i] = null;
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
const [err, res] = yield tryit(asyncFunction)(cleanUp, cancelCleanUp);
|
|
350
|
+
for (const item of queue) {
|
|
351
|
+
if (!item)
|
|
352
|
+
continue;
|
|
353
|
+
const { fn, opt } = item;
|
|
354
|
+
const [cleanUpErr] = yield tryit(fn)(err);
|
|
355
|
+
if (cleanUpErr && opt.rethrow)
|
|
356
|
+
throw cleanUpErr;
|
|
357
|
+
}
|
|
358
|
+
if (err)
|
|
359
|
+
throw err;
|
|
360
|
+
return res;
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function clamp(num, min, max, options) {
|
|
365
|
+
var _a, _b;
|
|
366
|
+
if (isNaN(min))
|
|
367
|
+
throw new Error('Invalid min parameter');
|
|
368
|
+
if (isNaN(max))
|
|
369
|
+
throw new Error('Invalid max parameter');
|
|
370
|
+
if (max < min) {
|
|
371
|
+
[min, max] = [max, min];
|
|
372
|
+
}
|
|
373
|
+
const { default: def, defaultMin: _dMin, defaultMax: _dMax } = options || {};
|
|
374
|
+
const defaultMin = (_a = _dMin !== null && _dMin !== void 0 ? _dMin : def) !== null && _a !== void 0 ? _a : min;
|
|
375
|
+
const defaultMax = (_b = _dMax !== null && _dMax !== void 0 ? _dMax : def) !== null && _b !== void 0 ? _b : max;
|
|
376
|
+
if (isNaN(num))
|
|
377
|
+
return defaultMin;
|
|
378
|
+
return num < min ? defaultMin : num > max ? defaultMax : num;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function parallel(args, fn, options) {
|
|
382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
383
|
+
if (!args.length)
|
|
384
|
+
return [];
|
|
385
|
+
const { limit: _limit = 5 } = options || {};
|
|
386
|
+
const limit = clamp(Math.floor(_limit), 1, 100);
|
|
387
|
+
let current = 0;
|
|
388
|
+
const results = [];
|
|
389
|
+
const errors = [];
|
|
390
|
+
const asyncFn = tryit(fn);
|
|
391
|
+
const processor = () => __awaiter(this, void 0, void 0, function* () {
|
|
392
|
+
while (current < args.length) {
|
|
393
|
+
const index = current++;
|
|
394
|
+
const [err, result] = yield asyncFn(args[index]);
|
|
395
|
+
if (err)
|
|
396
|
+
errors.push({ index, error: err });
|
|
397
|
+
else
|
|
398
|
+
results[index] = result;
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
const tasks = [];
|
|
402
|
+
for (let i = 0; i < Math.min(args.length, limit); i++) {
|
|
403
|
+
tasks.push(processor());
|
|
404
|
+
}
|
|
405
|
+
yield Promise.all(tasks);
|
|
406
|
+
if (errors.length) {
|
|
407
|
+
throw new Error(`Parallel execution failed on index: ${errors.map((e) => e.index).join(', ')}`, { cause: errors });
|
|
408
|
+
}
|
|
409
|
+
return results;
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function sleep(time = 1000) {
|
|
414
|
+
return new Promise((res) => {
|
|
415
|
+
setTimeout(res, time);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function retry(asyncFunction, option) {
|
|
420
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
421
|
+
let retryCounts = 0;
|
|
422
|
+
const times = isNumber(option === null || option === void 0 ? void 0 : option.times) ? option.times : 3;
|
|
423
|
+
const delay = isFunction(option === null || option === void 0 ? void 0 : option.delay)
|
|
424
|
+
? option.delay
|
|
425
|
+
: isNumber(option === null || option === void 0 ? void 0 : option.delay)
|
|
426
|
+
? () => option.delay
|
|
427
|
+
: null;
|
|
428
|
+
const gap = isFunction(option === null || option === void 0 ? void 0 : option.gap) ? option.gap : isNumber(option === null || option === void 0 ? void 0 : option.gap) ? () => option.gap : null;
|
|
429
|
+
let lastRunTime = 0;
|
|
430
|
+
const getDelayTime = !option || (!delay && !gap)
|
|
431
|
+
? () => 0
|
|
432
|
+
: gap
|
|
433
|
+
? (retryCounts) => {
|
|
434
|
+
const time = gap(retryCounts);
|
|
435
|
+
return time - Date.now() + lastRunTime;
|
|
436
|
+
}
|
|
437
|
+
: delay;
|
|
438
|
+
while (1) {
|
|
439
|
+
lastRunTime = Date.now();
|
|
440
|
+
const [err, res] = yield tryit(asyncFunction)((err) => {
|
|
441
|
+
throw { $$exit_retry: err };
|
|
442
|
+
});
|
|
443
|
+
if (!err)
|
|
444
|
+
return res;
|
|
445
|
+
retryCounts++;
|
|
446
|
+
if (err && err.$$exit_retry)
|
|
447
|
+
throw err.$$exit_retry;
|
|
448
|
+
if (retryCounts >= times)
|
|
449
|
+
throw err;
|
|
450
|
+
const delayTime = getDelayTime(retryCounts);
|
|
451
|
+
if (delayTime > 0)
|
|
452
|
+
yield sleep(delayTime);
|
|
453
|
+
}
|
|
454
|
+
throw new Error('retry failed');
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const noop = function noop() { };
|
|
459
|
+
|
|
460
|
+
function withResolvers(PromiseLike = Promise) {
|
|
461
|
+
let promise;
|
|
462
|
+
let resolve = noop;
|
|
463
|
+
let reject = noop;
|
|
464
|
+
promise = new PromiseLike((res, rej) => {
|
|
465
|
+
resolve = res;
|
|
466
|
+
reject = rej;
|
|
467
|
+
});
|
|
468
|
+
return { promise, resolve, reject };
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
const mimeMap = {
|
|
472
|
+
application: {
|
|
473
|
+
acrobat: ['pdf'],
|
|
474
|
+
bat: ['bat'],
|
|
475
|
+
cdr: ['cdr'],
|
|
476
|
+
coreldraw: ['cdr'],
|
|
477
|
+
csv: ['csv'],
|
|
478
|
+
dbase: ['dbf'],
|
|
479
|
+
dbf: ['dbf'],
|
|
480
|
+
ecmascript: ['ecma', 'es'],
|
|
481
|
+
emf: ['emf'],
|
|
482
|
+
'epub+zip': ['epub'],
|
|
483
|
+
exi: ['exi'],
|
|
484
|
+
express: ['exp'],
|
|
485
|
+
'font-woff': ['woff'],
|
|
486
|
+
'geo+json': ['geojson', 'geojson'],
|
|
487
|
+
gzip: ['gz'],
|
|
488
|
+
ico: ['ico'],
|
|
489
|
+
java: ['class'],
|
|
490
|
+
'java-archive': ['jar', 'war', 'ear'],
|
|
491
|
+
'java-byte-code': ['class'],
|
|
492
|
+
'java-serialized-object': ['ser'],
|
|
493
|
+
'java-vm': ['class'],
|
|
494
|
+
javascript: ['js', 'mjs', 'jsm'],
|
|
495
|
+
json: ['json', 'map'],
|
|
496
|
+
'json-patch+json': ['json-patch'],
|
|
497
|
+
json5: ['json5'],
|
|
498
|
+
'jsonml+json': ['jsonml'],
|
|
499
|
+
'ld+json': ['jsonld'],
|
|
500
|
+
m3u: ['m3u', 'm3u8', 'vlc'],
|
|
501
|
+
'manifest+json': ['webmanifest'],
|
|
502
|
+
'mathml+xml': ['mathml', 'mml'],
|
|
503
|
+
mbox: ['mbox'],
|
|
504
|
+
mdb: ['mdb'],
|
|
505
|
+
mp21: ['m21', 'mp21'],
|
|
506
|
+
mp4: ['mp4s', 'm4p'],
|
|
507
|
+
msaccess: ['mdb'],
|
|
508
|
+
msexcel: ['xls', 'xlc', 'xll', 'xlm', 'xlw', 'xla', 'xlt', 'xld'],
|
|
509
|
+
mspowerpoint: ['ppz', 'ppt', 'pps', 'pot'],
|
|
510
|
+
msword: ['doc', 'dot'],
|
|
511
|
+
'msword-template': ['dot'],
|
|
512
|
+
nappdf: ['pdf'],
|
|
513
|
+
node: ['cjs'],
|
|
514
|
+
'octet-stream': [
|
|
515
|
+
'bin',
|
|
516
|
+
'dms',
|
|
517
|
+
'lrf',
|
|
518
|
+
'mar',
|
|
519
|
+
'so',
|
|
520
|
+
'dist',
|
|
521
|
+
'distz',
|
|
522
|
+
'pkg',
|
|
523
|
+
'bpk',
|
|
524
|
+
'dump',
|
|
525
|
+
'elc',
|
|
526
|
+
'deploy',
|
|
527
|
+
'exe',
|
|
528
|
+
'dll',
|
|
529
|
+
'deb',
|
|
530
|
+
'dmg',
|
|
531
|
+
'iso',
|
|
532
|
+
'img',
|
|
533
|
+
'msi',
|
|
534
|
+
'msp',
|
|
535
|
+
'msm',
|
|
536
|
+
'buffer',
|
|
537
|
+
],
|
|
538
|
+
oda: ['oda'],
|
|
539
|
+
ogg: ['ogx'],
|
|
540
|
+
pdf: ['pdf'],
|
|
541
|
+
photoshop: ['psd'],
|
|
542
|
+
powerpoint: ['ppz', 'ppt', 'pps', 'pot'],
|
|
543
|
+
ram: ['ram'],
|
|
544
|
+
'raml+yaml': ['raml'],
|
|
545
|
+
'rss+xml': ['rss'],
|
|
546
|
+
rtf: ['rtf'],
|
|
547
|
+
'schema+json': ['json'],
|
|
548
|
+
sdp: ['sdp'],
|
|
549
|
+
sql: ['sql'],
|
|
550
|
+
tga: ['tga', 'icb', 'tpic', 'vda', 'vst'],
|
|
551
|
+
toml: ['toml'],
|
|
552
|
+
trig: ['trig'],
|
|
553
|
+
'ttml+xml': ['ttml'],
|
|
554
|
+
'vnd.adobe.flash.movie': ['swf', 'spl'],
|
|
555
|
+
'vnd.android.package-archive': ['apk'],
|
|
556
|
+
'vnd.apple.installer+xml': ['mpkg'],
|
|
557
|
+
'vnd.apple.mpegurl': ['m3u8', 'm3u'],
|
|
558
|
+
'vnd.bmi': ['bmi'],
|
|
559
|
+
'vnd.coffeescript': ['coffee'],
|
|
560
|
+
'vnd.dart': ['dart'],
|
|
561
|
+
'vnd.dbf': ['dbf'],
|
|
562
|
+
'vnd.dna': ['dna'],
|
|
563
|
+
'vnd.dolby.mlp': ['mlp'],
|
|
564
|
+
'vnd.efi.img': ['raw-disk-image', 'img'],
|
|
565
|
+
'vnd.efi.iso': ['iso', 'iso9660'],
|
|
566
|
+
'vnd.geo+json': ['geojson', 'geojson'],
|
|
567
|
+
'vnd.lotus-organizer': ['org'],
|
|
568
|
+
'vnd.ms-access': ['mdb'],
|
|
569
|
+
'vnd.ms-asf': ['asf'],
|
|
570
|
+
'vnd.ms-cab-compressed': ['cab'],
|
|
571
|
+
'vnd.ms-excel': ['xls', 'xlm', 'xla', 'xlc', 'xlt', 'xlw', 'xll', 'xld'],
|
|
572
|
+
'vnd.ms-excel.addin.macroenabled.12': ['xlam'],
|
|
573
|
+
'vnd.ms-excel.sheet.binary.macroenabled.12': ['xlsb'],
|
|
574
|
+
'vnd.ms-excel.sheet.macroenabled.12': ['xlsm'],
|
|
575
|
+
'vnd.ms-excel.template.macroenabled.12': ['xltm'],
|
|
576
|
+
'vnd.ms-fontobject': ['eot'],
|
|
577
|
+
'vnd.ms-htmlhelp': ['chm'],
|
|
578
|
+
'vnd.ms-ims': ['ims'],
|
|
579
|
+
'vnd.ms-lrm': ['lrm'],
|
|
580
|
+
'vnd.ms-officetheme': ['thmx'],
|
|
581
|
+
'vnd.ms-outlook': ['msg'],
|
|
582
|
+
'vnd.ms-pki.seccat': ['cat'],
|
|
583
|
+
'vnd.ms-pki.stl': ['stl'],
|
|
584
|
+
'vnd.ms-powerpoint': ['ppt', 'pps', 'pot', 'ppz'],
|
|
585
|
+
'vnd.ms-powerpoint.addin.macroenabled.12': ['ppam'],
|
|
586
|
+
'vnd.ms-powerpoint.presentation.macroenabled.12': ['pptm'],
|
|
587
|
+
'vnd.ms-powerpoint.slide.macroenabled.12': ['sldm'],
|
|
588
|
+
'vnd.ms-powerpoint.slideshow.macroenabled.12': ['ppsm'],
|
|
589
|
+
'vnd.ms-powerpoint.template.macroenabled.12': ['potm'],
|
|
590
|
+
'vnd.ms-project': ['mpp', 'mpt'],
|
|
591
|
+
'vnd.ms-publisher': ['pub'],
|
|
592
|
+
'vnd.ms-word': ['doc'],
|
|
593
|
+
'vnd.ms-word.document.macroenabled.12': ['docm'],
|
|
594
|
+
'vnd.ms-word.template.macroenabled.12': ['dotm'],
|
|
595
|
+
'vnd.ms-works': ['wps', 'wks', 'wcm', 'wdb', 'xlr'],
|
|
596
|
+
'vnd.ms-wpl': ['wpl'],
|
|
597
|
+
'vnd.msaccess': ['mdb'],
|
|
598
|
+
'vnd.openxmlformats-officedocument.presentationml.presentation': ['pptx'],
|
|
599
|
+
'vnd.openxmlformats-officedocument.presentationml.slide': ['sldx'],
|
|
600
|
+
'vnd.openxmlformats-officedocument.presentationml.slideshow': ['ppsx'],
|
|
601
|
+
'vnd.openxmlformats-officedocument.presentationml.template': ['potx'],
|
|
602
|
+
'vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['xlsx'],
|
|
603
|
+
'vnd.openxmlformats-officedocument.spreadsheetml.template': ['xltx'],
|
|
604
|
+
'vnd.openxmlformats-officedocument.wordprocessingml.document': ['docx'],
|
|
605
|
+
'vnd.openxmlformats-officedocument.wordprocessingml.template': ['dotx'],
|
|
606
|
+
'vnd.rar': ['rar'],
|
|
607
|
+
'vnd.svd': ['svd'],
|
|
608
|
+
'vnd.vcx': ['vcx'],
|
|
609
|
+
'vnd.youtube.yt': ['yt'],
|
|
610
|
+
wasm: ['wasm'],
|
|
611
|
+
widget: ['wgt'],
|
|
612
|
+
wmf: ['wmf'],
|
|
613
|
+
'x-7z-compressed': ['7z', '7z001'],
|
|
614
|
+
'x-ace': ['ace'],
|
|
615
|
+
'x-ace-compressed': ['ace'],
|
|
616
|
+
'x-aportisdoc': ['pdb', 'pdc'],
|
|
617
|
+
'x-asp': ['asp'],
|
|
618
|
+
'x-bat': ['bat'],
|
|
619
|
+
'x-bittorrent': ['torrent'],
|
|
620
|
+
'x-blender': ['blend', 'blender'],
|
|
621
|
+
'x-bzip': ['bz'],
|
|
622
|
+
'x-bzip-compressed-tar': ['tarbz', 'tbz', 'tbz2', 'tb2'],
|
|
623
|
+
'x-bzip2': ['bz2', 'boz'],
|
|
624
|
+
'x-bzip2-compressed-tar': ['tarbz2', 'tbz2', 'tb2'],
|
|
625
|
+
'x-bzip3': ['bz3'],
|
|
626
|
+
'x-bzip3-compressed-tar': ['tarbz3', 'tbz3'],
|
|
627
|
+
'x-cd-image': ['iso', 'iso9660'],
|
|
628
|
+
'x-cdlink': ['vcd'],
|
|
629
|
+
'x-cdr': ['cdr'],
|
|
630
|
+
'x-cfs-compressed': ['cfs'],
|
|
631
|
+
'x-chat': ['chat'],
|
|
632
|
+
'x-chm': ['chm'],
|
|
633
|
+
'x-compress': ['z'],
|
|
634
|
+
'x-compressed-tar': ['targz', 'tgz'],
|
|
635
|
+
'x-dreamcast-rom': ['iso'],
|
|
636
|
+
'x-dtbresource+xml': ['res'],
|
|
637
|
+
'x-flash-video': ['flv'],
|
|
638
|
+
'x-font-truetype': ['ttf'],
|
|
639
|
+
'x-font-ttf': ['ttf'],
|
|
640
|
+
'x-font-ttx': ['ttx'],
|
|
641
|
+
'x-font-woff': ['woff'],
|
|
642
|
+
'x-gzip': ['gz'],
|
|
643
|
+
'x-httpd-php': ['php'],
|
|
644
|
+
'x-javascript': ['js', 'jsm', 'mjs'],
|
|
645
|
+
'x-linguist': ['ts'],
|
|
646
|
+
'x-magicpoint': ['mgp'],
|
|
647
|
+
'x-makeself': ['run'],
|
|
648
|
+
'x-ms-dos-executable': ['exe'],
|
|
649
|
+
'x-ms-pdb': ['pdb'],
|
|
650
|
+
'x-ms-shortcut': ['lnk'],
|
|
651
|
+
'x-ms-wim': ['wim', 'swm'],
|
|
652
|
+
'x-ms-wmd': ['wmd'],
|
|
653
|
+
'x-msdos-program': ['exe'],
|
|
654
|
+
'x-msdownload': ['exe', 'dll', 'com', 'bat', 'msi'],
|
|
655
|
+
'x-msexcel': ['xls', 'xlc', 'xll', 'xlm', 'xlw', 'xla', 'xlt', 'xld'],
|
|
656
|
+
'x-msi': ['msi'],
|
|
657
|
+
'x-msmetafile': ['wmf', 'wmz', 'emf', 'emz'],
|
|
658
|
+
'x-mspowerpoint': ['ppz', 'ppt', 'pps', 'pot'],
|
|
659
|
+
'x-mspublisher': ['pub'],
|
|
660
|
+
'x-msschedule': ['scd'],
|
|
661
|
+
'x-msterminal': ['trm'],
|
|
662
|
+
'x-mswinurl': ['url'],
|
|
663
|
+
'x-msword': ['doc'],
|
|
664
|
+
'x-pak': ['pak'],
|
|
665
|
+
'x-pdf': ['pdf'],
|
|
666
|
+
'x-photoshop': ['psd'],
|
|
667
|
+
'x-php': ['php', 'php3', 'php4', 'php5', 'phps'],
|
|
668
|
+
'x-rar': ['rar'],
|
|
669
|
+
'x-rar-compressed': ['rar'],
|
|
670
|
+
'x-sh': ['sh'],
|
|
671
|
+
'x-sql': ['sql'],
|
|
672
|
+
'x-sqlite2': ['sqlite2'],
|
|
673
|
+
'x-sqlite3': ['sqlite3'],
|
|
674
|
+
'x-tar': ['tar', 'gtar', 'gem'],
|
|
675
|
+
'x-targa': ['tga', 'icb', 'tpic', 'vda', 'vst'],
|
|
676
|
+
'x-tarz': ['tarZ', 'taz'],
|
|
677
|
+
'x-tga': ['tga', 'icb', 'tpic', 'vda', 'vst'],
|
|
678
|
+
'x-tgif': ['obj'],
|
|
679
|
+
'x-theme': ['theme'],
|
|
680
|
+
'x-tiled-tsx': ['tsx'],
|
|
681
|
+
'x-vdi-disk': ['vdi'],
|
|
682
|
+
'x-vhd-disk': ['vhd', 'vpc'],
|
|
683
|
+
'x-vhdx-disk': ['vhdx'],
|
|
684
|
+
'x-virtualbox-hdd': ['hdd'],
|
|
685
|
+
'x-virtualbox-ova': ['ova'],
|
|
686
|
+
'x-virtualbox-ovf': ['ovf'],
|
|
687
|
+
'x-virtualbox-vbox': ['vbox'],
|
|
688
|
+
'x-virtualbox-vdi': ['vdi'],
|
|
689
|
+
'x-virtualbox-vhd': ['vhd', 'vpc'],
|
|
690
|
+
'x-virtualbox-vhdx': ['vhdx'],
|
|
691
|
+
'x-virtualbox-vmdk': ['vmdk'],
|
|
692
|
+
'x-vmdk-disk': ['vmdk'],
|
|
693
|
+
'x-wais-source': ['src'],
|
|
694
|
+
'x-wbfs': ['iso'],
|
|
695
|
+
'x-web-app-manifest+json': ['webapp'],
|
|
696
|
+
'x-wia': ['iso'],
|
|
697
|
+
'x-windows-themepack': ['themepack'],
|
|
698
|
+
'x-wmf': ['wmf'],
|
|
699
|
+
'x-xar': ['xar', 'pkg'],
|
|
700
|
+
'x-xz': ['xz'],
|
|
701
|
+
'x-xz-compressed-tar': ['tarxz', 'txz'],
|
|
702
|
+
'x-xzpdf': ['pdfxz'],
|
|
703
|
+
'x-yaml': ['yaml', 'yml'],
|
|
704
|
+
'x-zip': ['zip', 'zipx'],
|
|
705
|
+
'x-zip-compressed': ['zip', 'zipx'],
|
|
706
|
+
'x-zip-compressed-fb2': ['fb2zip'],
|
|
707
|
+
'xhtml+xml': ['xhtml', 'xht', 'html', 'htm'],
|
|
708
|
+
xml: ['xml', 'xsl', 'xsd', 'rng', 'xbl'],
|
|
709
|
+
yaml: ['yaml', 'yml'],
|
|
710
|
+
yang: ['yang'],
|
|
711
|
+
'yin+xml': ['yin'],
|
|
712
|
+
zip: ['zip', 'zipx'],
|
|
713
|
+
},
|
|
714
|
+
audio: {
|
|
715
|
+
basic: ['au', 'snd'],
|
|
716
|
+
flac: ['flac'],
|
|
717
|
+
m3u: ['m3u', 'm3u8', 'vlc'],
|
|
718
|
+
m4a: ['m4a', 'f4a'],
|
|
719
|
+
midi: ['mid', 'midi', 'kar', 'rmi'],
|
|
720
|
+
mp2: ['mp2'],
|
|
721
|
+
mp3: ['mp3', 'mpga'],
|
|
722
|
+
mp4: ['m4a', 'mp4a', 'f4a'],
|
|
723
|
+
mpeg: ['mp3', 'mpga', 'mp2', 'mp2a', 'm2a', 'm3a'],
|
|
724
|
+
mpegurl: ['m3u', 'm3u8', 'vlc'],
|
|
725
|
+
ogg: ['ogg', 'oga', 'spx', 'opus'],
|
|
726
|
+
vorbis: ['oga', 'ogg'],
|
|
727
|
+
wav: ['wav'],
|
|
728
|
+
wave: ['wav'],
|
|
729
|
+
webm: ['weba'],
|
|
730
|
+
wma: ['wma'],
|
|
731
|
+
'x-ms-wmv': ['wmv'],
|
|
732
|
+
},
|
|
733
|
+
'flv-application': {
|
|
734
|
+
'octet-stream': ['flv'],
|
|
735
|
+
},
|
|
736
|
+
font: {
|
|
737
|
+
collection: ['ttc'],
|
|
738
|
+
otf: ['otf'],
|
|
739
|
+
ttf: ['ttf'],
|
|
740
|
+
woff: ['woff'],
|
|
741
|
+
woff2: ['woff2'],
|
|
742
|
+
},
|
|
743
|
+
image: {
|
|
744
|
+
apng: ['apng', 'png'],
|
|
745
|
+
avif: ['avif', 'avifs'],
|
|
746
|
+
'avif-sequence': ['avif', 'avifs'],
|
|
747
|
+
bmp: ['bmp', 'dib'],
|
|
748
|
+
gif: ['gif'],
|
|
749
|
+
heic: ['heic', 'heif', 'hif'],
|
|
750
|
+
'heic-sequence': ['heics', 'heic', 'heif', 'hif'],
|
|
751
|
+
heif: ['heif', 'heic', 'hif'],
|
|
752
|
+
'heif-sequence': ['heifs', 'heic', 'heif', 'hif'],
|
|
753
|
+
hej2k: ['hej2'],
|
|
754
|
+
hsj2: ['hsj2'],
|
|
755
|
+
ico: ['ico'],
|
|
756
|
+
icon: ['ico'],
|
|
757
|
+
jp2: ['jp2', 'jpg2'],
|
|
758
|
+
jpeg: ['jpg', 'jpeg', 'jpe'],
|
|
759
|
+
jpeg2000: ['jp2', 'jpg2'],
|
|
760
|
+
'jpeg2000-image': ['jp2', 'jpg2'],
|
|
761
|
+
jpx: ['jpx', 'jpf'],
|
|
762
|
+
jxl: ['jxl'],
|
|
763
|
+
pdf: ['pdf'],
|
|
764
|
+
photoshop: ['psd'],
|
|
765
|
+
pjpeg: ['jpg', 'jpeg', 'jpe'],
|
|
766
|
+
png: ['png'],
|
|
767
|
+
psd: ['psd'],
|
|
768
|
+
svg: ['svg'],
|
|
769
|
+
'svg+xml': ['svg', 'svgz'],
|
|
770
|
+
'svg+xml-compressed': ['svgz', 'svggz'],
|
|
771
|
+
tiff: ['tif', 'tiff'],
|
|
772
|
+
'vnd.adobe.photoshop': ['psd'],
|
|
773
|
+
'vnd.microsoft.icon': ['ico'],
|
|
774
|
+
'vnd.mozilla.apng': ['apng', 'png'],
|
|
775
|
+
webp: ['webp'],
|
|
776
|
+
},
|
|
777
|
+
message: {
|
|
778
|
+
global: ['u8msg'],
|
|
779
|
+
rfc822: ['eml', 'mime'],
|
|
780
|
+
'vnd.wfa.wsc': ['wsc'],
|
|
781
|
+
},
|
|
782
|
+
model: {
|
|
783
|
+
'3mf': ['3mf'],
|
|
784
|
+
iges: ['igs', 'iges'],
|
|
785
|
+
mesh: ['msh', 'mesh', 'silo'],
|
|
786
|
+
mtl: ['mtl'],
|
|
787
|
+
obj: ['obj'],
|
|
788
|
+
stl: ['stl'],
|
|
789
|
+
'vnd.collada+xml': ['dae'],
|
|
790
|
+
'vnd.dwf': ['dwf'],
|
|
791
|
+
'vnd.gdl': ['gdl'],
|
|
792
|
+
'vnd.gtw': ['gtw'],
|
|
793
|
+
'vnd.mts': ['mts'],
|
|
794
|
+
'vnd.opengex': ['ogex'],
|
|
795
|
+
'vnd.sap.vds': ['vds'],
|
|
796
|
+
'vnd.usdz+zip': ['usdz'],
|
|
797
|
+
'vnd.valve.source.compiled-map': ['bsp'],
|
|
798
|
+
'vnd.vtu': ['vtu'],
|
|
799
|
+
vrml: ['wrl', 'vrml', 'vrm'],
|
|
800
|
+
},
|
|
801
|
+
text: {
|
|
802
|
+
'cache-manifest': ['appcache', 'manifest'],
|
|
803
|
+
coffeescript: ['coffee', 'litcoffee'],
|
|
804
|
+
css: ['css'],
|
|
805
|
+
csv: ['csv'],
|
|
806
|
+
directory: ['vcard', 'vcf', 'vct', 'gcrd'],
|
|
807
|
+
ecmascript: ['es'],
|
|
808
|
+
html: ['html', 'htm', 'shtml'],
|
|
809
|
+
ico: ['ico'],
|
|
810
|
+
jade: ['jade'],
|
|
811
|
+
javascript: ['js', 'jsm', 'mjs'],
|
|
812
|
+
jsx: ['jsx'],
|
|
813
|
+
less: ['less'],
|
|
814
|
+
markdown: ['md', 'markdown', 'mkd'],
|
|
815
|
+
mathml: ['mml'],
|
|
816
|
+
mdx: ['mdx'],
|
|
817
|
+
org: ['org'],
|
|
818
|
+
plain: ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'ini', 'asc'],
|
|
819
|
+
rss: ['rss'],
|
|
820
|
+
rtf: ['rtf'],
|
|
821
|
+
rust: ['rs'],
|
|
822
|
+
stylus: ['stylus', 'styl'],
|
|
823
|
+
troff: ['t', 'tr', 'roff', 'man', 'me', 'ms'],
|
|
824
|
+
'uri-list': ['uri', 'uris', 'urls'],
|
|
825
|
+
vbs: ['vbs'],
|
|
826
|
+
vbscript: ['vbs'],
|
|
827
|
+
vcard: ['vcard', 'vcf', 'vct', 'gcrd'],
|
|
828
|
+
'x-asm': ['s', 'asm'],
|
|
829
|
+
'x-blueprint': ['blp'],
|
|
830
|
+
'x-c': ['c', 'cc', 'cxx', 'cpp', 'h', 'hh', 'dic'],
|
|
831
|
+
'x-c++hdr': ['hh', 'hp', 'hpp', 'h++', 'hxx'],
|
|
832
|
+
'x-c++src': ['cpp', 'cxx', 'cc', 'C', 'c++'],
|
|
833
|
+
'x-chdr': ['h'],
|
|
834
|
+
'x-cmake': ['cmake'],
|
|
835
|
+
'x-cobol': ['cbl', 'cob'],
|
|
836
|
+
'x-common-lisp': ['asd', 'fasl', 'lisp', 'ros'],
|
|
837
|
+
'x-csharp': ['cs'],
|
|
838
|
+
'x-csrc': ['c'],
|
|
839
|
+
'x-csv': ['csv'],
|
|
840
|
+
'x-dart': ['dart'],
|
|
841
|
+
'x-dbus-service': ['service'],
|
|
842
|
+
'x-diff': ['diff', 'patch'],
|
|
843
|
+
'x-dsl': ['dsl'],
|
|
844
|
+
'x-dsrc': ['d', 'di'],
|
|
845
|
+
'x-dtd': ['dtd'],
|
|
846
|
+
'x-eiffel': ['e', 'eif'],
|
|
847
|
+
'x-elixir': ['ex', 'exs'],
|
|
848
|
+
'x-emacs-lisp': ['el'],
|
|
849
|
+
'x-erlang': ['erl'],
|
|
850
|
+
'x-go': ['go'],
|
|
851
|
+
'x-log': ['log'],
|
|
852
|
+
'x-lua': ['lua'],
|
|
853
|
+
'x-python': ['py', 'pyx', 'wsgi'],
|
|
854
|
+
'x-python3': ['py', 'py3', 'py3x', 'pyi'],
|
|
855
|
+
'x-sass': ['sass'],
|
|
856
|
+
'x-scala': ['scala', 'sc'],
|
|
857
|
+
'x-scss': ['scss'],
|
|
858
|
+
'x-sfv': ['sfv'],
|
|
859
|
+
'x-sh': ['sh'],
|
|
860
|
+
'x-sql': ['sql'],
|
|
861
|
+
'x-svhdr': ['svh'],
|
|
862
|
+
'x-svsrc': ['sv'],
|
|
863
|
+
'x-vala': ['vala', 'vapi'],
|
|
864
|
+
'x-vcalendar': ['vcs', 'ics'],
|
|
865
|
+
'x-vcard': ['vcf', 'vcard', 'vct', 'gcrd'],
|
|
866
|
+
'x-verilog': ['v'],
|
|
867
|
+
'x-vhdl': ['vhd', 'vhdl'],
|
|
868
|
+
'x-yaml': ['yaml', 'yml'],
|
|
869
|
+
'x.gcode': ['gcode'],
|
|
870
|
+
xml: ['xml', 'xbl', 'xsd', 'rng'],
|
|
871
|
+
'xml-external-parsed-entity': ['ent'],
|
|
872
|
+
yaml: ['yaml', 'yml'],
|
|
873
|
+
},
|
|
874
|
+
video: {
|
|
875
|
+
avi: ['avi', 'avf', 'divx'],
|
|
876
|
+
divx: ['avi', 'avf', 'divx'],
|
|
877
|
+
dv: ['dv'],
|
|
878
|
+
fli: ['fli', 'flc'],
|
|
879
|
+
flv: ['flv'],
|
|
880
|
+
h261: ['h261'],
|
|
881
|
+
h263: ['h263'],
|
|
882
|
+
h264: ['h264'],
|
|
883
|
+
jpeg: ['jpgv'],
|
|
884
|
+
mp2t: ['ts', 'm2t', 'm2ts', 'mts', 'cpi', 'clpi', 'mpl', 'mpls', 'bdm', 'bdmv'],
|
|
885
|
+
mp4: ['mp4', 'mp4v', 'mpg4', 'm4v', 'f4v', 'lrv'],
|
|
886
|
+
mpeg: ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v', 'mp2', 'vob'],
|
|
887
|
+
msvideo: ['avi', 'avf', 'divx'],
|
|
888
|
+
ogg: ['ogv', 'ogg'],
|
|
889
|
+
quicktime: ['mov', 'qt', 'moov', 'qtvr'],
|
|
890
|
+
webm: ['webm'],
|
|
891
|
+
'x-matroska': ['mkv', 'mk3d', 'mks'],
|
|
892
|
+
'x-ms-wmv': ['wmv'],
|
|
893
|
+
},
|
|
894
|
+
};
|
|
895
|
+
const extMap = (() => {
|
|
896
|
+
const map = {};
|
|
897
|
+
Object.keys(mimeMap).forEach((type) => {
|
|
898
|
+
const subMap = mimeMap[type];
|
|
899
|
+
Object.keys(subMap).forEach((subType) => {
|
|
900
|
+
const extList = subMap[subType];
|
|
901
|
+
extList.forEach((ext) => {
|
|
902
|
+
if (!map[ext])
|
|
903
|
+
map[ext] = [];
|
|
904
|
+
map[ext].push(`${type}/${subType}`);
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
Object.keys(map).forEach((ext) => {
|
|
909
|
+
map[ext].sort((a, b) => a.length - b.length);
|
|
910
|
+
});
|
|
911
|
+
return map;
|
|
912
|
+
})();
|
|
913
|
+
|
|
914
|
+
function _getAcceptableExtByMIME(mime) {
|
|
915
|
+
var _a;
|
|
916
|
+
const [t, st] = mime.split('/');
|
|
917
|
+
if (!t || !st)
|
|
918
|
+
return [];
|
|
919
|
+
if (st === '*') {
|
|
920
|
+
return Object.values(mimeMap[t] || {}).flat();
|
|
921
|
+
}
|
|
922
|
+
return ((_a = mimeMap[t]) === null || _a === void 0 ? void 0 : _a[st]) || [];
|
|
923
|
+
}
|
|
924
|
+
function _getAcceptableMIMEByExt(ext) {
|
|
925
|
+
return extMap[ext] || [];
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
function acceptableFileName(fileName, accept) {
|
|
929
|
+
const _ext = fileName.split('.').pop();
|
|
930
|
+
const ext = /^[CZ]$/.test(_ext) ? _ext : _ext.toLowerCase();
|
|
931
|
+
const allMimeType = _getAcceptableMIMEByExt(ext);
|
|
932
|
+
const acceptList = accept.split(',').map((s) => s.trim());
|
|
933
|
+
for (const item of acceptList) {
|
|
934
|
+
if (item.includes('/')) {
|
|
935
|
+
const i = item.toLowerCase();
|
|
936
|
+
if (i === '*/*')
|
|
937
|
+
return true;
|
|
938
|
+
for (const mime of allMimeType) {
|
|
939
|
+
if (i === mime)
|
|
940
|
+
return true;
|
|
941
|
+
if (i.endsWith('/*') && mime.startsWith(i.slice(0, -2)))
|
|
942
|
+
return true;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
const _acceptExt = item.replace(/^\./, '');
|
|
947
|
+
const acceptExt = /^[CZ]$/.test(_acceptExt) ? _acceptExt : _acceptExt.toLowerCase();
|
|
948
|
+
if (acceptExt === ext)
|
|
949
|
+
return true;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return false;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
function acceptableFileType(fileType, accept) {
|
|
956
|
+
const type = fileType.toLowerCase();
|
|
957
|
+
const allExtList = _getAcceptableExtByMIME(type);
|
|
958
|
+
const acceptList = accept.split(',').map((s) => s.trim());
|
|
959
|
+
for (const item of acceptList) {
|
|
960
|
+
if (item.includes('/')) {
|
|
961
|
+
const i = item.toLowerCase();
|
|
962
|
+
if (i === '*/*' || i === type)
|
|
963
|
+
return true;
|
|
964
|
+
if (i.endsWith('/*') && type.startsWith(i.slice(0, -2)))
|
|
965
|
+
return true;
|
|
966
|
+
}
|
|
967
|
+
else {
|
|
968
|
+
const _ext = item.replace(/^\./, '');
|
|
969
|
+
const ext = /^[CZ]$/.test(_ext) ? _ext : _ext.toLowerCase();
|
|
970
|
+
if (allExtList.includes(ext))
|
|
971
|
+
return true;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
return false;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
function getAcceptableExtByMIME(mime) {
|
|
978
|
+
if (!mime || !isString(mime))
|
|
979
|
+
return [];
|
|
980
|
+
return _getAcceptableExtByMIME(mime.trim().toLowerCase());
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
function getAcceptableMIMEByExt(ext) {
|
|
984
|
+
if (!ext || !isString(ext))
|
|
985
|
+
return [];
|
|
986
|
+
const _ext = ext.split('.').pop().trim();
|
|
987
|
+
const e = /^[CZ]$/.test(_ext) ? _ext : _ext.toLowerCase();
|
|
988
|
+
return _getAcceptableMIMEByExt(e);
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
function randomInt(min, max) {
|
|
992
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
993
|
+
}
|
|
994
|
+
function randomIntFloor(min, max) {
|
|
995
|
+
return Math.floor(Math.random() * (max - min)) + min;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
function randomChoice(arr, weights) {
|
|
999
|
+
if (!weights || !weights.length)
|
|
1000
|
+
return arr[randomIntFloor(0, arr.length)];
|
|
1001
|
+
let sum = 0;
|
|
1002
|
+
const cumulativeWeights = [];
|
|
1003
|
+
for (let i = 0; i < weights.length; i++) {
|
|
1004
|
+
sum += weights[i] ? weights[i] : 0;
|
|
1005
|
+
cumulativeWeights.push(sum);
|
|
1006
|
+
}
|
|
1007
|
+
const randomWeight = Math.random() * sum;
|
|
1008
|
+
const index = cumulativeWeights.findIndex(weight => weight > randomWeight);
|
|
1009
|
+
return arr[index];
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
const radix32 = '0123456789abcdefghijklmnopqrstuv';
|
|
1013
|
+
const base32Chars = 'abcdefghijklmnopqrstuvwxyz234567';
|
|
1014
|
+
const base32Crockford = '0123456789abcdefghjkmnpqrstvwxyz';
|
|
1015
|
+
const base32CharsMap = new Map(radix32.split('').map((c, i) => [c, base32Chars[i]]));
|
|
1016
|
+
const base32CrockfordMap = new Map(radix32.split('').map((c, i) => [c, base32Crockford[i]]));
|
|
1017
|
+
function toBase32(str, mapping) {
|
|
1018
|
+
return str
|
|
1019
|
+
.split('')
|
|
1020
|
+
.map((c) => mapping.get(c))
|
|
1021
|
+
.join('');
|
|
1022
|
+
}
|
|
1023
|
+
function numberToBase32(num, length, mapping) {
|
|
1024
|
+
let res = num.toString(32);
|
|
1025
|
+
while (res.length < length)
|
|
1026
|
+
res = '0' + res;
|
|
1027
|
+
return toBase32(res, mapping);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function randomString(length, chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {
|
|
1031
|
+
if (!Number.isInteger(length) || length <= 0) {
|
|
1032
|
+
throw new Error('Invalid length parameter');
|
|
1033
|
+
}
|
|
1034
|
+
let res = '';
|
|
1035
|
+
for (let i = 0; i < length; i++)
|
|
1036
|
+
res += randomChoice(chars);
|
|
1037
|
+
return res;
|
|
1038
|
+
}
|
|
1039
|
+
function randomHexString(length) {
|
|
1040
|
+
if (!Number.isInteger(length) || length <= 0) {
|
|
1041
|
+
throw new Error('Invalid length parameter');
|
|
1042
|
+
}
|
|
1043
|
+
if (length > 13) {
|
|
1044
|
+
const count = Math.floor(length / 13);
|
|
1045
|
+
let res = _randomHexString(length % 13);
|
|
1046
|
+
for (let i = 0; i < count; i++)
|
|
1047
|
+
res += _randomHexString(13);
|
|
1048
|
+
return res;
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
return _randomHexString(length);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
function _randomHexString(length) {
|
|
1055
|
+
let res = Math.floor(Math.random() * 16 ** length).toString(16);
|
|
1056
|
+
while (res.length < length)
|
|
1057
|
+
res = '0' + res;
|
|
1058
|
+
return res;
|
|
1059
|
+
}
|
|
1060
|
+
function randomBase32String(length, isCrockford = false) {
|
|
1061
|
+
if (!Number.isInteger(length) || length <= 0) {
|
|
1062
|
+
throw new Error('Invalid length parameter');
|
|
1063
|
+
}
|
|
1064
|
+
const map = isCrockford ? base32CrockfordMap : base32CharsMap;
|
|
1065
|
+
if (length > 13) {
|
|
1066
|
+
const count = Math.floor(length / 10);
|
|
1067
|
+
let res = _randomBase32String(length % 10, map);
|
|
1068
|
+
for (let i = 0; i < count; i++)
|
|
1069
|
+
res += _randomBase32String(10, map);
|
|
1070
|
+
return res;
|
|
1071
|
+
}
|
|
1072
|
+
else {
|
|
1073
|
+
return _randomBase32String(length, map);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
function _randomBase32String(length, mapping) {
|
|
1077
|
+
return numberToBase32(Math.floor(Math.random() * 32 ** length), length, mapping);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
function shuffle(arr) {
|
|
1081
|
+
const array = Array.from(arr);
|
|
1082
|
+
if (array.length <= 1)
|
|
1083
|
+
return array;
|
|
1084
|
+
for (let i = array.length - 1; i > 0; i--) {
|
|
1085
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
1086
|
+
[array[i], array[j]] = [array[j], array[i]];
|
|
1087
|
+
}
|
|
1088
|
+
return array;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
let lastTime = 0;
|
|
1092
|
+
let lastNum1 = 0;
|
|
1093
|
+
let lastNum2 = 0;
|
|
1094
|
+
function ulid(monotonic = true, time = NaN) {
|
|
1095
|
+
const now = isInteger(time) ? time : Date.now();
|
|
1096
|
+
if (!monotonic)
|
|
1097
|
+
return (_encodeTime(now) + randomBase32String(16)).toUpperCase();
|
|
1098
|
+
if (lastTime !== now) {
|
|
1099
|
+
lastTime = now;
|
|
1100
|
+
lastNum1 = randomIntFloor(0, 32 ** 6);
|
|
1101
|
+
lastNum2 = randomIntFloor(0, 32 ** 10);
|
|
1102
|
+
}
|
|
1103
|
+
else {
|
|
1104
|
+
lastNum2++;
|
|
1105
|
+
if (lastNum2 >= 32 ** 10) {
|
|
1106
|
+
lastNum1++;
|
|
1107
|
+
lastNum2 = 0;
|
|
1108
|
+
}
|
|
1109
|
+
if (lastNum1 >= 32 ** 6) {
|
|
1110
|
+
lastNum1 = 0;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
return (_encodeTime(now) +
|
|
1114
|
+
numberToBase32(lastNum1, 6, base32CrockfordMap) +
|
|
1115
|
+
numberToBase32(lastNum2, 10, base32CrockfordMap)).toUpperCase();
|
|
1116
|
+
}
|
|
1117
|
+
function _encodeTime(time) {
|
|
1118
|
+
let str = '';
|
|
1119
|
+
while (str.length < 10) {
|
|
1120
|
+
str = base32Crockford[time % 32] + str;
|
|
1121
|
+
time = Math.floor(time / 32);
|
|
1122
|
+
}
|
|
1123
|
+
return str;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
const uuidNil = '00000000-0000-0000-0000-000000000000';
|
|
1127
|
+
function uuidV4() {
|
|
1128
|
+
const r = randomHexString(30);
|
|
1129
|
+
return (`${r.slice(0, 8)}-${r.slice(8, 12)}-4${r.slice(12, 15)}-` +
|
|
1130
|
+
`${'89ab'[Math.floor(Math.random() * 4)]}${r.slice(15, 18)}-${r.slice(18)}`);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
const getDefaultVarCase = () => ({ code: '', upperCase: false, number: false });
|
|
1134
|
+
const isUpperCase = RegExp.prototype.test.bind(/[A-Z]/);
|
|
1135
|
+
const isLowerCase = RegExp.prototype.test.bind(/[a-z]/);
|
|
1136
|
+
const isNumberCase = RegExp.prototype.test.bind(/[0-9]/);
|
|
1137
|
+
const isSymbolCase = RegExp.prototype.test.bind(/[^a-z0-9A-Z]/);
|
|
1138
|
+
function _splitVar(c) {
|
|
1139
|
+
const res = [];
|
|
1140
|
+
let temp = getDefaultVarCase();
|
|
1141
|
+
let i;
|
|
1142
|
+
for (i = 0; i < c.length; i++) {
|
|
1143
|
+
const char = c[i];
|
|
1144
|
+
if (isSymbolCase(char)) {
|
|
1145
|
+
if (temp.code) {
|
|
1146
|
+
res.push(temp);
|
|
1147
|
+
temp = getDefaultVarCase();
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
else if (isNumberCase(char)) {
|
|
1151
|
+
if (!temp.code)
|
|
1152
|
+
temp.number = true;
|
|
1153
|
+
if (temp.number) {
|
|
1154
|
+
temp.code += char;
|
|
1155
|
+
}
|
|
1156
|
+
else {
|
|
1157
|
+
res.push(temp);
|
|
1158
|
+
temp = { code: char, number: true, upperCase: false };
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
else if (isLowerCase(char)) {
|
|
1162
|
+
if (!temp.code) {
|
|
1163
|
+
temp.code += char;
|
|
1164
|
+
}
|
|
1165
|
+
else if (temp.upperCase) {
|
|
1166
|
+
if (temp.code.length === 1) {
|
|
1167
|
+
temp.upperCase = false;
|
|
1168
|
+
temp.code += char;
|
|
1169
|
+
}
|
|
1170
|
+
else {
|
|
1171
|
+
const lastUpperCase = temp.code[temp.code.length - 1];
|
|
1172
|
+
temp.code = temp.code.slice(0, -1);
|
|
1173
|
+
res.push(temp);
|
|
1174
|
+
temp = { code: lastUpperCase + char, upperCase: false, number: false };
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
else if (temp.number) {
|
|
1178
|
+
res.push(temp);
|
|
1179
|
+
temp = { code: char, upperCase: false, number: false };
|
|
1180
|
+
}
|
|
1181
|
+
else {
|
|
1182
|
+
temp.code += char;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
else if (isUpperCase(char)) {
|
|
1186
|
+
if (!temp.code)
|
|
1187
|
+
temp.upperCase = true;
|
|
1188
|
+
if (temp.upperCase) {
|
|
1189
|
+
temp.code += char;
|
|
1190
|
+
}
|
|
1191
|
+
else {
|
|
1192
|
+
res.push(temp);
|
|
1193
|
+
temp = { code: char, upperCase: true, number: false };
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
res.push(temp);
|
|
1198
|
+
return res;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
function _caseConvert(tokens, joiner, handler) {
|
|
1202
|
+
return tokens
|
|
1203
|
+
.map(handler)
|
|
1204
|
+
.filter((s) => s.length)
|
|
1205
|
+
.join(joiner);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
function camelCase(str, options) {
|
|
1209
|
+
const { keepLetterCase = false, keepNumber = true } = options || {};
|
|
1210
|
+
let tokens = _splitVar(str);
|
|
1211
|
+
if (!keepNumber)
|
|
1212
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1213
|
+
return _caseConvert(tokens, '', keepLetterCase
|
|
1214
|
+
? ({ code }, index) => {
|
|
1215
|
+
if (index)
|
|
1216
|
+
return code.slice(0, 1).toUpperCase() + code.slice(1);
|
|
1217
|
+
else
|
|
1218
|
+
return code;
|
|
1219
|
+
}
|
|
1220
|
+
: ({ code }, index) => {
|
|
1221
|
+
if (index)
|
|
1222
|
+
return code.slice(0, 1).toUpperCase() + code.slice(1).toLowerCase();
|
|
1223
|
+
else
|
|
1224
|
+
return code.toLowerCase();
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
function kebabCase(str, options) {
|
|
1229
|
+
const { keepLetterCase = false, keepNumber = true } = options || {};
|
|
1230
|
+
let tokens = _splitVar(str);
|
|
1231
|
+
if (!keepNumber)
|
|
1232
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1233
|
+
return _caseConvert(tokens, '-', keepLetterCase ? ({ code }) => code : ({ code }) => code.toLowerCase());
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
function pascalCase(str, options) {
|
|
1237
|
+
const { keepLetterCase = false, keepNumber = true } = options || {};
|
|
1238
|
+
let tokens = _splitVar(str);
|
|
1239
|
+
if (!keepNumber)
|
|
1240
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1241
|
+
return _caseConvert(tokens, '', keepLetterCase
|
|
1242
|
+
? ({ code }) => code.slice(0, 1).toUpperCase() + code.slice(1)
|
|
1243
|
+
: ({ code }) => code.slice(0, 1).toUpperCase() + code.slice(1).toLowerCase());
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
function snakeCase(str, options) {
|
|
1247
|
+
const { keepLetterCase = false, keepNumber = true } = options || {};
|
|
1248
|
+
let tokens = _splitVar(str);
|
|
1249
|
+
if (!keepNumber)
|
|
1250
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1251
|
+
return _caseConvert(tokens, '_', keepLetterCase ? ({ code }) => code : ({ code }) => code.toLowerCase());
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
function titleCase(str, options) {
|
|
1255
|
+
const { keepLetterCase = false, keepNumber = true } = options || {};
|
|
1256
|
+
let tokens = _splitVar(str);
|
|
1257
|
+
if (!keepNumber)
|
|
1258
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1259
|
+
return _caseConvert(tokens, ' ', keepLetterCase
|
|
1260
|
+
? ({ code }) => code.slice(0, 1).toUpperCase() + code.slice(1)
|
|
1261
|
+
: ({ code }) => code.slice(0, 1).toUpperCase() + code.slice(1).toLowerCase());
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
function capitalize(str) {
|
|
1265
|
+
if (!str)
|
|
1266
|
+
return str;
|
|
1267
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
function caseConvert(str, joiner = '', handler) {
|
|
1271
|
+
const hc = handler ? handler : (token) => token.code;
|
|
1272
|
+
return _caseConvert(_splitVar(str), joiner, hc);
|
|
1273
|
+
}
|
|
1274
|
+
function caseCamel(str, keepLetterCase = false, keepNumber = true) {
|
|
1275
|
+
let tokens = _splitVar(str);
|
|
1276
|
+
if (!keepNumber)
|
|
1277
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1278
|
+
return _caseConvert(tokens, '', keepLetterCase
|
|
1279
|
+
? ({ code }, index) => {
|
|
1280
|
+
if (index)
|
|
1281
|
+
return code.slice(0, 1).toUpperCase() + code.slice(1);
|
|
1282
|
+
else
|
|
1283
|
+
return code;
|
|
1284
|
+
}
|
|
1285
|
+
: ({ code }, index) => {
|
|
1286
|
+
if (index)
|
|
1287
|
+
return code.slice(0, 1).toUpperCase() + code.slice(1).toLowerCase();
|
|
1288
|
+
else
|
|
1289
|
+
return code.toLowerCase();
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
function casePascal(str, keepLetterCase = false, keepNumber = true) {
|
|
1293
|
+
let tokens = _splitVar(str);
|
|
1294
|
+
if (!keepNumber)
|
|
1295
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1296
|
+
return _caseConvert(tokens, '', keepLetterCase
|
|
1297
|
+
? ({ code }) => code.slice(0, 1).toUpperCase() + code.slice(1)
|
|
1298
|
+
: ({ code }) => code.slice(0, 1).toUpperCase() + code.slice(1).toLowerCase());
|
|
1299
|
+
}
|
|
1300
|
+
function caseKebab(str, keepLetterCase = false, keepNumber = true) {
|
|
1301
|
+
let tokens = _splitVar(str);
|
|
1302
|
+
if (!keepNumber)
|
|
1303
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1304
|
+
return _caseConvert(tokens, '-', keepLetterCase ? ({ code }) => code : ({ code }) => code.toLowerCase());
|
|
1305
|
+
}
|
|
1306
|
+
function caseSnake(str, keepLetterCase = false, keepNumber = true) {
|
|
1307
|
+
let tokens = _splitVar(str);
|
|
1308
|
+
if (!keepNumber)
|
|
1309
|
+
tokens = tokens.filter(({ number }) => !number);
|
|
1310
|
+
return _caseConvert(tokens, '_', keepLetterCase ? ({ code }) => code : ({ code }) => code.toLowerCase());
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
function splitWords(str) {
|
|
1314
|
+
return _splitVar(str).map(({ code }) => code);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
function uncapitalize(str) {
|
|
1318
|
+
if (!str)
|
|
1319
|
+
return str;
|
|
1320
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
function compose(...composeFunc) {
|
|
1324
|
+
if (composeFunc.length === 0) {
|
|
1325
|
+
throw new Error('Invalid composeFunc parameter: composeFunc is empty');
|
|
1326
|
+
}
|
|
1327
|
+
for (let i = 0; i < composeFunc.length; i++) {
|
|
1328
|
+
if (typeof composeFunc[i] !== 'function') {
|
|
1329
|
+
throw new Error(`Invalid composeFunc parameter: composeFunc[${i}] is not a function`);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
const _fnList = composeFunc.slice().reverse();
|
|
1333
|
+
return (...args) => {
|
|
1334
|
+
let result = _fnList[0](...args);
|
|
1335
|
+
for (let i = 1; i < _fnList.length; i++) {
|
|
1336
|
+
result = _fnList[i](result);
|
|
1337
|
+
}
|
|
1338
|
+
return result;
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
const _ = Object.freeze({ '@@functional/placeholder': true });
|
|
1343
|
+
function isPlaceholder(arg) {
|
|
1344
|
+
return typeof arg === 'object' && Boolean(arg) && arg['@@functional/placeholder'] === true;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
const _curry1 = function _curry1(fn) {
|
|
1348
|
+
return function curried1(arg1) {
|
|
1349
|
+
if (arguments.length < 1 || isPlaceholder(arg1)) {
|
|
1350
|
+
return curried1;
|
|
1351
|
+
}
|
|
1352
|
+
else {
|
|
1353
|
+
return fn.apply(this, arguments);
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1358
|
+
const _curry2 = function _curry2(fn) {
|
|
1359
|
+
return function curried2(arg1, arg2) {
|
|
1360
|
+
const p1 = arguments.length < 1 || isPlaceholder(arg1);
|
|
1361
|
+
const p2 = arguments.length < 2 || isPlaceholder(arg2);
|
|
1362
|
+
if (p1 && p2) {
|
|
1363
|
+
return curried2;
|
|
1364
|
+
}
|
|
1365
|
+
else if (!p1 && p2) {
|
|
1366
|
+
return _curry1(function (_arg2) {
|
|
1367
|
+
return fn.apply(this, [arg1, _arg2]);
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1370
|
+
else if (p1 && !p2) {
|
|
1371
|
+
return _curry1(function (_arg1) {
|
|
1372
|
+
return fn.apply(this, [_arg1, arg2]);
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
else {
|
|
1376
|
+
return fn.apply(this, arguments);
|
|
1377
|
+
}
|
|
1378
|
+
};
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1381
|
+
const _curry3 = function _curry3(fn) {
|
|
1382
|
+
return function curried3(arg1, arg2, arg3) {
|
|
1383
|
+
const p1 = arguments.length < 1 || isPlaceholder(arg1);
|
|
1384
|
+
const p2 = arguments.length < 2 || isPlaceholder(arg2);
|
|
1385
|
+
const p3 = arguments.length < 3 || isPlaceholder(arg3);
|
|
1386
|
+
if (p1) {
|
|
1387
|
+
if (p2 && p3) {
|
|
1388
|
+
return curried3;
|
|
1389
|
+
}
|
|
1390
|
+
else if (p2 && !p3) {
|
|
1391
|
+
return _curry2(function (_arg1, _arg2) {
|
|
1392
|
+
return fn.apply(this, [_arg1, _arg2, arg3]);
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
else if (!p2 && p3) {
|
|
1396
|
+
return _curry2(function (_arg1, _arg3) {
|
|
1397
|
+
return fn.apply(this, [_arg1, arg2, _arg3]);
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
else {
|
|
1401
|
+
return _curry1(function (_arg1) {
|
|
1402
|
+
return fn.apply(this, [_arg1, arg2, arg3]);
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
else {
|
|
1407
|
+
if (p2 && p3) {
|
|
1408
|
+
return _curry2(function (_arg2, _arg3) {
|
|
1409
|
+
return fn.apply(this, [arg1, _arg2, _arg3]);
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
else if (p2 && !p3) {
|
|
1413
|
+
return _curry1(function (_arg2) {
|
|
1414
|
+
return fn.apply(this, [arg1, _arg2, arg3]);
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
else if (!p2 && p3) {
|
|
1418
|
+
return _curry1(function (_arg3) {
|
|
1419
|
+
return fn.apply(this, [arg1, arg2, _arg3]);
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
else {
|
|
1423
|
+
return fn.apply(this, arguments);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
const _curryAny = function _curryAny(fn, args) {
|
|
1430
|
+
return function curriedAny(...currentArguments) {
|
|
1431
|
+
const currArgs = _mergeArguments(args, currentArguments);
|
|
1432
|
+
if (_countArguments(currArgs) >= fn.length) {
|
|
1433
|
+
return fn.apply(this, currArgs);
|
|
1434
|
+
}
|
|
1435
|
+
else
|
|
1436
|
+
return _curryAny.apply(this, [fn, currArgs]);
|
|
1437
|
+
};
|
|
1438
|
+
};
|
|
1439
|
+
function _mergeArguments(args, currentArguments) {
|
|
1440
|
+
let p1 = 0;
|
|
1441
|
+
const res = args.concat([]);
|
|
1442
|
+
for (let i = 0; i < currentArguments.length; i++) {
|
|
1443
|
+
while (!isPlaceholder(res[p1]) && p1 < res.length)
|
|
1444
|
+
p1++;
|
|
1445
|
+
res[p1] = currentArguments[i];
|
|
1446
|
+
p1++;
|
|
1447
|
+
}
|
|
1448
|
+
return res;
|
|
1449
|
+
}
|
|
1450
|
+
function _countArguments(args) {
|
|
1451
|
+
for (let i = 0; i < args.length; i++) {
|
|
1452
|
+
if (isPlaceholder(args[i]))
|
|
1453
|
+
return i;
|
|
1454
|
+
}
|
|
1455
|
+
return args.length;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
function _curryMore(fn) {
|
|
1459
|
+
if (typeof fn !== 'function') {
|
|
1460
|
+
throw new Error('Invalid fn parameter: fn is not a function.');
|
|
1461
|
+
}
|
|
1462
|
+
const fnStr = fn.toString();
|
|
1463
|
+
const rightBracket = fnStr.indexOf(')');
|
|
1464
|
+
if (rightBracket < 3 || /=|\.{3}/.test(fnStr.substring(0, rightBracket))) {
|
|
1465
|
+
return _curryAny(fn, []);
|
|
1466
|
+
}
|
|
1467
|
+
switch (fn.length) {
|
|
1468
|
+
case 0:
|
|
1469
|
+
return fn;
|
|
1470
|
+
case 1:
|
|
1471
|
+
return _curry1(fn);
|
|
1472
|
+
case 2:
|
|
1473
|
+
return _curry2(fn);
|
|
1474
|
+
case 3:
|
|
1475
|
+
return _curry3(fn);
|
|
1476
|
+
default:
|
|
1477
|
+
return _curryAny(fn, []);
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
function _throttle(fn, delay, options) {
|
|
1482
|
+
var _a, _b, _c;
|
|
1483
|
+
const trailing = (_a = options === null || options === void 0 ? void 0 : options.trailing) !== null && _a !== void 0 ? _a : false;
|
|
1484
|
+
const trailingRunLast = (_b = options === null || options === void 0 ? void 0 : options.trailingRunLast) !== null && _b !== void 0 ? _b : true;
|
|
1485
|
+
const leading = (_c = options === null || options === void 0 ? void 0 : options.leading) !== null && _c !== void 0 ? _c : true;
|
|
1486
|
+
let timer = null;
|
|
1487
|
+
let lastTime = 0;
|
|
1488
|
+
const clearTimer = () => {
|
|
1489
|
+
if (timer) {
|
|
1490
|
+
clearInterval(timer);
|
|
1491
|
+
timer = null;
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
const reset = () => {
|
|
1495
|
+
clearTimer();
|
|
1496
|
+
lastTime = 0;
|
|
1497
|
+
};
|
|
1498
|
+
return Object.assign(function (...args) {
|
|
1499
|
+
const now = Date.now();
|
|
1500
|
+
const timeGap = now - lastTime - delay;
|
|
1501
|
+
if (timeGap >= 0) {
|
|
1502
|
+
lastTime = now;
|
|
1503
|
+
clearTimer();
|
|
1504
|
+
}
|
|
1505
|
+
if (timeGap < 0 && trailing && trailingRunLast && timer) {
|
|
1506
|
+
clearTimer();
|
|
1507
|
+
}
|
|
1508
|
+
if (timeGap >= 0 && leading) {
|
|
1509
|
+
fn.apply(this, args);
|
|
1510
|
+
}
|
|
1511
|
+
else if (timeGap >= 0 || (timeGap < 0 && trailing && !timer)) {
|
|
1512
|
+
timer = setTimeout(() => {
|
|
1513
|
+
lastTime = Date.now();
|
|
1514
|
+
timer = null;
|
|
1515
|
+
fn.apply(this, args);
|
|
1516
|
+
}, timeGap >= 0 ? delay : -timeGap);
|
|
1517
|
+
}
|
|
1518
|
+
}, { reset });
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
function debounce(fn, delay, options) {
|
|
1522
|
+
if (!isNumber(delay) || !isFinite(delay) || delay <= 0) {
|
|
1523
|
+
throw new Error('Invalid delay parameter');
|
|
1524
|
+
}
|
|
1525
|
+
return _throttle(fn, delay, Object.assign({ trailing: true, leading: false, trailingRunLast: true }, options));
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
function _cloneArray(obj, map, cloner, ...args) {
|
|
1529
|
+
const res = obj.slice();
|
|
1530
|
+
map.set(obj, res);
|
|
1531
|
+
for (let index = 0; index < obj.length; index++) {
|
|
1532
|
+
res[index] = cloner(obj[index], map, ...args);
|
|
1533
|
+
}
|
|
1534
|
+
return res;
|
|
1535
|
+
}
|
|
1536
|
+
function _cloneMap(obj, map, cloner, ...args) {
|
|
1537
|
+
const res = new Map();
|
|
1538
|
+
map.set(obj, res);
|
|
1539
|
+
obj.forEach((value, key) => {
|
|
1540
|
+
res.set(cloner(key, map, ...args), cloner(value, map, ...args));
|
|
1541
|
+
});
|
|
1542
|
+
return res;
|
|
1543
|
+
}
|
|
1544
|
+
function _cloneSet(obj, map, cloner, ...args) {
|
|
1545
|
+
const res = new Set();
|
|
1546
|
+
map.set(obj, res);
|
|
1547
|
+
obj.forEach((item) => res.add(cloner(item, map, ...args)));
|
|
1548
|
+
return res;
|
|
1549
|
+
}
|
|
1550
|
+
function _cloneFormData(obj, map, cloner, ...args) {
|
|
1551
|
+
const res = new FormData();
|
|
1552
|
+
map.set(obj, res);
|
|
1553
|
+
obj.forEach((value, key) => {
|
|
1554
|
+
res.append(key, cloner(value, map, ...args));
|
|
1555
|
+
});
|
|
1556
|
+
return res;
|
|
1557
|
+
}
|
|
1558
|
+
function _cloneArrayBuffer(obj, map) {
|
|
1559
|
+
const res = new ArrayBuffer(obj.byteLength);
|
|
1560
|
+
map.set(obj, res);
|
|
1561
|
+
new Uint8Array(res).set(new Uint8Array(obj));
|
|
1562
|
+
return res;
|
|
1563
|
+
}
|
|
1564
|
+
function _cloneBlob(obj, map) {
|
|
1565
|
+
const res = obj.slice(0, obj.size, obj.type);
|
|
1566
|
+
map.set(obj, res);
|
|
1567
|
+
return res;
|
|
1568
|
+
}
|
|
1569
|
+
function _cloneFile(obj, map) {
|
|
1570
|
+
const res = new File([obj], obj.name, { type: obj.type, lastModified: obj.lastModified });
|
|
1571
|
+
map.set(obj, res);
|
|
1572
|
+
return res;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
function _deepClone(obj, map, options) {
|
|
1576
|
+
if (map.has(obj))
|
|
1577
|
+
return map.get(obj);
|
|
1578
|
+
if (options.customCloner.length) {
|
|
1579
|
+
for (let i = 0; i < options.customCloner.length; i++) {
|
|
1580
|
+
const { cloner, judger } = options.customCloner[i];
|
|
1581
|
+
if (judger(obj)) {
|
|
1582
|
+
const res = cloner(obj, map);
|
|
1583
|
+
map.set(obj, res);
|
|
1584
|
+
return res;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
if (!isObject(obj) || isFunction(obj) || isWeakMap(obj) || isWeakSet(obj) || isPromise(obj))
|
|
1589
|
+
return obj;
|
|
1590
|
+
if (isArray(obj))
|
|
1591
|
+
return _cloneArray(obj, map, _deepClone, options);
|
|
1592
|
+
if (isMap(obj))
|
|
1593
|
+
return _cloneMap(obj, map, _deepClone, options);
|
|
1594
|
+
if (isSet(obj))
|
|
1595
|
+
return _cloneSet(obj, map, _deepClone, options);
|
|
1596
|
+
if (isFormData(obj))
|
|
1597
|
+
return _cloneFormData(obj, map, _deepClone, options);
|
|
1598
|
+
let res;
|
|
1599
|
+
if (obj instanceof Date) {
|
|
1600
|
+
res = new Date(obj.valueOf());
|
|
1601
|
+
map.set(obj, res);
|
|
1602
|
+
}
|
|
1603
|
+
else if (obj instanceof RegExp) {
|
|
1604
|
+
res = new RegExp(obj.source, obj.flags);
|
|
1605
|
+
map.set(obj, res);
|
|
1606
|
+
}
|
|
1607
|
+
else if (obj instanceof ArrayBuffer) {
|
|
1608
|
+
res = _cloneArrayBuffer(obj, map);
|
|
1609
|
+
}
|
|
1610
|
+
else if (isTypedArray(obj)) {
|
|
1611
|
+
res = new obj.constructor(_cloneArrayBuffer(obj.buffer, map), obj.byteOffset, obj.length);
|
|
1612
|
+
map.set(obj, res);
|
|
1613
|
+
}
|
|
1614
|
+
else if (obj instanceof DataView) {
|
|
1615
|
+
res = new DataView(map.has(obj.buffer) ? map.get(obj.buffer) : _cloneArrayBuffer(obj.buffer, map), obj.byteOffset, obj.byteLength);
|
|
1616
|
+
map.set(obj, res);
|
|
1617
|
+
}
|
|
1618
|
+
else if (isFile(obj)) {
|
|
1619
|
+
res = _cloneFile(obj, map);
|
|
1620
|
+
}
|
|
1621
|
+
else if (isBlob(obj)) {
|
|
1622
|
+
res = _cloneBlob(obj, map);
|
|
1623
|
+
}
|
|
1624
|
+
else if (isWrapperObject(obj)) {
|
|
1625
|
+
res = Object(obj.valueOf());
|
|
1626
|
+
map.set(obj, res);
|
|
1627
|
+
}
|
|
1628
|
+
else {
|
|
1629
|
+
res = options.clonePrototype ? Object.create(Object.getPrototypeOf(obj)) : {};
|
|
1630
|
+
map.set(obj, res);
|
|
1631
|
+
Reflect.ownKeys(obj).forEach((key) => {
|
|
1632
|
+
if (!options.cloneSymbol && typeof key === 'symbol')
|
|
1633
|
+
return;
|
|
1634
|
+
if (options.cloneDescriptor) {
|
|
1635
|
+
const val = Object.getOwnPropertyDescriptor(obj, key);
|
|
1636
|
+
if (!val)
|
|
1637
|
+
return;
|
|
1638
|
+
if (val.value)
|
|
1639
|
+
val.value = _deepClone(val.value, map, options);
|
|
1640
|
+
Object.defineProperty(res, key, val);
|
|
1641
|
+
}
|
|
1642
|
+
else {
|
|
1643
|
+
Reflect.set(res, key, _deepClone(Reflect.get(obj, key), map, options));
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
return res;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
function deepClone(obj, options, map) {
|
|
1651
|
+
if (!isMap(map))
|
|
1652
|
+
map = new Map();
|
|
1653
|
+
const res = _deepClone(obj, map, Object.assign({ cloneSymbol: true, clonePrototype: false, cloneDescriptor: false, customCloner: [] }, options));
|
|
1654
|
+
map.clear();
|
|
1655
|
+
return res;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
const $$Empty = Object.freeze({ '@@merge/placeholder': true });
|
|
1659
|
+
function getMergeStrategy(targetType, sourceType, strategy) {
|
|
1660
|
+
return (strategy[`${sourceType}2${targetType}`] ||
|
|
1661
|
+
strategy[`${sourceType}2Any`] ||
|
|
1662
|
+
strategy[`Any2${targetType}`] ||
|
|
1663
|
+
strategy[`Any2Any`] ||
|
|
1664
|
+
'override');
|
|
1665
|
+
}
|
|
1666
|
+
function getBaseMargeType(obj) {
|
|
1667
|
+
if (isMergeEmptyPlaceholder(obj))
|
|
1668
|
+
return 'Empty';
|
|
1669
|
+
const _tag = getTag(obj);
|
|
1670
|
+
if (/Function/.test(_tag))
|
|
1671
|
+
return 'Function';
|
|
1672
|
+
if (/Iterator/.test(_tag))
|
|
1673
|
+
return 'Iterator';
|
|
1674
|
+
if (/(?:8|16|32|64)Array/.test(_tag))
|
|
1675
|
+
return 'TypedArray';
|
|
1676
|
+
if (/Error/.test(_tag))
|
|
1677
|
+
return 'Error';
|
|
1678
|
+
return _tag;
|
|
1679
|
+
}
|
|
1680
|
+
function isMergeEmptyPlaceholder(arg) {
|
|
1681
|
+
return typeof arg === 'object' && Boolean(arg) && arg['@@merge/placeholder'] === true;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
function _deepMergeBase(target, source, option, map, path, cloner) {
|
|
1685
|
+
const targetType = getBaseMargeType(target);
|
|
1686
|
+
const sourceType = getBaseMargeType(source);
|
|
1687
|
+
const strategy = getMergeStrategy(targetType, sourceType, option.typeStrategy);
|
|
1688
|
+
if (isFunction(strategy)) {
|
|
1689
|
+
const merger = _curryMore(_deepMergeBase)(_, _, option, map, _, cloner);
|
|
1690
|
+
const mergeRes = strategy({
|
|
1691
|
+
target,
|
|
1692
|
+
source,
|
|
1693
|
+
cloner,
|
|
1694
|
+
merger,
|
|
1695
|
+
path,
|
|
1696
|
+
typeStrategy: option.typeStrategy,
|
|
1697
|
+
unhandledValue: $$Empty,
|
|
1698
|
+
map,
|
|
1699
|
+
});
|
|
1700
|
+
if (!isMergeEmptyPlaceholder(mergeRes))
|
|
1701
|
+
return mergeRes;
|
|
1702
|
+
}
|
|
1703
|
+
if (strategy === 'keep') {
|
|
1704
|
+
if (isMergeEmptyPlaceholder(target))
|
|
1705
|
+
return $$Empty;
|
|
1706
|
+
return cloner(target);
|
|
1707
|
+
}
|
|
1708
|
+
else if (strategy === 'override') {
|
|
1709
|
+
return cloner(source);
|
|
1710
|
+
}
|
|
1711
|
+
else {
|
|
1712
|
+
return cloner(source);
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
const defaultMergeStrategy = {
|
|
1716
|
+
Any2Any: 'override',
|
|
1717
|
+
Any2Empty: 'override',
|
|
1718
|
+
Any2Null: 'override',
|
|
1719
|
+
Any2Undefined: 'override',
|
|
1720
|
+
Null2Any: 'keep',
|
|
1721
|
+
Undefined2Any: 'keep',
|
|
1722
|
+
Null2Empty: 'override',
|
|
1723
|
+
Undefined2Empty: 'override',
|
|
1724
|
+
Number2Any: 'keep',
|
|
1725
|
+
Number2Number: 'override',
|
|
1726
|
+
String2Any: 'keep',
|
|
1727
|
+
String2String: 'override',
|
|
1728
|
+
Boolean2Any: 'keep',
|
|
1729
|
+
Boolean2Boolean: 'override',
|
|
1730
|
+
Symbol2Any: 'keep',
|
|
1731
|
+
Symbol2Symbol: 'override',
|
|
1732
|
+
BigInt2Any: 'keep',
|
|
1733
|
+
BigInt2BigInt: 'override',
|
|
1734
|
+
Number2Empty: 'override',
|
|
1735
|
+
String2Empty: 'override',
|
|
1736
|
+
Boolean2Empty: 'override',
|
|
1737
|
+
Symbol2Empty: 'override',
|
|
1738
|
+
BigInt2Empty: 'override',
|
|
1739
|
+
Number2Null: 'override',
|
|
1740
|
+
String2Null: 'override',
|
|
1741
|
+
Boolean2Null: 'override',
|
|
1742
|
+
Symbol2Null: 'override',
|
|
1743
|
+
BigInt2Null: 'override',
|
|
1744
|
+
Number2Undefined: 'override',
|
|
1745
|
+
String2Undefined: 'override',
|
|
1746
|
+
Boolean2Undefined: 'override',
|
|
1747
|
+
Symbol2Undefined: 'override',
|
|
1748
|
+
BigInt2Undefined: 'override',
|
|
1749
|
+
Object2Object: (({ target, source, cloner, path, merger }) => {
|
|
1750
|
+
const res = cloner(target);
|
|
1751
|
+
Reflect.ownKeys(source).forEach((key) => {
|
|
1752
|
+
const newPath = [...path, key];
|
|
1753
|
+
if (key in res) {
|
|
1754
|
+
res[key] = merger(res[key], source[key], newPath);
|
|
1755
|
+
}
|
|
1756
|
+
else {
|
|
1757
|
+
const mergeRes = merger($$Empty, source[key], newPath);
|
|
1758
|
+
if (!isMergeEmptyPlaceholder(mergeRes))
|
|
1759
|
+
res[key] = mergeRes;
|
|
1760
|
+
}
|
|
1761
|
+
});
|
|
1762
|
+
return res;
|
|
1763
|
+
}),
|
|
1764
|
+
Object2FormData: (({ target, source, cloner, path, merger }) => {
|
|
1765
|
+
const res = cloner(target);
|
|
1766
|
+
Reflect.ownKeys(source).forEach((key) => {
|
|
1767
|
+
if (isSymbol(key))
|
|
1768
|
+
return;
|
|
1769
|
+
const newPath = [...path, key];
|
|
1770
|
+
if (res.has(key)) {
|
|
1771
|
+
res.set(key, merger(res.get(key), source[key], newPath));
|
|
1772
|
+
}
|
|
1773
|
+
else {
|
|
1774
|
+
const mergeRes = merger($$Empty, source[key], newPath);
|
|
1775
|
+
if (!isMergeEmptyPlaceholder(mergeRes))
|
|
1776
|
+
res.set(key, mergeRes);
|
|
1777
|
+
}
|
|
1778
|
+
});
|
|
1779
|
+
return res;
|
|
1780
|
+
}),
|
|
1781
|
+
FormData2Object: (({ target, source, cloner, path, merger }) => {
|
|
1782
|
+
const res = cloner(target);
|
|
1783
|
+
source.forEach((val, key) => {
|
|
1784
|
+
const newPath = [...path, key];
|
|
1785
|
+
if (key in res) {
|
|
1786
|
+
res[key] = merger(res[key], val, newPath);
|
|
1787
|
+
}
|
|
1788
|
+
else {
|
|
1789
|
+
const mergeRes = merger($$Empty, val, newPath);
|
|
1790
|
+
if (!isMergeEmptyPlaceholder(mergeRes))
|
|
1791
|
+
res[key] = mergeRes;
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
return res;
|
|
1795
|
+
}),
|
|
1796
|
+
FormData2FormData: (({ target, source, cloner, path, merger }) => {
|
|
1797
|
+
const res = cloner(target);
|
|
1798
|
+
source.forEach((val, key) => {
|
|
1799
|
+
const newPath = [...path, key];
|
|
1800
|
+
if (res.has(key)) {
|
|
1801
|
+
res.set(key, merger(res.get(key), val, newPath));
|
|
1802
|
+
}
|
|
1803
|
+
else {
|
|
1804
|
+
const mergeRes = merger($$Empty, val, newPath);
|
|
1805
|
+
if (!isMergeEmptyPlaceholder(mergeRes))
|
|
1806
|
+
res.set(key, mergeRes);
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
return res;
|
|
1810
|
+
}),
|
|
1811
|
+
Set2Set: (({ target, source, cloner }) => {
|
|
1812
|
+
const res = cloner(target);
|
|
1813
|
+
for (const item of source)
|
|
1814
|
+
res.add(cloner(item));
|
|
1815
|
+
return res;
|
|
1816
|
+
}),
|
|
1817
|
+
Map2Map: (({ target, source, cloner }) => {
|
|
1818
|
+
const res = cloner(target);
|
|
1819
|
+
for (const [key, val] of source)
|
|
1820
|
+
res.set(cloner(key), cloner(val));
|
|
1821
|
+
return res;
|
|
1822
|
+
}),
|
|
1823
|
+
Array2Array: (({ target, source, cloner }) => {
|
|
1824
|
+
const res = cloner(target);
|
|
1825
|
+
for (const item of source)
|
|
1826
|
+
res.push(cloner(item));
|
|
1827
|
+
return res;
|
|
1828
|
+
}),
|
|
1829
|
+
Set2Array: (({ target, source, cloner }) => {
|
|
1830
|
+
const res = cloner(target);
|
|
1831
|
+
for (const item of source)
|
|
1832
|
+
res.push(cloner(item));
|
|
1833
|
+
return res;
|
|
1834
|
+
}),
|
|
1835
|
+
Array2Set: (({ target, source, cloner }) => {
|
|
1836
|
+
const res = cloner(target);
|
|
1837
|
+
for (const item of source)
|
|
1838
|
+
res.add(cloner(item));
|
|
1839
|
+
return res;
|
|
1840
|
+
}),
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
function deepMerge(target, source, option) {
|
|
1844
|
+
const typeStrategy = Object.assign(Object.assign({}, defaultMergeStrategy), ((option === null || option === void 0 ? void 0 : option.typeStrategy) || {}));
|
|
1845
|
+
const cloneOptions = Object.assign({ cloneSymbol: true, clonePrototype: false, cloneDescriptor: false, customCloner: [] }, ((option === null || option === void 0 ? void 0 : option.cloneOptions) || {}));
|
|
1846
|
+
const map = new Map();
|
|
1847
|
+
const cloner = _curryMore(_deepClone)(_, map, cloneOptions);
|
|
1848
|
+
const res = _deepMergeBase(target, source, { typeStrategy, cloneOptions }, map, [], cloner);
|
|
1849
|
+
map.clear();
|
|
1850
|
+
return res;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
function _fastClone(obj, map) {
|
|
1854
|
+
if (map.has(obj))
|
|
1855
|
+
return map.get(obj);
|
|
1856
|
+
if (!isObject(obj) || isFunction(obj) || isWeakMap(obj) || isWeakSet(obj) || isPromise(obj))
|
|
1857
|
+
return obj;
|
|
1858
|
+
if (isArray(obj))
|
|
1859
|
+
return _cloneArray(obj, map, _fastClone);
|
|
1860
|
+
if (isMap(obj))
|
|
1861
|
+
return _cloneMap(obj, map, _fastClone);
|
|
1862
|
+
if (isSet(obj))
|
|
1863
|
+
return _cloneSet(obj, map, _fastClone);
|
|
1864
|
+
if (isFormData(obj))
|
|
1865
|
+
return _cloneFormData(obj, map, _fastClone);
|
|
1866
|
+
let res;
|
|
1867
|
+
if (obj instanceof Date) {
|
|
1868
|
+
res = new Date(obj.valueOf());
|
|
1869
|
+
map.set(obj, res);
|
|
1870
|
+
}
|
|
1871
|
+
else if (obj instanceof RegExp) {
|
|
1872
|
+
res = new RegExp(obj.source, obj.flags);
|
|
1873
|
+
map.set(obj, res);
|
|
1874
|
+
}
|
|
1875
|
+
else {
|
|
1876
|
+
res = {};
|
|
1877
|
+
map.set(obj, res);
|
|
1878
|
+
Object.keys(obj).forEach((key) => {
|
|
1879
|
+
res[key] = _fastClone(obj[key], map);
|
|
1880
|
+
});
|
|
1881
|
+
}
|
|
1882
|
+
return res;
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
function fastClone(obj, map) {
|
|
1886
|
+
if (!isMap(map))
|
|
1887
|
+
map = new Map();
|
|
1888
|
+
const res = _fastClone(obj, map);
|
|
1889
|
+
map.clear();
|
|
1890
|
+
return res;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
function isEmpty(value) {
|
|
1894
|
+
if (value === null || value === undefined)
|
|
1895
|
+
return true;
|
|
1896
|
+
if (typeof value !== 'object') {
|
|
1897
|
+
if (value === '' || value === 0)
|
|
1898
|
+
return true;
|
|
1899
|
+
if (typeof value === 'function')
|
|
1900
|
+
return false;
|
|
1901
|
+
return false;
|
|
1902
|
+
}
|
|
1903
|
+
else {
|
|
1904
|
+
if (isArrayLike(value))
|
|
1905
|
+
return !value.length;
|
|
1906
|
+
if (isBuffer(value) || isArrayBuffer(value))
|
|
1907
|
+
return !value.byteLength;
|
|
1908
|
+
if (isDate(value))
|
|
1909
|
+
return isNaN(value.getTime());
|
|
1910
|
+
if (isSet(value) || isMap(value))
|
|
1911
|
+
return !value.size;
|
|
1912
|
+
for (const key in value) {
|
|
1913
|
+
if (Object.prototype.hasOwnProperty.call(value, key))
|
|
1914
|
+
return false;
|
|
1915
|
+
}
|
|
1916
|
+
return true;
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
function _getKey(args) {
|
|
1921
|
+
function toString(item) {
|
|
1922
|
+
if (isBigInt(item))
|
|
1923
|
+
return String(item) + 'n';
|
|
1924
|
+
if (isRegExp(item))
|
|
1925
|
+
return 'RegExp' + String(item);
|
|
1926
|
+
if (isDate(item))
|
|
1927
|
+
return 'Date' + item.toISOString();
|
|
1928
|
+
try {
|
|
1929
|
+
return JSON.stringify(item);
|
|
1930
|
+
}
|
|
1931
|
+
catch (e) {
|
|
1932
|
+
return String(item);
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
let res = 'ForeSlashMemoKey:[';
|
|
1936
|
+
for (let i = 0; i < args.length; i++) {
|
|
1937
|
+
res += toString(args[i]) + ',';
|
|
1938
|
+
}
|
|
1939
|
+
return res + ']';
|
|
1940
|
+
}
|
|
1941
|
+
function memo(fn, options) {
|
|
1942
|
+
const map = new Map();
|
|
1943
|
+
const getKey = (options === null || options === void 0 ? void 0 : options.getKey) ? options.getKey : _getKey;
|
|
1944
|
+
const setTtl = (options === null || options === void 0 ? void 0 : options.ttl) ? options.ttl : 0;
|
|
1945
|
+
const setCount = (options === null || options === void 0 ? void 0 : options.count) ? options.count : 0;
|
|
1946
|
+
return function (...args) {
|
|
1947
|
+
const key = getKey(args);
|
|
1948
|
+
if (map.has(key)) {
|
|
1949
|
+
const item = map.get(key);
|
|
1950
|
+
const { res, ttl, count } = item;
|
|
1951
|
+
const isValidCache = ttl >= Date.now() && count > 0;
|
|
1952
|
+
item.count -= 1;
|
|
1953
|
+
if (item.count <= 0)
|
|
1954
|
+
map.delete(key);
|
|
1955
|
+
if (ttl < Date.now())
|
|
1956
|
+
map.delete(key);
|
|
1957
|
+
if (isValidCache)
|
|
1958
|
+
return res;
|
|
1959
|
+
}
|
|
1960
|
+
const res = fn.apply(this, args);
|
|
1961
|
+
const memoItem = { res, ttl: Infinity, count: Infinity };
|
|
1962
|
+
if (setCount > 0)
|
|
1963
|
+
memoItem.count = setCount;
|
|
1964
|
+
if (setTtl > 0)
|
|
1965
|
+
memoItem.ttl = Date.now() + setTtl;
|
|
1966
|
+
map.set(key, memoItem);
|
|
1967
|
+
return res;
|
|
1968
|
+
};
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
function not(value) {
|
|
1972
|
+
return !Boolean(value);
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
function pass(value) {
|
|
1976
|
+
return value;
|
|
1977
|
+
}
|
|
1978
|
+
function passWith(fn) {
|
|
1979
|
+
return ((arg) => {
|
|
1980
|
+
fn(arg);
|
|
1981
|
+
return arg;
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
function pipe(...pipeFunc) {
|
|
1986
|
+
if (pipeFunc.length === 0) {
|
|
1987
|
+
throw new Error('Invalid pipeFunc parameter: pipeFunc is empty');
|
|
1988
|
+
}
|
|
1989
|
+
for (let i = 0; i < pipeFunc.length; i++) {
|
|
1990
|
+
if (typeof pipeFunc[i] !== 'function') {
|
|
1991
|
+
throw new Error(`Invalid pipeFunc parameter: pipeFunc[${i}] is not a function`);
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
return (...args) => {
|
|
1995
|
+
let result = pipeFunc[0](...args);
|
|
1996
|
+
for (let i = 1; i < pipeFunc.length; i++) {
|
|
1997
|
+
result = pipeFunc[i](result);
|
|
1998
|
+
}
|
|
1999
|
+
return result;
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
function throttle(fn, delay, options) {
|
|
2004
|
+
if (!isNumber(delay) || !isFinite(delay) || delay <= 0) {
|
|
2005
|
+
throw new Error('Invalid delay parameter');
|
|
2006
|
+
}
|
|
2007
|
+
return _throttle(fn, delay, Object.assign({ trailing: false, leading: true }, options));
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
exports.$$Empty = $$Empty;
|
|
2011
|
+
exports._ = _;
|
|
2012
|
+
exports.acceptableFileName = acceptableFileName;
|
|
2013
|
+
exports.acceptableFileType = acceptableFileType;
|
|
2014
|
+
exports.camelCase = camelCase;
|
|
2015
|
+
exports.capitalize = capitalize;
|
|
2016
|
+
exports.caseCamel = caseCamel;
|
|
2017
|
+
exports.caseConvert = caseConvert;
|
|
2018
|
+
exports.caseKebab = caseKebab;
|
|
2019
|
+
exports.casePascal = casePascal;
|
|
2020
|
+
exports.caseSnake = caseSnake;
|
|
2021
|
+
exports.clamp = clamp;
|
|
2022
|
+
exports.compose = compose;
|
|
2023
|
+
exports.curry = _curryMore;
|
|
2024
|
+
exports.debounce = debounce;
|
|
2025
|
+
exports.deepClone = deepClone;
|
|
2026
|
+
exports.deepMerge = deepMerge;
|
|
2027
|
+
exports.defer = defer;
|
|
2028
|
+
exports.fastClone = fastClone;
|
|
2029
|
+
exports.getAcceptableExtByMIME = getAcceptableExtByMIME;
|
|
2030
|
+
exports.getAcceptableMIMEByExt = getAcceptableMIMEByExt;
|
|
2031
|
+
exports.getGlobalThis = getGlobalThis;
|
|
2032
|
+
exports.getTag = getTag;
|
|
2033
|
+
exports.isArray = isArray;
|
|
2034
|
+
exports.isArrayBuffer = isArrayBuffer;
|
|
2035
|
+
exports.isArrayLike = isArrayLike;
|
|
2036
|
+
exports.isBigInt = isBigInt;
|
|
2037
|
+
exports.isBigInt64Array = isBigInt64Array;
|
|
2038
|
+
exports.isBigUint64Array = isBigUint64Array;
|
|
2039
|
+
exports.isBlob = isBlob;
|
|
2040
|
+
exports.isBoolean = isBoolean;
|
|
2041
|
+
exports.isBuffer = isBuffer;
|
|
2042
|
+
exports.isDataView = isDataView;
|
|
2043
|
+
exports.isDate = isDate;
|
|
2044
|
+
exports.isEmpty = isEmpty;
|
|
2045
|
+
exports.isFile = isFile;
|
|
2046
|
+
exports.isFloat32Array = isFloat32Array;
|
|
2047
|
+
exports.isFloat64Array = isFloat64Array;
|
|
2048
|
+
exports.isFormData = isFormData;
|
|
2049
|
+
exports.isFunction = isFunction;
|
|
2050
|
+
exports.isInt16Array = isInt16Array;
|
|
2051
|
+
exports.isInt32Array = isInt32Array;
|
|
2052
|
+
exports.isInt8Array = isInt8Array;
|
|
2053
|
+
exports.isInteger = isInteger;
|
|
2054
|
+
exports.isIterable = isIterable;
|
|
2055
|
+
exports.isMap = isMap;
|
|
2056
|
+
exports.isMergeEmptyPlaceholder = isMergeEmptyPlaceholder;
|
|
2057
|
+
exports.isNil = isNil;
|
|
2058
|
+
exports.isNull = isNull;
|
|
2059
|
+
exports.isNumber = isNumber;
|
|
2060
|
+
exports.isObject = isObject;
|
|
2061
|
+
exports.isPlaceholder = isPlaceholder;
|
|
2062
|
+
exports.isPrimitive = isPrimitive;
|
|
2063
|
+
exports.isPromise = isPromise;
|
|
2064
|
+
exports.isPromiseLike = isPromiseLike;
|
|
2065
|
+
exports.isRegExp = isRegExp;
|
|
2066
|
+
exports.isSet = isSet;
|
|
2067
|
+
exports.isString = isString;
|
|
2068
|
+
exports.isSymbol = isSymbol;
|
|
2069
|
+
exports.isTypedArray = isTypedArray;
|
|
2070
|
+
exports.isUint16Array = isUint16Array;
|
|
2071
|
+
exports.isUint32Array = isUint32Array;
|
|
2072
|
+
exports.isUint8Array = isUint8Array;
|
|
2073
|
+
exports.isUint8ClampedArray = isUint8ClampedArray;
|
|
2074
|
+
exports.isUndefined = isUndefined;
|
|
2075
|
+
exports.isWeakMap = isWeakMap;
|
|
2076
|
+
exports.isWeakSet = isWeakSet;
|
|
2077
|
+
exports.isWrapperBigInt = isWrapperBigInt;
|
|
2078
|
+
exports.isWrapperBoolean = isWrapperBoolean;
|
|
2079
|
+
exports.isWrapperNumber = isWrapperNumber;
|
|
2080
|
+
exports.isWrapperObject = isWrapperObject;
|
|
2081
|
+
exports.isWrapperString = isWrapperString;
|
|
2082
|
+
exports.isWrapperSymbol = isWrapperSymbol;
|
|
2083
|
+
exports.kebabCase = kebabCase;
|
|
2084
|
+
exports.memo = memo;
|
|
2085
|
+
exports.noop = noop;
|
|
2086
|
+
exports.not = not;
|
|
2087
|
+
exports.parallel = parallel;
|
|
2088
|
+
exports.pascalCase = pascalCase;
|
|
2089
|
+
exports.pass = pass;
|
|
2090
|
+
exports.passWith = passWith;
|
|
2091
|
+
exports.pipe = pipe;
|
|
2092
|
+
exports.randomBase32String = randomBase32String;
|
|
2093
|
+
exports.randomChoice = randomChoice;
|
|
2094
|
+
exports.randomHexString = randomHexString;
|
|
2095
|
+
exports.randomInt = randomInt;
|
|
2096
|
+
exports.randomIntFloor = randomIntFloor;
|
|
2097
|
+
exports.randomString = randomString;
|
|
2098
|
+
exports.range = range;
|
|
2099
|
+
exports.remove = remove;
|
|
2100
|
+
exports.retry = retry;
|
|
2101
|
+
exports.shuffle = shuffle;
|
|
2102
|
+
exports.sleep = sleep;
|
|
2103
|
+
exports.snakeCase = snakeCase;
|
|
2104
|
+
exports.splitWords = splitWords;
|
|
2105
|
+
exports.throttle = throttle;
|
|
2106
|
+
exports.titleCase = titleCase;
|
|
2107
|
+
exports.tryit = tryit;
|
|
2108
|
+
exports.ulid = ulid;
|
|
2109
|
+
exports.uncapitalize = uncapitalize;
|
|
2110
|
+
exports.uuidNil = uuidNil;
|
|
2111
|
+
exports.uuidV4 = uuidV4;
|
|
2112
|
+
exports.withResolvers = withResolvers;
|
|
1878
2113
|
|
|
1879
2114
|
}));
|