vitest 0.8.5 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-api-setup.da2f55ae.js → chunk-api-setup.7290422e.js} +4 -4
- package/dist/{chunk-constants.76cf224a.js → chunk-constants.e59013dc.js} +1 -1
- package/dist/{chunk-defaults.e85b72aa.js → chunk-defaults.9aa0ce42.js} +1 -1
- package/dist/{chunk-integrations-globals.3713535d.js → chunk-integrations-globals.c040aaa9.js} +5 -6
- package/dist/{chunk-runtime-chain.c86f1eb0.js → chunk-runtime-chain.94cf66a4.js} +195 -2615
- package/dist/{chunk-runtime-mocker.7cc59bee.js → chunk-runtime-mocker.7f4b1850.js} +6 -5
- package/dist/chunk-runtime-rpc.4b80b6bd.js +7 -0
- package/dist/{chunk-utils-base.aff0a195.js → chunk-utils-global.10dcdfa6.js} +18 -1
- package/dist/{chunk-utils-timers.5657f2a4.js → chunk-utils-timers.4800834c.js} +2433 -10
- package/dist/{chunk-vite-node-externalize.e472da7d.js → chunk-vite-node-externalize.ddf2a6fb.js} +56 -19
- package/dist/{chunk-vite-node-utils.a6890356.js → chunk-vite-node-utils.7f0053fb.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/entry.js +8 -8
- package/dist/index.d.ts +10 -6
- package/dist/index.js +4 -5
- package/dist/node.d.ts +4 -1
- package/dist/node.js +7 -8
- package/dist/worker.js +5 -6
- package/package.json +4 -4
- package/dist/chunk-runtime-rpc.5263102e.js +0 -8
- package/dist/chunk-utils-global.7bcfa03c.js +0 -5
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import require$$0, { format
|
|
2
|
-
import { i as isObject, t as toArray, n as noop, a as index$1,
|
|
3
|
-
import { g as
|
|
4
|
-
import { s as setTimeout, c as clearTimeout, g as getOriginalPos, p as posToNumber, n as numberToPos, l as lineSplitRE, a as parseStacktrace, u as unifiedDiff } from './chunk-utils-timers.5657f2a4.js';
|
|
1
|
+
import require$$0, { format } from 'util';
|
|
2
|
+
import { g as getWorkerState, i as isObject, t as toArray, n as noop, a as index$1, b as getCallLastIndex, s as slash, c as getNames, d as assertTypes, e as c, r as resetModules } from './chunk-utils-global.10dcdfa6.js';
|
|
3
|
+
import { s as setTimeout, c as clearTimeout, p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, d as stringify, m as matcherUtils } from './chunk-utils-timers.4800834c.js';
|
|
5
4
|
import chai$1, { expect as expect$1, util, assert, should } from 'chai';
|
|
6
5
|
import { c as commonjsRequire, a as commonjsGlobal } from './vendor-_commonjsHelpers.34b404ce.js';
|
|
7
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.4b80b6bd.js';
|
|
8
7
|
import fs, { promises } from 'fs';
|
|
9
8
|
import { isMockFunction, spyOn, fn, spies } from './spy.js';
|
|
10
9
|
|
|
11
|
-
var __defProp$
|
|
10
|
+
var __defProp$4 = Object.defineProperty;
|
|
12
11
|
var __defProps$2 = Object.defineProperties;
|
|
13
12
|
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
14
|
-
var __getOwnPropSymbols$
|
|
15
|
-
var __hasOwnProp$
|
|
16
|
-
var __propIsEnum$
|
|
17
|
-
var __defNormalProp$
|
|
18
|
-
var __spreadValues$
|
|
13
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
14
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
17
|
+
var __spreadValues$4 = (a, b) => {
|
|
19
18
|
for (var prop in b || (b = {}))
|
|
20
|
-
if (__hasOwnProp$
|
|
21
|
-
__defNormalProp$
|
|
22
|
-
if (__getOwnPropSymbols$
|
|
23
|
-
for (var prop of __getOwnPropSymbols$
|
|
24
|
-
if (__propIsEnum$
|
|
25
|
-
__defNormalProp$
|
|
19
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
20
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
21
|
+
if (__getOwnPropSymbols$4)
|
|
22
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
23
|
+
if (__propIsEnum$4.call(b, prop))
|
|
24
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
26
25
|
}
|
|
27
26
|
return a;
|
|
28
27
|
};
|
|
@@ -35,7 +34,7 @@ function createChainable(keys, fn) {
|
|
|
35
34
|
for (const key of keys) {
|
|
36
35
|
Object.defineProperty(chain2, key, {
|
|
37
36
|
get() {
|
|
38
|
-
return create(__spreadProps$2(__spreadValues$
|
|
37
|
+
return create(__spreadProps$2(__spreadValues$4({}, obj), { [key]: true }));
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
}
|
|
@@ -111,7 +110,7 @@ function getHooks(key) {
|
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
const suite = createSuite();
|
|
114
|
-
const test
|
|
113
|
+
const test = createTest(function(name, fn, timeout) {
|
|
115
114
|
getCurrentSuite().test.fn.call(this, name, fn, timeout);
|
|
116
115
|
});
|
|
117
116
|
function formatTitle(template, items, idx) {
|
|
@@ -119,7 +118,7 @@ function formatTitle(template, items, idx) {
|
|
|
119
118
|
template = template.replace(/%%/g, "__vitest_escaped_%__").replace(/%#/g, `${idx}`).replace(/__vitest_escaped_%__/g, "%%");
|
|
120
119
|
}
|
|
121
120
|
const count = template.split("%").length - 1;
|
|
122
|
-
let formatted = format
|
|
121
|
+
let formatted = format(template, ...items.slice(0, count));
|
|
123
122
|
if (isObject(items[0])) {
|
|
124
123
|
formatted = formatted.replace(/\$([$\w_]+)/g, (_, key) => {
|
|
125
124
|
return items[0][key];
|
|
@@ -128,7 +127,7 @@ function formatTitle(template, items, idx) {
|
|
|
128
127
|
return formatted;
|
|
129
128
|
}
|
|
130
129
|
const describe = suite;
|
|
131
|
-
const it = test
|
|
130
|
+
const it = test;
|
|
132
131
|
const defaultSuite = suite("");
|
|
133
132
|
function clearContext() {
|
|
134
133
|
context.tasks.length = 0;
|
|
@@ -458,14 +457,14 @@ function isA(typeName, value) {
|
|
|
458
457
|
function isDomNode(obj) {
|
|
459
458
|
return obj !== null && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string" && typeof obj.isEqualNode === "function";
|
|
460
459
|
}
|
|
461
|
-
const IS_KEYED_SENTINEL
|
|
462
|
-
const IS_SET_SENTINEL
|
|
463
|
-
const IS_ORDERED_SENTINEL
|
|
460
|
+
const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
|
|
461
|
+
const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
|
|
462
|
+
const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
|
|
464
463
|
function isImmutableUnorderedKeyed(maybeKeyed) {
|
|
465
|
-
return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL
|
|
464
|
+
return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL] && !maybeKeyed[IS_ORDERED_SENTINEL]);
|
|
466
465
|
}
|
|
467
466
|
function isImmutableUnorderedSet(maybeSet) {
|
|
468
|
-
return !!(maybeSet && maybeSet[IS_SET_SENTINEL
|
|
467
|
+
return !!(maybeSet && maybeSet[IS_SET_SENTINEL] && !maybeSet[IS_ORDERED_SENTINEL]);
|
|
469
468
|
}
|
|
470
469
|
const IteratorSymbol = Symbol.iterator;
|
|
471
470
|
const hasIterator = (object) => !!(object != null && object[IteratorSymbol]);
|
|
@@ -519,2480 +518,178 @@ const iterableEquality = (a, b, aStack = [], bStack = []) => {
|
|
|
519
518
|
iterableEqualityWithStack
|
|
520
519
|
]);
|
|
521
520
|
}
|
|
522
|
-
if (matchedValue === true)
|
|
523
|
-
has = true;
|
|
524
|
-
}
|
|
525
|
-
if (has === false) {
|
|
526
|
-
allFound = false;
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
aStack.pop();
|
|
532
|
-
bStack.pop();
|
|
533
|
-
return allFound;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
const bIterator = b[IteratorSymbol]();
|
|
537
|
-
for (const aValue of a) {
|
|
538
|
-
const nextB = bIterator.next();
|
|
539
|
-
if (nextB.done || !equals(aValue, nextB.value, [iterableEqualityWithStack]))
|
|
540
|
-
return false;
|
|
541
|
-
}
|
|
542
|
-
if (!bIterator.next().done)
|
|
543
|
-
return false;
|
|
544
|
-
aStack.pop();
|
|
545
|
-
bStack.pop();
|
|
546
|
-
return true;
|
|
547
|
-
};
|
|
548
|
-
const hasPropertyInObject = (object, key) => {
|
|
549
|
-
const shouldTerminate = !object || typeof object !== "object" || object === Object.prototype;
|
|
550
|
-
if (shouldTerminate)
|
|
551
|
-
return false;
|
|
552
|
-
return Object.prototype.hasOwnProperty.call(object, key) || hasPropertyInObject(Object.getPrototypeOf(object), key);
|
|
553
|
-
};
|
|
554
|
-
const isObjectWithKeys = (a) => isObject(a) && !(a instanceof Error) && !(a instanceof Array) && !(a instanceof Date);
|
|
555
|
-
const subsetEquality = (object, subset) => {
|
|
556
|
-
const subsetEqualityWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => (object2, subset2) => {
|
|
557
|
-
if (!isObjectWithKeys(subset2))
|
|
558
|
-
return void 0;
|
|
559
|
-
return Object.keys(subset2).every((key) => {
|
|
560
|
-
if (isObjectWithKeys(subset2[key])) {
|
|
561
|
-
if (seenReferences.has(subset2[key]))
|
|
562
|
-
return equals(object2[key], subset2[key], [iterableEquality]);
|
|
563
|
-
seenReferences.set(subset2[key], true);
|
|
564
|
-
}
|
|
565
|
-
const result = object2 != null && hasPropertyInObject(object2, key) && equals(object2[key], subset2[key], [
|
|
566
|
-
iterableEquality,
|
|
567
|
-
subsetEqualityWithContext(seenReferences)
|
|
568
|
-
]);
|
|
569
|
-
seenReferences.delete(subset2[key]);
|
|
570
|
-
return result;
|
|
571
|
-
});
|
|
572
|
-
};
|
|
573
|
-
return subsetEqualityWithContext()(object, subset);
|
|
574
|
-
};
|
|
575
|
-
const typeEquality = (a, b) => {
|
|
576
|
-
if (a == null || b == null || a.constructor === b.constructor)
|
|
577
|
-
return void 0;
|
|
578
|
-
return false;
|
|
579
|
-
};
|
|
580
|
-
const arrayBufferEquality = (a, b) => {
|
|
581
|
-
if (!(a instanceof ArrayBuffer) || !(b instanceof ArrayBuffer))
|
|
582
|
-
return void 0;
|
|
583
|
-
const dataViewA = new DataView(a);
|
|
584
|
-
const dataViewB = new DataView(b);
|
|
585
|
-
if (dataViewA.byteLength !== dataViewB.byteLength)
|
|
586
|
-
return false;
|
|
587
|
-
for (let i = 0; i < dataViewA.byteLength; i++) {
|
|
588
|
-
if (dataViewA.getUint8(i) !== dataViewB.getUint8(i))
|
|
589
|
-
return false;
|
|
590
|
-
}
|
|
591
|
-
return true;
|
|
592
|
-
};
|
|
593
|
-
const sparseArrayEquality = (a, b) => {
|
|
594
|
-
if (!Array.isArray(a) || !Array.isArray(b))
|
|
595
|
-
return void 0;
|
|
596
|
-
const aKeys = Object.keys(a);
|
|
597
|
-
const bKeys = Object.keys(b);
|
|
598
|
-
return equals(a, b, [iterableEquality, typeEquality], true) && equals(aKeys, bKeys);
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
var naturalCompare$2 = {exports: {}};
|
|
602
|
-
|
|
603
|
-
/*
|
|
604
|
-
* @version 1.4.0
|
|
605
|
-
* @date 2015-10-26
|
|
606
|
-
* @stability 3 - Stable
|
|
607
|
-
* @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
|
|
608
|
-
* @license MIT License
|
|
609
|
-
*/
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
var naturalCompare = function(a, b) {
|
|
613
|
-
var i, codeA
|
|
614
|
-
, codeB = 1
|
|
615
|
-
, posA = 0
|
|
616
|
-
, posB = 0
|
|
617
|
-
, alphabet = String.alphabet;
|
|
618
|
-
|
|
619
|
-
function getCode(str, pos, code) {
|
|
620
|
-
if (code) {
|
|
621
|
-
for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i;
|
|
622
|
-
return +str.slice(pos - 1, i)
|
|
623
|
-
}
|
|
624
|
-
code = alphabet && alphabet.indexOf(str.charAt(pos));
|
|
625
|
-
return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code
|
|
626
|
-
: code < 46 ? 65 // -
|
|
627
|
-
: code < 48 ? code - 1
|
|
628
|
-
: code < 58 ? code + 18 // 0-9
|
|
629
|
-
: code < 65 ? code - 11
|
|
630
|
-
: code < 91 ? code + 11 // A-Z
|
|
631
|
-
: code < 97 ? code - 37
|
|
632
|
-
: code < 123 ? code + 5 // a-z
|
|
633
|
-
: code - 63
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
if ((a+="") != (b+="")) for (;codeB;) {
|
|
638
|
-
codeA = getCode(a, posA++);
|
|
639
|
-
codeB = getCode(b, posB++);
|
|
640
|
-
|
|
641
|
-
if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
|
|
642
|
-
codeA = getCode(a, posA, posA);
|
|
643
|
-
codeB = getCode(b, posB, posA = i);
|
|
644
|
-
posB = i;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
if (codeA != codeB) return (codeA < codeB) ? -1 : 1
|
|
648
|
-
}
|
|
649
|
-
return 0
|
|
650
|
-
};
|
|
651
|
-
|
|
652
|
-
try {
|
|
653
|
-
naturalCompare$2.exports = naturalCompare;
|
|
654
|
-
} catch (e) {
|
|
655
|
-
String.naturalCompare = naturalCompare;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
var naturalCompare$1 = naturalCompare$2.exports;
|
|
659
|
-
|
|
660
|
-
var build = {};
|
|
661
|
-
|
|
662
|
-
var ansiStyles = {exports: {}};
|
|
663
|
-
|
|
664
|
-
(function (module) {
|
|
665
|
-
|
|
666
|
-
const ANSI_BACKGROUND_OFFSET = 10;
|
|
667
|
-
|
|
668
|
-
const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
|
|
669
|
-
|
|
670
|
-
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
671
|
-
|
|
672
|
-
function assembleStyles() {
|
|
673
|
-
const codes = new Map();
|
|
674
|
-
const styles = {
|
|
675
|
-
modifier: {
|
|
676
|
-
reset: [0, 0],
|
|
677
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
678
|
-
bold: [1, 22],
|
|
679
|
-
dim: [2, 22],
|
|
680
|
-
italic: [3, 23],
|
|
681
|
-
underline: [4, 24],
|
|
682
|
-
overline: [53, 55],
|
|
683
|
-
inverse: [7, 27],
|
|
684
|
-
hidden: [8, 28],
|
|
685
|
-
strikethrough: [9, 29]
|
|
686
|
-
},
|
|
687
|
-
color: {
|
|
688
|
-
black: [30, 39],
|
|
689
|
-
red: [31, 39],
|
|
690
|
-
green: [32, 39],
|
|
691
|
-
yellow: [33, 39],
|
|
692
|
-
blue: [34, 39],
|
|
693
|
-
magenta: [35, 39],
|
|
694
|
-
cyan: [36, 39],
|
|
695
|
-
white: [37, 39],
|
|
696
|
-
|
|
697
|
-
// Bright color
|
|
698
|
-
blackBright: [90, 39],
|
|
699
|
-
redBright: [91, 39],
|
|
700
|
-
greenBright: [92, 39],
|
|
701
|
-
yellowBright: [93, 39],
|
|
702
|
-
blueBright: [94, 39],
|
|
703
|
-
magentaBright: [95, 39],
|
|
704
|
-
cyanBright: [96, 39],
|
|
705
|
-
whiteBright: [97, 39]
|
|
706
|
-
},
|
|
707
|
-
bgColor: {
|
|
708
|
-
bgBlack: [40, 49],
|
|
709
|
-
bgRed: [41, 49],
|
|
710
|
-
bgGreen: [42, 49],
|
|
711
|
-
bgYellow: [43, 49],
|
|
712
|
-
bgBlue: [44, 49],
|
|
713
|
-
bgMagenta: [45, 49],
|
|
714
|
-
bgCyan: [46, 49],
|
|
715
|
-
bgWhite: [47, 49],
|
|
716
|
-
|
|
717
|
-
// Bright color
|
|
718
|
-
bgBlackBright: [100, 49],
|
|
719
|
-
bgRedBright: [101, 49],
|
|
720
|
-
bgGreenBright: [102, 49],
|
|
721
|
-
bgYellowBright: [103, 49],
|
|
722
|
-
bgBlueBright: [104, 49],
|
|
723
|
-
bgMagentaBright: [105, 49],
|
|
724
|
-
bgCyanBright: [106, 49],
|
|
725
|
-
bgWhiteBright: [107, 49]
|
|
726
|
-
}
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
// Alias bright black as gray (and grey)
|
|
730
|
-
styles.color.gray = styles.color.blackBright;
|
|
731
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
732
|
-
styles.color.grey = styles.color.blackBright;
|
|
733
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
734
|
-
|
|
735
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
736
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
737
|
-
styles[styleName] = {
|
|
738
|
-
open: `\u001B[${style[0]}m`,
|
|
739
|
-
close: `\u001B[${style[1]}m`
|
|
740
|
-
};
|
|
741
|
-
|
|
742
|
-
group[styleName] = styles[styleName];
|
|
743
|
-
|
|
744
|
-
codes.set(style[0], style[1]);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
Object.defineProperty(styles, groupName, {
|
|
748
|
-
value: group,
|
|
749
|
-
enumerable: false
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
Object.defineProperty(styles, 'codes', {
|
|
754
|
-
value: codes,
|
|
755
|
-
enumerable: false
|
|
756
|
-
});
|
|
757
|
-
|
|
758
|
-
styles.color.close = '\u001B[39m';
|
|
759
|
-
styles.bgColor.close = '\u001B[49m';
|
|
760
|
-
|
|
761
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
762
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
763
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
764
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
765
|
-
|
|
766
|
-
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
|
767
|
-
Object.defineProperties(styles, {
|
|
768
|
-
rgbToAnsi256: {
|
|
769
|
-
value: (red, green, blue) => {
|
|
770
|
-
// We use the extended greyscale palette here, with the exception of
|
|
771
|
-
// black and white. normal palette only has 4 greyscale shades.
|
|
772
|
-
if (red === green && green === blue) {
|
|
773
|
-
if (red < 8) {
|
|
774
|
-
return 16;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
if (red > 248) {
|
|
778
|
-
return 231;
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
return Math.round(((red - 8) / 247) * 24) + 232;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
return 16 +
|
|
785
|
-
(36 * Math.round(red / 255 * 5)) +
|
|
786
|
-
(6 * Math.round(green / 255 * 5)) +
|
|
787
|
-
Math.round(blue / 255 * 5);
|
|
788
|
-
},
|
|
789
|
-
enumerable: false
|
|
790
|
-
},
|
|
791
|
-
hexToRgb: {
|
|
792
|
-
value: hex => {
|
|
793
|
-
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
|
794
|
-
if (!matches) {
|
|
795
|
-
return [0, 0, 0];
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
let {colorString} = matches.groups;
|
|
799
|
-
|
|
800
|
-
if (colorString.length === 3) {
|
|
801
|
-
colorString = colorString.split('').map(character => character + character).join('');
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
const integer = Number.parseInt(colorString, 16);
|
|
805
|
-
|
|
806
|
-
return [
|
|
807
|
-
(integer >> 16) & 0xFF,
|
|
808
|
-
(integer >> 8) & 0xFF,
|
|
809
|
-
integer & 0xFF
|
|
810
|
-
];
|
|
811
|
-
},
|
|
812
|
-
enumerable: false
|
|
813
|
-
},
|
|
814
|
-
hexToAnsi256: {
|
|
815
|
-
value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
816
|
-
enumerable: false
|
|
817
|
-
}
|
|
818
|
-
});
|
|
819
|
-
|
|
820
|
-
return styles;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
// Make the export immutable
|
|
824
|
-
Object.defineProperty(module, 'exports', {
|
|
825
|
-
enumerable: true,
|
|
826
|
-
get: assembleStyles
|
|
827
|
-
});
|
|
828
|
-
}(ansiStyles));
|
|
829
|
-
|
|
830
|
-
var collections = {};
|
|
831
|
-
|
|
832
|
-
Object.defineProperty(collections, '__esModule', {
|
|
833
|
-
value: true
|
|
834
|
-
});
|
|
835
|
-
collections.printIteratorEntries = printIteratorEntries;
|
|
836
|
-
collections.printIteratorValues = printIteratorValues;
|
|
837
|
-
collections.printListItems = printListItems;
|
|
838
|
-
collections.printObjectProperties = printObjectProperties;
|
|
839
|
-
|
|
840
|
-
/**
|
|
841
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
842
|
-
*
|
|
843
|
-
* This source code is licensed under the MIT license found in the
|
|
844
|
-
* LICENSE file in the root directory of this source tree.
|
|
845
|
-
*
|
|
846
|
-
*/
|
|
847
|
-
const getKeysOfEnumerableProperties = (object, compareKeys) => {
|
|
848
|
-
const keys = Object.keys(object).sort(compareKeys);
|
|
849
|
-
|
|
850
|
-
if (Object.getOwnPropertySymbols) {
|
|
851
|
-
Object.getOwnPropertySymbols(object).forEach(symbol => {
|
|
852
|
-
if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
|
|
853
|
-
keys.push(symbol);
|
|
854
|
-
}
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
return keys;
|
|
859
|
-
};
|
|
860
|
-
/**
|
|
861
|
-
* Return entries (for example, of a map)
|
|
862
|
-
* with spacing, indentation, and comma
|
|
863
|
-
* without surrounding punctuation (for example, braces)
|
|
864
|
-
*/
|
|
865
|
-
|
|
866
|
-
function printIteratorEntries(
|
|
867
|
-
iterator,
|
|
868
|
-
config,
|
|
869
|
-
indentation,
|
|
870
|
-
depth,
|
|
871
|
-
refs,
|
|
872
|
-
printer, // Too bad, so sad that separator for ECMAScript Map has been ' => '
|
|
873
|
-
// What a distracting diff if you change a data structure to/from
|
|
874
|
-
// ECMAScript Object or Immutable.Map/OrderedMap which use the default.
|
|
875
|
-
separator = ': '
|
|
876
|
-
) {
|
|
877
|
-
let result = '';
|
|
878
|
-
let current = iterator.next();
|
|
879
|
-
|
|
880
|
-
if (!current.done) {
|
|
881
|
-
result += config.spacingOuter;
|
|
882
|
-
const indentationNext = indentation + config.indent;
|
|
883
|
-
|
|
884
|
-
while (!current.done) {
|
|
885
|
-
const name = printer(
|
|
886
|
-
current.value[0],
|
|
887
|
-
config,
|
|
888
|
-
indentationNext,
|
|
889
|
-
depth,
|
|
890
|
-
refs
|
|
891
|
-
);
|
|
892
|
-
const value = printer(
|
|
893
|
-
current.value[1],
|
|
894
|
-
config,
|
|
895
|
-
indentationNext,
|
|
896
|
-
depth,
|
|
897
|
-
refs
|
|
898
|
-
);
|
|
899
|
-
result += indentationNext + name + separator + value;
|
|
900
|
-
current = iterator.next();
|
|
901
|
-
|
|
902
|
-
if (!current.done) {
|
|
903
|
-
result += ',' + config.spacingInner;
|
|
904
|
-
} else if (!config.min) {
|
|
905
|
-
result += ',';
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
result += config.spacingOuter + indentation;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
return result;
|
|
913
|
-
}
|
|
914
|
-
/**
|
|
915
|
-
* Return values (for example, of a set)
|
|
916
|
-
* with spacing, indentation, and comma
|
|
917
|
-
* without surrounding punctuation (braces or brackets)
|
|
918
|
-
*/
|
|
919
|
-
|
|
920
|
-
function printIteratorValues(
|
|
921
|
-
iterator,
|
|
922
|
-
config,
|
|
923
|
-
indentation,
|
|
924
|
-
depth,
|
|
925
|
-
refs,
|
|
926
|
-
printer
|
|
927
|
-
) {
|
|
928
|
-
let result = '';
|
|
929
|
-
let current = iterator.next();
|
|
930
|
-
|
|
931
|
-
if (!current.done) {
|
|
932
|
-
result += config.spacingOuter;
|
|
933
|
-
const indentationNext = indentation + config.indent;
|
|
934
|
-
|
|
935
|
-
while (!current.done) {
|
|
936
|
-
result +=
|
|
937
|
-
indentationNext +
|
|
938
|
-
printer(current.value, config, indentationNext, depth, refs);
|
|
939
|
-
current = iterator.next();
|
|
940
|
-
|
|
941
|
-
if (!current.done) {
|
|
942
|
-
result += ',' + config.spacingInner;
|
|
943
|
-
} else if (!config.min) {
|
|
944
|
-
result += ',';
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
result += config.spacingOuter + indentation;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
return result;
|
|
952
|
-
}
|
|
953
|
-
/**
|
|
954
|
-
* Return items (for example, of an array)
|
|
955
|
-
* with spacing, indentation, and comma
|
|
956
|
-
* without surrounding punctuation (for example, brackets)
|
|
957
|
-
**/
|
|
958
|
-
|
|
959
|
-
function printListItems(list, config, indentation, depth, refs, printer) {
|
|
960
|
-
let result = '';
|
|
961
|
-
|
|
962
|
-
if (list.length) {
|
|
963
|
-
result += config.spacingOuter;
|
|
964
|
-
const indentationNext = indentation + config.indent;
|
|
965
|
-
|
|
966
|
-
for (let i = 0; i < list.length; i++) {
|
|
967
|
-
result += indentationNext;
|
|
968
|
-
|
|
969
|
-
if (i in list) {
|
|
970
|
-
result += printer(list[i], config, indentationNext, depth, refs);
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
if (i < list.length - 1) {
|
|
974
|
-
result += ',' + config.spacingInner;
|
|
975
|
-
} else if (!config.min) {
|
|
976
|
-
result += ',';
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
result += config.spacingOuter + indentation;
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
return result;
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* Return properties of an object
|
|
987
|
-
* with spacing, indentation, and comma
|
|
988
|
-
* without surrounding punctuation (for example, braces)
|
|
989
|
-
*/
|
|
990
|
-
|
|
991
|
-
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
|
992
|
-
let result = '';
|
|
993
|
-
const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
|
994
|
-
|
|
995
|
-
if (keys.length) {
|
|
996
|
-
result += config.spacingOuter;
|
|
997
|
-
const indentationNext = indentation + config.indent;
|
|
998
|
-
|
|
999
|
-
for (let i = 0; i < keys.length; i++) {
|
|
1000
|
-
const key = keys[i];
|
|
1001
|
-
const name = printer(key, config, indentationNext, depth, refs);
|
|
1002
|
-
const value = printer(val[key], config, indentationNext, depth, refs);
|
|
1003
|
-
result += indentationNext + name + ': ' + value;
|
|
1004
|
-
|
|
1005
|
-
if (i < keys.length - 1) {
|
|
1006
|
-
result += ',' + config.spacingInner;
|
|
1007
|
-
} else if (!config.min) {
|
|
1008
|
-
result += ',';
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
result += config.spacingOuter + indentation;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
return result;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
var AsymmetricMatcher$3 = {};
|
|
1019
|
-
|
|
1020
|
-
Object.defineProperty(AsymmetricMatcher$3, '__esModule', {
|
|
1021
|
-
value: true
|
|
1022
|
-
});
|
|
1023
|
-
AsymmetricMatcher$3.test = AsymmetricMatcher$3.serialize = AsymmetricMatcher$3.default = void 0;
|
|
1024
|
-
|
|
1025
|
-
var _collections$3 = collections;
|
|
1026
|
-
|
|
1027
|
-
var global$3 = (function () {
|
|
1028
|
-
if (typeof globalThis !== 'undefined') {
|
|
1029
|
-
return globalThis;
|
|
1030
|
-
} else if (typeof global$3 !== 'undefined') {
|
|
1031
|
-
return global$3;
|
|
1032
|
-
} else if (typeof self !== 'undefined') {
|
|
1033
|
-
return self;
|
|
1034
|
-
} else if (typeof window !== 'undefined') {
|
|
1035
|
-
return window;
|
|
1036
|
-
} else {
|
|
1037
|
-
return Function('return this')();
|
|
1038
|
-
}
|
|
1039
|
-
})();
|
|
1040
|
-
|
|
1041
|
-
var Symbol$2 = global$3['jest-symbol-do-not-touch'] || global$3.Symbol;
|
|
1042
|
-
const asymmetricMatcher =
|
|
1043
|
-
typeof Symbol$2 === 'function' && Symbol$2.for
|
|
1044
|
-
? Symbol$2.for('jest.asymmetricMatcher')
|
|
1045
|
-
: 0x1357a5;
|
|
1046
|
-
const SPACE$2 = ' ';
|
|
1047
|
-
|
|
1048
|
-
const serialize$7 = (val, config, indentation, depth, refs, printer) => {
|
|
1049
|
-
const stringedValue = val.toString();
|
|
1050
|
-
|
|
1051
|
-
if (
|
|
1052
|
-
stringedValue === 'ArrayContaining' ||
|
|
1053
|
-
stringedValue === 'ArrayNotContaining'
|
|
1054
|
-
) {
|
|
1055
|
-
if (++depth > config.maxDepth) {
|
|
1056
|
-
return '[' + stringedValue + ']';
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
return (
|
|
1060
|
-
stringedValue +
|
|
1061
|
-
SPACE$2 +
|
|
1062
|
-
'[' +
|
|
1063
|
-
(0, _collections$3.printListItems)(
|
|
1064
|
-
val.sample,
|
|
1065
|
-
config,
|
|
1066
|
-
indentation,
|
|
1067
|
-
depth,
|
|
1068
|
-
refs,
|
|
1069
|
-
printer
|
|
1070
|
-
) +
|
|
1071
|
-
']'
|
|
1072
|
-
);
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
if (
|
|
1076
|
-
stringedValue === 'ObjectContaining' ||
|
|
1077
|
-
stringedValue === 'ObjectNotContaining'
|
|
1078
|
-
) {
|
|
1079
|
-
if (++depth > config.maxDepth) {
|
|
1080
|
-
return '[' + stringedValue + ']';
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
return (
|
|
1084
|
-
stringedValue +
|
|
1085
|
-
SPACE$2 +
|
|
1086
|
-
'{' +
|
|
1087
|
-
(0, _collections$3.printObjectProperties)(
|
|
1088
|
-
val.sample,
|
|
1089
|
-
config,
|
|
1090
|
-
indentation,
|
|
1091
|
-
depth,
|
|
1092
|
-
refs,
|
|
1093
|
-
printer
|
|
1094
|
-
) +
|
|
1095
|
-
'}'
|
|
1096
|
-
);
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
if (
|
|
1100
|
-
stringedValue === 'StringMatching' ||
|
|
1101
|
-
stringedValue === 'StringNotMatching'
|
|
1102
|
-
) {
|
|
1103
|
-
return (
|
|
1104
|
-
stringedValue +
|
|
1105
|
-
SPACE$2 +
|
|
1106
|
-
printer(val.sample, config, indentation, depth, refs)
|
|
1107
|
-
);
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
if (
|
|
1111
|
-
stringedValue === 'StringContaining' ||
|
|
1112
|
-
stringedValue === 'StringNotContaining'
|
|
1113
|
-
) {
|
|
1114
|
-
return (
|
|
1115
|
-
stringedValue +
|
|
1116
|
-
SPACE$2 +
|
|
1117
|
-
printer(val.sample, config, indentation, depth, refs)
|
|
1118
|
-
);
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
return val.toAsymmetricMatcher();
|
|
1122
|
-
};
|
|
1123
|
-
|
|
1124
|
-
AsymmetricMatcher$3.serialize = serialize$7;
|
|
1125
|
-
|
|
1126
|
-
const test$6 = val => val && val.$$typeof === asymmetricMatcher;
|
|
1127
|
-
|
|
1128
|
-
AsymmetricMatcher$3.test = test$6;
|
|
1129
|
-
const plugin$6 = {
|
|
1130
|
-
serialize: serialize$7,
|
|
1131
|
-
test: test$6
|
|
1132
|
-
};
|
|
1133
|
-
var _default$7 = plugin$6;
|
|
1134
|
-
AsymmetricMatcher$3.default = _default$7;
|
|
1135
|
-
|
|
1136
|
-
var ConvertAnsi = {};
|
|
1137
|
-
|
|
1138
|
-
var ansiRegex = ({onlyFirst = false} = {}) => {
|
|
1139
|
-
const pattern = [
|
|
1140
|
-
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
|
1141
|
-
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
|
1142
|
-
].join('|');
|
|
1143
|
-
|
|
1144
|
-
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
|
1145
|
-
};
|
|
1146
|
-
|
|
1147
|
-
Object.defineProperty(ConvertAnsi, '__esModule', {
|
|
1148
|
-
value: true
|
|
1149
|
-
});
|
|
1150
|
-
ConvertAnsi.test = ConvertAnsi.serialize = ConvertAnsi.default = void 0;
|
|
1151
|
-
|
|
1152
|
-
var _ansiRegex = _interopRequireDefault$2(ansiRegex);
|
|
1153
|
-
|
|
1154
|
-
var _ansiStyles$1 = _interopRequireDefault$2(ansiStyles.exports);
|
|
1155
|
-
|
|
1156
|
-
function _interopRequireDefault$2(obj) {
|
|
1157
|
-
return obj && obj.__esModule ? obj : {default: obj};
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
/**
|
|
1161
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1162
|
-
*
|
|
1163
|
-
* This source code is licensed under the MIT license found in the
|
|
1164
|
-
* LICENSE file in the root directory of this source tree.
|
|
1165
|
-
*/
|
|
1166
|
-
const toHumanReadableAnsi = text =>
|
|
1167
|
-
text.replace((0, _ansiRegex.default)(), match => {
|
|
1168
|
-
switch (match) {
|
|
1169
|
-
case _ansiStyles$1.default.red.close:
|
|
1170
|
-
case _ansiStyles$1.default.green.close:
|
|
1171
|
-
case _ansiStyles$1.default.cyan.close:
|
|
1172
|
-
case _ansiStyles$1.default.gray.close:
|
|
1173
|
-
case _ansiStyles$1.default.white.close:
|
|
1174
|
-
case _ansiStyles$1.default.yellow.close:
|
|
1175
|
-
case _ansiStyles$1.default.bgRed.close:
|
|
1176
|
-
case _ansiStyles$1.default.bgGreen.close:
|
|
1177
|
-
case _ansiStyles$1.default.bgYellow.close:
|
|
1178
|
-
case _ansiStyles$1.default.inverse.close:
|
|
1179
|
-
case _ansiStyles$1.default.dim.close:
|
|
1180
|
-
case _ansiStyles$1.default.bold.close:
|
|
1181
|
-
case _ansiStyles$1.default.reset.open:
|
|
1182
|
-
case _ansiStyles$1.default.reset.close:
|
|
1183
|
-
return '</>';
|
|
1184
|
-
|
|
1185
|
-
case _ansiStyles$1.default.red.open:
|
|
1186
|
-
return '<red>';
|
|
1187
|
-
|
|
1188
|
-
case _ansiStyles$1.default.green.open:
|
|
1189
|
-
return '<green>';
|
|
1190
|
-
|
|
1191
|
-
case _ansiStyles$1.default.cyan.open:
|
|
1192
|
-
return '<cyan>';
|
|
1193
|
-
|
|
1194
|
-
case _ansiStyles$1.default.gray.open:
|
|
1195
|
-
return '<gray>';
|
|
1196
|
-
|
|
1197
|
-
case _ansiStyles$1.default.white.open:
|
|
1198
|
-
return '<white>';
|
|
1199
|
-
|
|
1200
|
-
case _ansiStyles$1.default.yellow.open:
|
|
1201
|
-
return '<yellow>';
|
|
1202
|
-
|
|
1203
|
-
case _ansiStyles$1.default.bgRed.open:
|
|
1204
|
-
return '<bgRed>';
|
|
1205
|
-
|
|
1206
|
-
case _ansiStyles$1.default.bgGreen.open:
|
|
1207
|
-
return '<bgGreen>';
|
|
1208
|
-
|
|
1209
|
-
case _ansiStyles$1.default.bgYellow.open:
|
|
1210
|
-
return '<bgYellow>';
|
|
1211
|
-
|
|
1212
|
-
case _ansiStyles$1.default.inverse.open:
|
|
1213
|
-
return '<inverse>';
|
|
1214
|
-
|
|
1215
|
-
case _ansiStyles$1.default.dim.open:
|
|
1216
|
-
return '<dim>';
|
|
1217
|
-
|
|
1218
|
-
case _ansiStyles$1.default.bold.open:
|
|
1219
|
-
return '<bold>';
|
|
1220
|
-
|
|
1221
|
-
default:
|
|
1222
|
-
return '';
|
|
1223
|
-
}
|
|
1224
|
-
});
|
|
1225
|
-
|
|
1226
|
-
const test$5 = val =>
|
|
1227
|
-
typeof val === 'string' && !!val.match((0, _ansiRegex.default)());
|
|
1228
|
-
|
|
1229
|
-
ConvertAnsi.test = test$5;
|
|
1230
|
-
|
|
1231
|
-
const serialize$6 = (val, config, indentation, depth, refs, printer) =>
|
|
1232
|
-
printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
|
|
1233
|
-
|
|
1234
|
-
ConvertAnsi.serialize = serialize$6;
|
|
1235
|
-
const plugin$5 = {
|
|
1236
|
-
serialize: serialize$6,
|
|
1237
|
-
test: test$5
|
|
1238
|
-
};
|
|
1239
|
-
var _default$6 = plugin$5;
|
|
1240
|
-
ConvertAnsi.default = _default$6;
|
|
1241
|
-
|
|
1242
|
-
var DOMCollection$2 = {};
|
|
1243
|
-
|
|
1244
|
-
Object.defineProperty(DOMCollection$2, '__esModule', {
|
|
1245
|
-
value: true
|
|
1246
|
-
});
|
|
1247
|
-
DOMCollection$2.test = DOMCollection$2.serialize = DOMCollection$2.default = void 0;
|
|
1248
|
-
|
|
1249
|
-
var _collections$2 = collections;
|
|
1250
|
-
|
|
1251
|
-
/**
|
|
1252
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1253
|
-
*
|
|
1254
|
-
* This source code is licensed under the MIT license found in the
|
|
1255
|
-
* LICENSE file in the root directory of this source tree.
|
|
1256
|
-
*/
|
|
1257
|
-
|
|
1258
|
-
/* eslint-disable local/ban-types-eventually */
|
|
1259
|
-
const SPACE$1 = ' ';
|
|
1260
|
-
const OBJECT_NAMES = ['DOMStringMap', 'NamedNodeMap'];
|
|
1261
|
-
const ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
|
|
1262
|
-
|
|
1263
|
-
const testName = name =>
|
|
1264
|
-
OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name);
|
|
1265
|
-
|
|
1266
|
-
const test$4 = val =>
|
|
1267
|
-
val &&
|
|
1268
|
-
val.constructor &&
|
|
1269
|
-
!!val.constructor.name &&
|
|
1270
|
-
testName(val.constructor.name);
|
|
1271
|
-
|
|
1272
|
-
DOMCollection$2.test = test$4;
|
|
1273
|
-
|
|
1274
|
-
const isNamedNodeMap = collection =>
|
|
1275
|
-
collection.constructor.name === 'NamedNodeMap';
|
|
1276
|
-
|
|
1277
|
-
const serialize$5 = (collection, config, indentation, depth, refs, printer) => {
|
|
1278
|
-
const name = collection.constructor.name;
|
|
1279
|
-
|
|
1280
|
-
if (++depth > config.maxDepth) {
|
|
1281
|
-
return '[' + name + ']';
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
return (
|
|
1285
|
-
(config.min ? '' : name + SPACE$1) +
|
|
1286
|
-
(OBJECT_NAMES.indexOf(name) !== -1
|
|
1287
|
-
? '{' +
|
|
1288
|
-
(0, _collections$2.printObjectProperties)(
|
|
1289
|
-
isNamedNodeMap(collection)
|
|
1290
|
-
? Array.from(collection).reduce((props, attribute) => {
|
|
1291
|
-
props[attribute.name] = attribute.value;
|
|
1292
|
-
return props;
|
|
1293
|
-
}, {})
|
|
1294
|
-
: {...collection},
|
|
1295
|
-
config,
|
|
1296
|
-
indentation,
|
|
1297
|
-
depth,
|
|
1298
|
-
refs,
|
|
1299
|
-
printer
|
|
1300
|
-
) +
|
|
1301
|
-
'}'
|
|
1302
|
-
: '[' +
|
|
1303
|
-
(0, _collections$2.printListItems)(
|
|
1304
|
-
Array.from(collection),
|
|
1305
|
-
config,
|
|
1306
|
-
indentation,
|
|
1307
|
-
depth,
|
|
1308
|
-
refs,
|
|
1309
|
-
printer
|
|
1310
|
-
) +
|
|
1311
|
-
']')
|
|
1312
|
-
);
|
|
1313
|
-
};
|
|
1314
|
-
|
|
1315
|
-
DOMCollection$2.serialize = serialize$5;
|
|
1316
|
-
const plugin$4 = {
|
|
1317
|
-
serialize: serialize$5,
|
|
1318
|
-
test: test$4
|
|
1319
|
-
};
|
|
1320
|
-
var _default$5 = plugin$4;
|
|
1321
|
-
DOMCollection$2.default = _default$5;
|
|
1322
|
-
|
|
1323
|
-
var DOMElement$2 = {};
|
|
1324
|
-
|
|
1325
|
-
var markup = {};
|
|
1326
|
-
|
|
1327
|
-
var escapeHTML$1 = {};
|
|
1328
|
-
|
|
1329
|
-
Object.defineProperty(escapeHTML$1, '__esModule', {
|
|
1330
|
-
value: true
|
|
1331
|
-
});
|
|
1332
|
-
escapeHTML$1.default = escapeHTML;
|
|
1333
|
-
|
|
1334
|
-
/**
|
|
1335
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1336
|
-
*
|
|
1337
|
-
* This source code is licensed under the MIT license found in the
|
|
1338
|
-
* LICENSE file in the root directory of this source tree.
|
|
1339
|
-
*/
|
|
1340
|
-
function escapeHTML(str) {
|
|
1341
|
-
return str.replace(/</g, '<').replace(/>/g, '>');
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
Object.defineProperty(markup, '__esModule', {
|
|
1345
|
-
value: true
|
|
1346
|
-
});
|
|
1347
|
-
markup.printText =
|
|
1348
|
-
markup.printProps =
|
|
1349
|
-
markup.printElementAsLeaf =
|
|
1350
|
-
markup.printElement =
|
|
1351
|
-
markup.printComment =
|
|
1352
|
-
markup.printChildren =
|
|
1353
|
-
void 0;
|
|
1354
|
-
|
|
1355
|
-
var _escapeHTML = _interopRequireDefault$1(escapeHTML$1);
|
|
1356
|
-
|
|
1357
|
-
function _interopRequireDefault$1(obj) {
|
|
1358
|
-
return obj && obj.__esModule ? obj : {default: obj};
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
/**
|
|
1362
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1363
|
-
*
|
|
1364
|
-
* This source code is licensed under the MIT license found in the
|
|
1365
|
-
* LICENSE file in the root directory of this source tree.
|
|
1366
|
-
*/
|
|
1367
|
-
// Return empty string if keys is empty.
|
|
1368
|
-
const printProps = (keys, props, config, indentation, depth, refs, printer) => {
|
|
1369
|
-
const indentationNext = indentation + config.indent;
|
|
1370
|
-
const colors = config.colors;
|
|
1371
|
-
return keys
|
|
1372
|
-
.map(key => {
|
|
1373
|
-
const value = props[key];
|
|
1374
|
-
let printed = printer(value, config, indentationNext, depth, refs);
|
|
1375
|
-
|
|
1376
|
-
if (typeof value !== 'string') {
|
|
1377
|
-
if (printed.indexOf('\n') !== -1) {
|
|
1378
|
-
printed =
|
|
1379
|
-
config.spacingOuter +
|
|
1380
|
-
indentationNext +
|
|
1381
|
-
printed +
|
|
1382
|
-
config.spacingOuter +
|
|
1383
|
-
indentation;
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
printed = '{' + printed + '}';
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
return (
|
|
1390
|
-
config.spacingInner +
|
|
1391
|
-
indentation +
|
|
1392
|
-
colors.prop.open +
|
|
1393
|
-
key +
|
|
1394
|
-
colors.prop.close +
|
|
1395
|
-
'=' +
|
|
1396
|
-
colors.value.open +
|
|
1397
|
-
printed +
|
|
1398
|
-
colors.value.close
|
|
1399
|
-
);
|
|
1400
|
-
})
|
|
1401
|
-
.join('');
|
|
1402
|
-
}; // Return empty string if children is empty.
|
|
1403
|
-
|
|
1404
|
-
markup.printProps = printProps;
|
|
1405
|
-
|
|
1406
|
-
const printChildren = (children, config, indentation, depth, refs, printer) =>
|
|
1407
|
-
children
|
|
1408
|
-
.map(
|
|
1409
|
-
child =>
|
|
1410
|
-
config.spacingOuter +
|
|
1411
|
-
indentation +
|
|
1412
|
-
(typeof child === 'string'
|
|
1413
|
-
? printText(child, config)
|
|
1414
|
-
: printer(child, config, indentation, depth, refs))
|
|
1415
|
-
)
|
|
1416
|
-
.join('');
|
|
1417
|
-
|
|
1418
|
-
markup.printChildren = printChildren;
|
|
1419
|
-
|
|
1420
|
-
const printText = (text, config) => {
|
|
1421
|
-
const contentColor = config.colors.content;
|
|
1422
|
-
return (
|
|
1423
|
-
contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close
|
|
1424
|
-
);
|
|
1425
|
-
};
|
|
1426
|
-
|
|
1427
|
-
markup.printText = printText;
|
|
1428
|
-
|
|
1429
|
-
const printComment = (comment, config) => {
|
|
1430
|
-
const commentColor = config.colors.comment;
|
|
1431
|
-
return (
|
|
1432
|
-
commentColor.open +
|
|
1433
|
-
'<!--' +
|
|
1434
|
-
(0, _escapeHTML.default)(comment) +
|
|
1435
|
-
'-->' +
|
|
1436
|
-
commentColor.close
|
|
1437
|
-
);
|
|
1438
|
-
}; // Separate the functions to format props, children, and element,
|
|
1439
|
-
// so a plugin could override a particular function, if needed.
|
|
1440
|
-
// Too bad, so sad: the traditional (but unnecessary) space
|
|
1441
|
-
// in a self-closing tagColor requires a second test of printedProps.
|
|
1442
|
-
|
|
1443
|
-
markup.printComment = printComment;
|
|
1444
|
-
|
|
1445
|
-
const printElement = (
|
|
1446
|
-
type,
|
|
1447
|
-
printedProps,
|
|
1448
|
-
printedChildren,
|
|
1449
|
-
config,
|
|
1450
|
-
indentation
|
|
1451
|
-
) => {
|
|
1452
|
-
const tagColor = config.colors.tag;
|
|
1453
|
-
return (
|
|
1454
|
-
tagColor.open +
|
|
1455
|
-
'<' +
|
|
1456
|
-
type +
|
|
1457
|
-
(printedProps &&
|
|
1458
|
-
tagColor.close +
|
|
1459
|
-
printedProps +
|
|
1460
|
-
config.spacingOuter +
|
|
1461
|
-
indentation +
|
|
1462
|
-
tagColor.open) +
|
|
1463
|
-
(printedChildren
|
|
1464
|
-
? '>' +
|
|
1465
|
-
tagColor.close +
|
|
1466
|
-
printedChildren +
|
|
1467
|
-
config.spacingOuter +
|
|
1468
|
-
indentation +
|
|
1469
|
-
tagColor.open +
|
|
1470
|
-
'</' +
|
|
1471
|
-
type
|
|
1472
|
-
: (printedProps && !config.min ? '' : ' ') + '/') +
|
|
1473
|
-
'>' +
|
|
1474
|
-
tagColor.close
|
|
1475
|
-
);
|
|
1476
|
-
};
|
|
1477
|
-
|
|
1478
|
-
markup.printElement = printElement;
|
|
1479
|
-
|
|
1480
|
-
const printElementAsLeaf = (type, config) => {
|
|
1481
|
-
const tagColor = config.colors.tag;
|
|
1482
|
-
return (
|
|
1483
|
-
tagColor.open +
|
|
1484
|
-
'<' +
|
|
1485
|
-
type +
|
|
1486
|
-
tagColor.close +
|
|
1487
|
-
' …' +
|
|
1488
|
-
tagColor.open +
|
|
1489
|
-
' />' +
|
|
1490
|
-
tagColor.close
|
|
1491
|
-
);
|
|
1492
|
-
};
|
|
1493
|
-
|
|
1494
|
-
markup.printElementAsLeaf = printElementAsLeaf;
|
|
1495
|
-
|
|
1496
|
-
Object.defineProperty(DOMElement$2, '__esModule', {
|
|
1497
|
-
value: true
|
|
1498
|
-
});
|
|
1499
|
-
DOMElement$2.test = DOMElement$2.serialize = DOMElement$2.default = void 0;
|
|
1500
|
-
|
|
1501
|
-
var _markup$2 = markup;
|
|
1502
|
-
|
|
1503
|
-
/**
|
|
1504
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1505
|
-
*
|
|
1506
|
-
* This source code is licensed under the MIT license found in the
|
|
1507
|
-
* LICENSE file in the root directory of this source tree.
|
|
1508
|
-
*/
|
|
1509
|
-
const ELEMENT_NODE = 1;
|
|
1510
|
-
const TEXT_NODE = 3;
|
|
1511
|
-
const COMMENT_NODE = 8;
|
|
1512
|
-
const FRAGMENT_NODE = 11;
|
|
1513
|
-
const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
|
|
1514
|
-
|
|
1515
|
-
const testHasAttribute = val => {
|
|
1516
|
-
try {
|
|
1517
|
-
return typeof val.hasAttribute === 'function' && val.hasAttribute('is');
|
|
1518
|
-
} catch {
|
|
1519
|
-
return false;
|
|
1520
|
-
}
|
|
1521
|
-
};
|
|
1522
|
-
|
|
1523
|
-
const testNode = val => {
|
|
1524
|
-
const constructorName = val.constructor.name;
|
|
1525
|
-
const {nodeType, tagName} = val;
|
|
1526
|
-
const isCustomElement =
|
|
1527
|
-
(typeof tagName === 'string' && tagName.includes('-')) ||
|
|
1528
|
-
testHasAttribute(val);
|
|
1529
|
-
return (
|
|
1530
|
-
(nodeType === ELEMENT_NODE &&
|
|
1531
|
-
(ELEMENT_REGEXP.test(constructorName) || isCustomElement)) ||
|
|
1532
|
-
(nodeType === TEXT_NODE && constructorName === 'Text') ||
|
|
1533
|
-
(nodeType === COMMENT_NODE && constructorName === 'Comment') ||
|
|
1534
|
-
(nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment')
|
|
1535
|
-
);
|
|
1536
|
-
};
|
|
1537
|
-
|
|
1538
|
-
const test$3 = val => {
|
|
1539
|
-
var _val$constructor;
|
|
1540
|
-
|
|
1541
|
-
return (
|
|
1542
|
-
(val === null || val === void 0
|
|
1543
|
-
? void 0
|
|
1544
|
-
: (_val$constructor = val.constructor) === null ||
|
|
1545
|
-
_val$constructor === void 0
|
|
1546
|
-
? void 0
|
|
1547
|
-
: _val$constructor.name) && testNode(val)
|
|
1548
|
-
);
|
|
1549
|
-
};
|
|
1550
|
-
|
|
1551
|
-
DOMElement$2.test = test$3;
|
|
1552
|
-
|
|
1553
|
-
function nodeIsText(node) {
|
|
1554
|
-
return node.nodeType === TEXT_NODE;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
function nodeIsComment(node) {
|
|
1558
|
-
return node.nodeType === COMMENT_NODE;
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
function nodeIsFragment(node) {
|
|
1562
|
-
return node.nodeType === FRAGMENT_NODE;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
const serialize$4 = (node, config, indentation, depth, refs, printer) => {
|
|
1566
|
-
if (nodeIsText(node)) {
|
|
1567
|
-
return (0, _markup$2.printText)(node.data, config);
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
if (nodeIsComment(node)) {
|
|
1571
|
-
return (0, _markup$2.printComment)(node.data, config);
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
const type = nodeIsFragment(node)
|
|
1575
|
-
? 'DocumentFragment'
|
|
1576
|
-
: node.tagName.toLowerCase();
|
|
1577
|
-
|
|
1578
|
-
if (++depth > config.maxDepth) {
|
|
1579
|
-
return (0, _markup$2.printElementAsLeaf)(type, config);
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
return (0, _markup$2.printElement)(
|
|
1583
|
-
type,
|
|
1584
|
-
(0, _markup$2.printProps)(
|
|
1585
|
-
nodeIsFragment(node)
|
|
1586
|
-
? []
|
|
1587
|
-
: Array.from(node.attributes)
|
|
1588
|
-
.map(attr => attr.name)
|
|
1589
|
-
.sort(),
|
|
1590
|
-
nodeIsFragment(node)
|
|
1591
|
-
? {}
|
|
1592
|
-
: Array.from(node.attributes).reduce((props, attribute) => {
|
|
1593
|
-
props[attribute.name] = attribute.value;
|
|
1594
|
-
return props;
|
|
1595
|
-
}, {}),
|
|
1596
|
-
config,
|
|
1597
|
-
indentation + config.indent,
|
|
1598
|
-
depth,
|
|
1599
|
-
refs,
|
|
1600
|
-
printer
|
|
1601
|
-
),
|
|
1602
|
-
(0, _markup$2.printChildren)(
|
|
1603
|
-
Array.prototype.slice.call(node.childNodes || node.children),
|
|
1604
|
-
config,
|
|
1605
|
-
indentation + config.indent,
|
|
1606
|
-
depth,
|
|
1607
|
-
refs,
|
|
1608
|
-
printer
|
|
1609
|
-
),
|
|
1610
|
-
config,
|
|
1611
|
-
indentation
|
|
1612
|
-
);
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
|
-
DOMElement$2.serialize = serialize$4;
|
|
1616
|
-
const plugin$3 = {
|
|
1617
|
-
serialize: serialize$4,
|
|
1618
|
-
test: test$3
|
|
1619
|
-
};
|
|
1620
|
-
var _default$4 = plugin$3;
|
|
1621
|
-
DOMElement$2.default = _default$4;
|
|
1622
|
-
|
|
1623
|
-
var Immutable$2 = {};
|
|
1624
|
-
|
|
1625
|
-
Object.defineProperty(Immutable$2, '__esModule', {
|
|
1626
|
-
value: true
|
|
1627
|
-
});
|
|
1628
|
-
Immutable$2.test = Immutable$2.serialize = Immutable$2.default = void 0;
|
|
1629
|
-
|
|
1630
|
-
var _collections$1 = collections;
|
|
1631
|
-
|
|
1632
|
-
/**
|
|
1633
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1634
|
-
*
|
|
1635
|
-
* This source code is licensed under the MIT license found in the
|
|
1636
|
-
* LICENSE file in the root directory of this source tree.
|
|
1637
|
-
*/
|
|
1638
|
-
// SENTINEL constants are from https://github.com/facebook/immutable-js
|
|
1639
|
-
const IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
|
|
1640
|
-
const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
|
|
1641
|
-
const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
|
|
1642
|
-
const IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
|
|
1643
|
-
const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
|
|
1644
|
-
const IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4
|
|
1645
|
-
|
|
1646
|
-
const IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
|
|
1647
|
-
const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
|
|
1648
|
-
const IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
|
|
1649
|
-
|
|
1650
|
-
const getImmutableName = name => 'Immutable.' + name;
|
|
1651
|
-
|
|
1652
|
-
const printAsLeaf = name => '[' + name + ']';
|
|
1653
|
-
|
|
1654
|
-
const SPACE = ' ';
|
|
1655
|
-
const LAZY = '…'; // Seq is lazy if it calls a method like filter
|
|
1656
|
-
|
|
1657
|
-
const printImmutableEntries = (
|
|
1658
|
-
val,
|
|
1659
|
-
config,
|
|
1660
|
-
indentation,
|
|
1661
|
-
depth,
|
|
1662
|
-
refs,
|
|
1663
|
-
printer,
|
|
1664
|
-
type
|
|
1665
|
-
) =>
|
|
1666
|
-
++depth > config.maxDepth
|
|
1667
|
-
? printAsLeaf(getImmutableName(type))
|
|
1668
|
-
: getImmutableName(type) +
|
|
1669
|
-
SPACE +
|
|
1670
|
-
'{' +
|
|
1671
|
-
(0, _collections$1.printIteratorEntries)(
|
|
1672
|
-
val.entries(),
|
|
1673
|
-
config,
|
|
1674
|
-
indentation,
|
|
1675
|
-
depth,
|
|
1676
|
-
refs,
|
|
1677
|
-
printer
|
|
1678
|
-
) +
|
|
1679
|
-
'}'; // Record has an entries method because it is a collection in immutable v3.
|
|
1680
|
-
// Return an iterator for Immutable Record from version v3 or v4.
|
|
1681
|
-
|
|
1682
|
-
function getRecordEntries(val) {
|
|
1683
|
-
let i = 0;
|
|
1684
|
-
return {
|
|
1685
|
-
next() {
|
|
1686
|
-
if (i < val._keys.length) {
|
|
1687
|
-
const key = val._keys[i++];
|
|
1688
|
-
return {
|
|
1689
|
-
done: false,
|
|
1690
|
-
value: [key, val.get(key)]
|
|
1691
|
-
};
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
return {
|
|
1695
|
-
done: true,
|
|
1696
|
-
value: undefined
|
|
1697
|
-
};
|
|
1698
|
-
}
|
|
1699
|
-
};
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
const printImmutableRecord = (
|
|
1703
|
-
val,
|
|
1704
|
-
config,
|
|
1705
|
-
indentation,
|
|
1706
|
-
depth,
|
|
1707
|
-
refs,
|
|
1708
|
-
printer
|
|
1709
|
-
) => {
|
|
1710
|
-
// _name property is defined only for an Immutable Record instance
|
|
1711
|
-
// which was constructed with a second optional descriptive name arg
|
|
1712
|
-
const name = getImmutableName(val._name || 'Record');
|
|
1713
|
-
return ++depth > config.maxDepth
|
|
1714
|
-
? printAsLeaf(name)
|
|
1715
|
-
: name +
|
|
1716
|
-
SPACE +
|
|
1717
|
-
'{' +
|
|
1718
|
-
(0, _collections$1.printIteratorEntries)(
|
|
1719
|
-
getRecordEntries(val),
|
|
1720
|
-
config,
|
|
1721
|
-
indentation,
|
|
1722
|
-
depth,
|
|
1723
|
-
refs,
|
|
1724
|
-
printer
|
|
1725
|
-
) +
|
|
1726
|
-
'}';
|
|
1727
|
-
};
|
|
1728
|
-
|
|
1729
|
-
const printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
|
|
1730
|
-
const name = getImmutableName('Seq');
|
|
1731
|
-
|
|
1732
|
-
if (++depth > config.maxDepth) {
|
|
1733
|
-
return printAsLeaf(name);
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
|
-
if (val[IS_KEYED_SENTINEL]) {
|
|
1737
|
-
return (
|
|
1738
|
-
name +
|
|
1739
|
-
SPACE +
|
|
1740
|
-
'{' + // from Immutable collection of entries or from ECMAScript object
|
|
1741
|
-
(val._iter || val._object
|
|
1742
|
-
? (0, _collections$1.printIteratorEntries)(
|
|
1743
|
-
val.entries(),
|
|
1744
|
-
config,
|
|
1745
|
-
indentation,
|
|
1746
|
-
depth,
|
|
1747
|
-
refs,
|
|
1748
|
-
printer
|
|
1749
|
-
)
|
|
1750
|
-
: LAZY) +
|
|
1751
|
-
'}'
|
|
1752
|
-
);
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
return (
|
|
1756
|
-
name +
|
|
1757
|
-
SPACE +
|
|
1758
|
-
'[' +
|
|
1759
|
-
(val._iter || // from Immutable collection of values
|
|
1760
|
-
val._array || // from ECMAScript array
|
|
1761
|
-
val._collection || // from ECMAScript collection in immutable v4
|
|
1762
|
-
val._iterable // from ECMAScript collection in immutable v3
|
|
1763
|
-
? (0, _collections$1.printIteratorValues)(
|
|
1764
|
-
val.values(),
|
|
1765
|
-
config,
|
|
1766
|
-
indentation,
|
|
1767
|
-
depth,
|
|
1768
|
-
refs,
|
|
1769
|
-
printer
|
|
1770
|
-
)
|
|
1771
|
-
: LAZY) +
|
|
1772
|
-
']'
|
|
1773
|
-
);
|
|
1774
|
-
};
|
|
1775
|
-
|
|
1776
|
-
const printImmutableValues = (
|
|
1777
|
-
val,
|
|
1778
|
-
config,
|
|
1779
|
-
indentation,
|
|
1780
|
-
depth,
|
|
1781
|
-
refs,
|
|
1782
|
-
printer,
|
|
1783
|
-
type
|
|
1784
|
-
) =>
|
|
1785
|
-
++depth > config.maxDepth
|
|
1786
|
-
? printAsLeaf(getImmutableName(type))
|
|
1787
|
-
: getImmutableName(type) +
|
|
1788
|
-
SPACE +
|
|
1789
|
-
'[' +
|
|
1790
|
-
(0, _collections$1.printIteratorValues)(
|
|
1791
|
-
val.values(),
|
|
1792
|
-
config,
|
|
1793
|
-
indentation,
|
|
1794
|
-
depth,
|
|
1795
|
-
refs,
|
|
1796
|
-
printer
|
|
1797
|
-
) +
|
|
1798
|
-
']';
|
|
1799
|
-
|
|
1800
|
-
const serialize$3 = (val, config, indentation, depth, refs, printer) => {
|
|
1801
|
-
if (val[IS_MAP_SENTINEL]) {
|
|
1802
|
-
return printImmutableEntries(
|
|
1803
|
-
val,
|
|
1804
|
-
config,
|
|
1805
|
-
indentation,
|
|
1806
|
-
depth,
|
|
1807
|
-
refs,
|
|
1808
|
-
printer,
|
|
1809
|
-
val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map'
|
|
1810
|
-
);
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
if (val[IS_LIST_SENTINEL]) {
|
|
1814
|
-
return printImmutableValues(
|
|
1815
|
-
val,
|
|
1816
|
-
config,
|
|
1817
|
-
indentation,
|
|
1818
|
-
depth,
|
|
1819
|
-
refs,
|
|
1820
|
-
printer,
|
|
1821
|
-
'List'
|
|
1822
|
-
);
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
if (val[IS_SET_SENTINEL]) {
|
|
1826
|
-
return printImmutableValues(
|
|
1827
|
-
val,
|
|
1828
|
-
config,
|
|
1829
|
-
indentation,
|
|
1830
|
-
depth,
|
|
1831
|
-
refs,
|
|
1832
|
-
printer,
|
|
1833
|
-
val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set'
|
|
1834
|
-
);
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
if (val[IS_STACK_SENTINEL]) {
|
|
1838
|
-
return printImmutableValues(
|
|
1839
|
-
val,
|
|
1840
|
-
config,
|
|
1841
|
-
indentation,
|
|
1842
|
-
depth,
|
|
1843
|
-
refs,
|
|
1844
|
-
printer,
|
|
1845
|
-
'Stack'
|
|
1846
|
-
);
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
if (val[IS_SEQ_SENTINEL]) {
|
|
1850
|
-
return printImmutableSeq(val, config, indentation, depth, refs, printer);
|
|
1851
|
-
} // For compatibility with immutable v3 and v4, let record be the default.
|
|
1852
|
-
|
|
1853
|
-
return printImmutableRecord(val, config, indentation, depth, refs, printer);
|
|
1854
|
-
}; // Explicitly comparing sentinel properties to true avoids false positive
|
|
1855
|
-
// when mock identity-obj-proxy returns the key as the value for any key.
|
|
1856
|
-
|
|
1857
|
-
Immutable$2.serialize = serialize$3;
|
|
1858
|
-
|
|
1859
|
-
const test$2 = val =>
|
|
1860
|
-
val &&
|
|
1861
|
-
(val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
|
|
1862
|
-
|
|
1863
|
-
Immutable$2.test = test$2;
|
|
1864
|
-
const plugin$2 = {
|
|
1865
|
-
serialize: serialize$3,
|
|
1866
|
-
test: test$2
|
|
1867
|
-
};
|
|
1868
|
-
var _default$3 = plugin$2;
|
|
1869
|
-
Immutable$2.default = _default$3;
|
|
1870
|
-
|
|
1871
|
-
var ReactElement$2 = {};
|
|
1872
|
-
|
|
1873
|
-
var reactIs = {exports: {}};
|
|
1874
|
-
|
|
1875
|
-
var reactIs_production_min = {};
|
|
1876
|
-
|
|
1877
|
-
/** @license React v17.0.2
|
|
1878
|
-
* react-is.production.min.js
|
|
1879
|
-
*
|
|
1880
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1881
|
-
*
|
|
1882
|
-
* This source code is licensed under the MIT license found in the
|
|
1883
|
-
* LICENSE file in the root directory of this source tree.
|
|
1884
|
-
*/
|
|
1885
|
-
var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;
|
|
1886
|
-
if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden");}
|
|
1887
|
-
function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=z;reactIs_production_min.Element=A;reactIs_production_min.ForwardRef=B;reactIs_production_min.Fragment=C;reactIs_production_min.Lazy=D;reactIs_production_min.Memo=E;reactIs_production_min.Portal=F;reactIs_production_min.Profiler=G;reactIs_production_min.StrictMode=H;
|
|
1888
|
-
reactIs_production_min.Suspense=I;reactIs_production_min.isAsyncMode=function(){return !1};reactIs_production_min.isConcurrentMode=function(){return !1};reactIs_production_min.isContextConsumer=function(a){return y(a)===h};reactIs_production_min.isContextProvider=function(a){return y(a)===g};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b};reactIs_production_min.isForwardRef=function(a){return y(a)===k};reactIs_production_min.isFragment=function(a){return y(a)===d};reactIs_production_min.isLazy=function(a){return y(a)===p};reactIs_production_min.isMemo=function(a){return y(a)===n};
|
|
1889
|
-
reactIs_production_min.isPortal=function(a){return y(a)===c};reactIs_production_min.isProfiler=function(a){return y(a)===f};reactIs_production_min.isStrictMode=function(a){return y(a)===e};reactIs_production_min.isSuspense=function(a){return y(a)===l};reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};
|
|
1890
|
-
reactIs_production_min.typeOf=y;
|
|
1891
|
-
|
|
1892
|
-
var reactIs_development = {};
|
|
1893
|
-
|
|
1894
|
-
/** @license React v17.0.2
|
|
1895
|
-
* react-is.development.js
|
|
1896
|
-
*
|
|
1897
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1898
|
-
*
|
|
1899
|
-
* This source code is licensed under the MIT license found in the
|
|
1900
|
-
* LICENSE file in the root directory of this source tree.
|
|
1901
|
-
*/
|
|
1902
|
-
|
|
1903
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1904
|
-
(function() {
|
|
1905
|
-
|
|
1906
|
-
// ATTENTION
|
|
1907
|
-
// When adding new symbols to this file,
|
|
1908
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
1909
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
1910
|
-
// nor polyfill, then a plain number is used for performance.
|
|
1911
|
-
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
1912
|
-
var REACT_PORTAL_TYPE = 0xeaca;
|
|
1913
|
-
var REACT_FRAGMENT_TYPE = 0xeacb;
|
|
1914
|
-
var REACT_STRICT_MODE_TYPE = 0xeacc;
|
|
1915
|
-
var REACT_PROFILER_TYPE = 0xead2;
|
|
1916
|
-
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
1917
|
-
var REACT_CONTEXT_TYPE = 0xeace;
|
|
1918
|
-
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
1919
|
-
var REACT_SUSPENSE_TYPE = 0xead1;
|
|
1920
|
-
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
1921
|
-
var REACT_MEMO_TYPE = 0xead3;
|
|
1922
|
-
var REACT_LAZY_TYPE = 0xead4;
|
|
1923
|
-
var REACT_BLOCK_TYPE = 0xead9;
|
|
1924
|
-
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
1925
|
-
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
1926
|
-
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
1927
|
-
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
1928
|
-
|
|
1929
|
-
if (typeof Symbol === 'function' && Symbol.for) {
|
|
1930
|
-
var symbolFor = Symbol.for;
|
|
1931
|
-
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
1932
|
-
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
1933
|
-
REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
|
|
1934
|
-
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
|
|
1935
|
-
REACT_PROFILER_TYPE = symbolFor('react.profiler');
|
|
1936
|
-
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
1937
|
-
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
1938
|
-
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
1939
|
-
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
|
|
1940
|
-
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
1941
|
-
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
1942
|
-
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
1943
|
-
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
1944
|
-
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
1945
|
-
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
1946
|
-
symbolFor('react.scope');
|
|
1947
|
-
symbolFor('react.opaque.id');
|
|
1948
|
-
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
1949
|
-
symbolFor('react.offscreen');
|
|
1950
|
-
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1954
|
-
|
|
1955
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1956
|
-
|
|
1957
|
-
function isValidElementType(type) {
|
|
1958
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
1959
|
-
return true;
|
|
1960
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
|
1964
|
-
return true;
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
if (typeof type === 'object' && type !== null) {
|
|
1968
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
1969
|
-
return true;
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
return false;
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
function typeOf(object) {
|
|
1977
|
-
if (typeof object === 'object' && object !== null) {
|
|
1978
|
-
var $$typeof = object.$$typeof;
|
|
1979
|
-
|
|
1980
|
-
switch ($$typeof) {
|
|
1981
|
-
case REACT_ELEMENT_TYPE:
|
|
1982
|
-
var type = object.type;
|
|
1983
|
-
|
|
1984
|
-
switch (type) {
|
|
1985
|
-
case REACT_FRAGMENT_TYPE:
|
|
1986
|
-
case REACT_PROFILER_TYPE:
|
|
1987
|
-
case REACT_STRICT_MODE_TYPE:
|
|
1988
|
-
case REACT_SUSPENSE_TYPE:
|
|
1989
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1990
|
-
return type;
|
|
1991
|
-
|
|
1992
|
-
default:
|
|
1993
|
-
var $$typeofType = type && type.$$typeof;
|
|
1994
|
-
|
|
1995
|
-
switch ($$typeofType) {
|
|
1996
|
-
case REACT_CONTEXT_TYPE:
|
|
1997
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1998
|
-
case REACT_LAZY_TYPE:
|
|
1999
|
-
case REACT_MEMO_TYPE:
|
|
2000
|
-
case REACT_PROVIDER_TYPE:
|
|
2001
|
-
return $$typeofType;
|
|
2002
|
-
|
|
2003
|
-
default:
|
|
2004
|
-
return $$typeof;
|
|
2005
|
-
}
|
|
2006
|
-
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
case REACT_PORTAL_TYPE:
|
|
2010
|
-
return $$typeof;
|
|
2011
|
-
}
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
return undefined;
|
|
2015
|
-
}
|
|
2016
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
2017
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
2018
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
2019
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
2020
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
2021
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
2022
|
-
var Memo = REACT_MEMO_TYPE;
|
|
2023
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
2024
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
2025
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2026
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
2027
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
2028
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
2029
|
-
|
|
2030
|
-
function isAsyncMode(object) {
|
|
2031
|
-
{
|
|
2032
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
2033
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
2034
|
-
|
|
2035
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
return false;
|
|
2040
|
-
}
|
|
2041
|
-
function isConcurrentMode(object) {
|
|
2042
|
-
{
|
|
2043
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
2044
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
2045
|
-
|
|
2046
|
-
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
return false;
|
|
2051
|
-
}
|
|
2052
|
-
function isContextConsumer(object) {
|
|
2053
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
2054
|
-
}
|
|
2055
|
-
function isContextProvider(object) {
|
|
2056
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
2057
|
-
}
|
|
2058
|
-
function isElement(object) {
|
|
2059
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2060
|
-
}
|
|
2061
|
-
function isForwardRef(object) {
|
|
2062
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
2063
|
-
}
|
|
2064
|
-
function isFragment(object) {
|
|
2065
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
2066
|
-
}
|
|
2067
|
-
function isLazy(object) {
|
|
2068
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
2069
|
-
}
|
|
2070
|
-
function isMemo(object) {
|
|
2071
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
2072
|
-
}
|
|
2073
|
-
function isPortal(object) {
|
|
2074
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
2075
|
-
}
|
|
2076
|
-
function isProfiler(object) {
|
|
2077
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
2078
|
-
}
|
|
2079
|
-
function isStrictMode(object) {
|
|
2080
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
2081
|
-
}
|
|
2082
|
-
function isSuspense(object) {
|
|
2083
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
2084
|
-
}
|
|
2085
|
-
|
|
2086
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
2087
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
2088
|
-
reactIs_development.Element = Element;
|
|
2089
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
2090
|
-
reactIs_development.Fragment = Fragment;
|
|
2091
|
-
reactIs_development.Lazy = Lazy;
|
|
2092
|
-
reactIs_development.Memo = Memo;
|
|
2093
|
-
reactIs_development.Portal = Portal;
|
|
2094
|
-
reactIs_development.Profiler = Profiler;
|
|
2095
|
-
reactIs_development.StrictMode = StrictMode;
|
|
2096
|
-
reactIs_development.Suspense = Suspense;
|
|
2097
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
2098
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
2099
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
2100
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
2101
|
-
reactIs_development.isElement = isElement;
|
|
2102
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
2103
|
-
reactIs_development.isFragment = isFragment;
|
|
2104
|
-
reactIs_development.isLazy = isLazy;
|
|
2105
|
-
reactIs_development.isMemo = isMemo;
|
|
2106
|
-
reactIs_development.isPortal = isPortal;
|
|
2107
|
-
reactIs_development.isProfiler = isProfiler;
|
|
2108
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
2109
|
-
reactIs_development.isSuspense = isSuspense;
|
|
2110
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
2111
|
-
reactIs_development.typeOf = typeOf;
|
|
2112
|
-
})();
|
|
2113
|
-
}
|
|
2114
|
-
|
|
2115
|
-
if (process.env.NODE_ENV === 'production') {
|
|
2116
|
-
reactIs.exports = reactIs_production_min;
|
|
2117
|
-
} else {
|
|
2118
|
-
reactIs.exports = reactIs_development;
|
|
2119
|
-
}
|
|
2120
|
-
|
|
2121
|
-
Object.defineProperty(ReactElement$2, '__esModule', {
|
|
2122
|
-
value: true
|
|
2123
|
-
});
|
|
2124
|
-
ReactElement$2.test = ReactElement$2.serialize = ReactElement$2.default = void 0;
|
|
2125
|
-
|
|
2126
|
-
var ReactIs = _interopRequireWildcard(reactIs.exports);
|
|
2127
|
-
|
|
2128
|
-
var _markup$1 = markup;
|
|
2129
|
-
|
|
2130
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
2131
|
-
if (typeof WeakMap !== 'function') return null;
|
|
2132
|
-
var cacheBabelInterop = new WeakMap();
|
|
2133
|
-
var cacheNodeInterop = new WeakMap();
|
|
2134
|
-
return (_getRequireWildcardCache = function (nodeInterop) {
|
|
2135
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
2136
|
-
})(nodeInterop);
|
|
2137
|
-
}
|
|
2138
|
-
|
|
2139
|
-
function _interopRequireWildcard(obj, nodeInterop) {
|
|
2140
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
2141
|
-
return obj;
|
|
2142
|
-
}
|
|
2143
|
-
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
2144
|
-
return {default: obj};
|
|
2145
|
-
}
|
|
2146
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
2147
|
-
if (cache && cache.has(obj)) {
|
|
2148
|
-
return cache.get(obj);
|
|
2149
|
-
}
|
|
2150
|
-
var newObj = {};
|
|
2151
|
-
var hasPropertyDescriptor =
|
|
2152
|
-
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
2153
|
-
for (var key in obj) {
|
|
2154
|
-
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2155
|
-
var desc = hasPropertyDescriptor
|
|
2156
|
-
? Object.getOwnPropertyDescriptor(obj, key)
|
|
2157
|
-
: null;
|
|
2158
|
-
if (desc && (desc.get || desc.set)) {
|
|
2159
|
-
Object.defineProperty(newObj, key, desc);
|
|
2160
|
-
} else {
|
|
2161
|
-
newObj[key] = obj[key];
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
}
|
|
2165
|
-
newObj.default = obj;
|
|
2166
|
-
if (cache) {
|
|
2167
|
-
cache.set(obj, newObj);
|
|
2168
|
-
}
|
|
2169
|
-
return newObj;
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
/**
|
|
2173
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2174
|
-
*
|
|
2175
|
-
* This source code is licensed under the MIT license found in the
|
|
2176
|
-
* LICENSE file in the root directory of this source tree.
|
|
2177
|
-
*/
|
|
2178
|
-
// Given element.props.children, or subtree during recursive traversal,
|
|
2179
|
-
// return flattened array of children.
|
|
2180
|
-
const getChildren = (arg, children = []) => {
|
|
2181
|
-
if (Array.isArray(arg)) {
|
|
2182
|
-
arg.forEach(item => {
|
|
2183
|
-
getChildren(item, children);
|
|
2184
|
-
});
|
|
2185
|
-
} else if (arg != null && arg !== false) {
|
|
2186
|
-
children.push(arg);
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
return children;
|
|
2190
|
-
};
|
|
2191
|
-
|
|
2192
|
-
const getType = element => {
|
|
2193
|
-
const type = element.type;
|
|
2194
|
-
|
|
2195
|
-
if (typeof type === 'string') {
|
|
2196
|
-
return type;
|
|
2197
|
-
}
|
|
2198
|
-
|
|
2199
|
-
if (typeof type === 'function') {
|
|
2200
|
-
return type.displayName || type.name || 'Unknown';
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
if (ReactIs.isFragment(element)) {
|
|
2204
|
-
return 'React.Fragment';
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
if (ReactIs.isSuspense(element)) {
|
|
2208
|
-
return 'React.Suspense';
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
if (typeof type === 'object' && type !== null) {
|
|
2212
|
-
if (ReactIs.isContextProvider(element)) {
|
|
2213
|
-
return 'Context.Provider';
|
|
2214
|
-
}
|
|
2215
|
-
|
|
2216
|
-
if (ReactIs.isContextConsumer(element)) {
|
|
2217
|
-
return 'Context.Consumer';
|
|
2218
|
-
}
|
|
2219
|
-
|
|
2220
|
-
if (ReactIs.isForwardRef(element)) {
|
|
2221
|
-
if (type.displayName) {
|
|
2222
|
-
return type.displayName;
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
const functionName = type.render.displayName || type.render.name || '';
|
|
2226
|
-
return functionName !== ''
|
|
2227
|
-
? 'ForwardRef(' + functionName + ')'
|
|
2228
|
-
: 'ForwardRef';
|
|
2229
|
-
}
|
|
2230
|
-
|
|
2231
|
-
if (ReactIs.isMemo(element)) {
|
|
2232
|
-
const functionName =
|
|
2233
|
-
type.displayName || type.type.displayName || type.type.name || '';
|
|
2234
|
-
return functionName !== '' ? 'Memo(' + functionName + ')' : 'Memo';
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
|
-
return 'UNDEFINED';
|
|
2239
|
-
};
|
|
2240
|
-
|
|
2241
|
-
const getPropKeys$1 = element => {
|
|
2242
|
-
const {props} = element;
|
|
2243
|
-
return Object.keys(props)
|
|
2244
|
-
.filter(key => key !== 'children' && props[key] !== undefined)
|
|
2245
|
-
.sort();
|
|
2246
|
-
};
|
|
2247
|
-
|
|
2248
|
-
const serialize$2 = (element, config, indentation, depth, refs, printer) =>
|
|
2249
|
-
++depth > config.maxDepth
|
|
2250
|
-
? (0, _markup$1.printElementAsLeaf)(getType(element), config)
|
|
2251
|
-
: (0, _markup$1.printElement)(
|
|
2252
|
-
getType(element),
|
|
2253
|
-
(0, _markup$1.printProps)(
|
|
2254
|
-
getPropKeys$1(element),
|
|
2255
|
-
element.props,
|
|
2256
|
-
config,
|
|
2257
|
-
indentation + config.indent,
|
|
2258
|
-
depth,
|
|
2259
|
-
refs,
|
|
2260
|
-
printer
|
|
2261
|
-
),
|
|
2262
|
-
(0, _markup$1.printChildren)(
|
|
2263
|
-
getChildren(element.props.children),
|
|
2264
|
-
config,
|
|
2265
|
-
indentation + config.indent,
|
|
2266
|
-
depth,
|
|
2267
|
-
refs,
|
|
2268
|
-
printer
|
|
2269
|
-
),
|
|
2270
|
-
config,
|
|
2271
|
-
indentation
|
|
2272
|
-
);
|
|
2273
|
-
|
|
2274
|
-
ReactElement$2.serialize = serialize$2;
|
|
2275
|
-
|
|
2276
|
-
const test$1 = val => val != null && ReactIs.isElement(val);
|
|
2277
|
-
|
|
2278
|
-
ReactElement$2.test = test$1;
|
|
2279
|
-
const plugin$1 = {
|
|
2280
|
-
serialize: serialize$2,
|
|
2281
|
-
test: test$1
|
|
2282
|
-
};
|
|
2283
|
-
var _default$2 = plugin$1;
|
|
2284
|
-
ReactElement$2.default = _default$2;
|
|
2285
|
-
|
|
2286
|
-
var ReactTestComponent$2 = {};
|
|
2287
|
-
|
|
2288
|
-
Object.defineProperty(ReactTestComponent$2, '__esModule', {
|
|
2289
|
-
value: true
|
|
2290
|
-
});
|
|
2291
|
-
ReactTestComponent$2.test = ReactTestComponent$2.serialize = ReactTestComponent$2.default = void 0;
|
|
2292
|
-
|
|
2293
|
-
var _markup = markup;
|
|
2294
|
-
|
|
2295
|
-
var global$2 = (function () {
|
|
2296
|
-
if (typeof globalThis !== 'undefined') {
|
|
2297
|
-
return globalThis;
|
|
2298
|
-
} else if (typeof global$2 !== 'undefined') {
|
|
2299
|
-
return global$2;
|
|
2300
|
-
} else if (typeof self !== 'undefined') {
|
|
2301
|
-
return self;
|
|
2302
|
-
} else if (typeof window !== 'undefined') {
|
|
2303
|
-
return window;
|
|
2304
|
-
} else {
|
|
2305
|
-
return Function('return this')();
|
|
2306
|
-
}
|
|
2307
|
-
})();
|
|
2308
|
-
|
|
2309
|
-
var Symbol$1 = global$2['jest-symbol-do-not-touch'] || global$2.Symbol;
|
|
2310
|
-
const testSymbol =
|
|
2311
|
-
typeof Symbol$1 === 'function' && Symbol$1.for
|
|
2312
|
-
? Symbol$1.for('react.test.json')
|
|
2313
|
-
: 0xea71357;
|
|
2314
|
-
|
|
2315
|
-
const getPropKeys = object => {
|
|
2316
|
-
const {props} = object;
|
|
2317
|
-
return props
|
|
2318
|
-
? Object.keys(props)
|
|
2319
|
-
.filter(key => props[key] !== undefined)
|
|
2320
|
-
.sort()
|
|
2321
|
-
: [];
|
|
2322
|
-
};
|
|
2323
|
-
|
|
2324
|
-
const serialize$1 = (object, config, indentation, depth, refs, printer) =>
|
|
2325
|
-
++depth > config.maxDepth
|
|
2326
|
-
? (0, _markup.printElementAsLeaf)(object.type, config)
|
|
2327
|
-
: (0, _markup.printElement)(
|
|
2328
|
-
object.type,
|
|
2329
|
-
object.props
|
|
2330
|
-
? (0, _markup.printProps)(
|
|
2331
|
-
getPropKeys(object),
|
|
2332
|
-
object.props,
|
|
2333
|
-
config,
|
|
2334
|
-
indentation + config.indent,
|
|
2335
|
-
depth,
|
|
2336
|
-
refs,
|
|
2337
|
-
printer
|
|
2338
|
-
)
|
|
2339
|
-
: '',
|
|
2340
|
-
object.children
|
|
2341
|
-
? (0, _markup.printChildren)(
|
|
2342
|
-
object.children,
|
|
2343
|
-
config,
|
|
2344
|
-
indentation + config.indent,
|
|
2345
|
-
depth,
|
|
2346
|
-
refs,
|
|
2347
|
-
printer
|
|
2348
|
-
)
|
|
2349
|
-
: '',
|
|
2350
|
-
config,
|
|
2351
|
-
indentation
|
|
2352
|
-
);
|
|
2353
|
-
|
|
2354
|
-
ReactTestComponent$2.serialize = serialize$1;
|
|
2355
|
-
|
|
2356
|
-
const test = val => val && val.$$typeof === testSymbol;
|
|
2357
|
-
|
|
2358
|
-
ReactTestComponent$2.test = test;
|
|
2359
|
-
const plugin = {
|
|
2360
|
-
serialize: serialize$1,
|
|
2361
|
-
test
|
|
2362
|
-
};
|
|
2363
|
-
var _default$1 = plugin;
|
|
2364
|
-
ReactTestComponent$2.default = _default$1;
|
|
2365
|
-
|
|
2366
|
-
Object.defineProperty(build, '__esModule', {
|
|
2367
|
-
value: true
|
|
2368
|
-
});
|
|
2369
|
-
build.default = build.DEFAULT_OPTIONS = void 0;
|
|
2370
|
-
var format_1 = build.format = format;
|
|
2371
|
-
var plugins_1 = build.plugins = void 0;
|
|
2372
|
-
|
|
2373
|
-
var _ansiStyles = _interopRequireDefault(ansiStyles.exports);
|
|
2374
|
-
|
|
2375
|
-
var _collections = collections;
|
|
2376
|
-
|
|
2377
|
-
var _AsymmetricMatcher = _interopRequireDefault(
|
|
2378
|
-
AsymmetricMatcher$3
|
|
2379
|
-
);
|
|
2380
|
-
|
|
2381
|
-
var _ConvertAnsi = _interopRequireDefault(ConvertAnsi);
|
|
2382
|
-
|
|
2383
|
-
var _DOMCollection = _interopRequireDefault(DOMCollection$2);
|
|
2384
|
-
|
|
2385
|
-
var _DOMElement = _interopRequireDefault(DOMElement$2);
|
|
2386
|
-
|
|
2387
|
-
var _Immutable = _interopRequireDefault(Immutable$2);
|
|
2388
|
-
|
|
2389
|
-
var _ReactElement = _interopRequireDefault(ReactElement$2);
|
|
2390
|
-
|
|
2391
|
-
var _ReactTestComponent = _interopRequireDefault(
|
|
2392
|
-
ReactTestComponent$2
|
|
2393
|
-
);
|
|
2394
|
-
|
|
2395
|
-
function _interopRequireDefault(obj) {
|
|
2396
|
-
return obj && obj.__esModule ? obj : {default: obj};
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
/**
|
|
2400
|
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
2401
|
-
*
|
|
2402
|
-
* This source code is licensed under the MIT license found in the
|
|
2403
|
-
* LICENSE file in the root directory of this source tree.
|
|
2404
|
-
*/
|
|
2405
|
-
|
|
2406
|
-
/* eslint-disable local/ban-types-eventually */
|
|
2407
|
-
const toString = Object.prototype.toString;
|
|
2408
|
-
const toISOString = Date.prototype.toISOString;
|
|
2409
|
-
const errorToString = Error.prototype.toString;
|
|
2410
|
-
const regExpToString = RegExp.prototype.toString;
|
|
2411
|
-
/**
|
|
2412
|
-
* Explicitly comparing typeof constructor to function avoids undefined as name
|
|
2413
|
-
* when mock identity-obj-proxy returns the key as the value for any key.
|
|
2414
|
-
*/
|
|
2415
|
-
|
|
2416
|
-
const getConstructorName = val =>
|
|
2417
|
-
(typeof val.constructor === 'function' && val.constructor.name) || 'Object';
|
|
2418
|
-
/* global window */
|
|
2419
|
-
|
|
2420
|
-
/** Is val is equal to global window object? Works even if it does not exist :) */
|
|
2421
|
-
|
|
2422
|
-
const isWindow = val => typeof window !== 'undefined' && val === window;
|
|
2423
|
-
|
|
2424
|
-
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
|
|
2425
|
-
const NEWLINE_REGEXP = /\n/gi;
|
|
2426
|
-
|
|
2427
|
-
class PrettyFormatPluginError extends Error {
|
|
2428
|
-
constructor(message, stack) {
|
|
2429
|
-
super(message);
|
|
2430
|
-
this.stack = stack;
|
|
2431
|
-
this.name = this.constructor.name;
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
|
|
2435
|
-
function isToStringedArrayType(toStringed) {
|
|
2436
|
-
return (
|
|
2437
|
-
toStringed === '[object Array]' ||
|
|
2438
|
-
toStringed === '[object ArrayBuffer]' ||
|
|
2439
|
-
toStringed === '[object DataView]' ||
|
|
2440
|
-
toStringed === '[object Float32Array]' ||
|
|
2441
|
-
toStringed === '[object Float64Array]' ||
|
|
2442
|
-
toStringed === '[object Int8Array]' ||
|
|
2443
|
-
toStringed === '[object Int16Array]' ||
|
|
2444
|
-
toStringed === '[object Int32Array]' ||
|
|
2445
|
-
toStringed === '[object Uint8Array]' ||
|
|
2446
|
-
toStringed === '[object Uint8ClampedArray]' ||
|
|
2447
|
-
toStringed === '[object Uint16Array]' ||
|
|
2448
|
-
toStringed === '[object Uint32Array]'
|
|
2449
|
-
);
|
|
2450
|
-
}
|
|
2451
|
-
|
|
2452
|
-
function printNumber(val) {
|
|
2453
|
-
return Object.is(val, -0) ? '-0' : String(val);
|
|
2454
|
-
}
|
|
2455
|
-
|
|
2456
|
-
function printBigInt(val) {
|
|
2457
|
-
return String(`${val}n`);
|
|
2458
|
-
}
|
|
2459
|
-
|
|
2460
|
-
function printFunction(val, printFunctionName) {
|
|
2461
|
-
if (!printFunctionName) {
|
|
2462
|
-
return '[Function]';
|
|
2463
|
-
}
|
|
2464
|
-
|
|
2465
|
-
return '[Function ' + (val.name || 'anonymous') + ']';
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
function printSymbol(val) {
|
|
2469
|
-
return String(val).replace(SYMBOL_REGEXP, 'Symbol($1)');
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
|
-
function printError(val) {
|
|
2473
|
-
return '[' + errorToString.call(val) + ']';
|
|
2474
|
-
}
|
|
2475
|
-
/**
|
|
2476
|
-
* The first port of call for printing an object, handles most of the
|
|
2477
|
-
* data-types in JS.
|
|
2478
|
-
*/
|
|
2479
|
-
|
|
2480
|
-
function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
|
|
2481
|
-
if (val === true || val === false) {
|
|
2482
|
-
return '' + val;
|
|
2483
|
-
}
|
|
2484
|
-
|
|
2485
|
-
if (val === undefined) {
|
|
2486
|
-
return 'undefined';
|
|
2487
|
-
}
|
|
2488
|
-
|
|
2489
|
-
if (val === null) {
|
|
2490
|
-
return 'null';
|
|
2491
|
-
}
|
|
2492
|
-
|
|
2493
|
-
const typeOf = typeof val;
|
|
2494
|
-
|
|
2495
|
-
if (typeOf === 'number') {
|
|
2496
|
-
return printNumber(val);
|
|
2497
|
-
}
|
|
2498
|
-
|
|
2499
|
-
if (typeOf === 'bigint') {
|
|
2500
|
-
return printBigInt(val);
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
if (typeOf === 'string') {
|
|
2504
|
-
if (escapeString) {
|
|
2505
|
-
return '"' + val.replace(/"|\\/g, '\\$&') + '"';
|
|
2506
|
-
}
|
|
2507
|
-
|
|
2508
|
-
return '"' + val + '"';
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2511
|
-
if (typeOf === 'function') {
|
|
2512
|
-
return printFunction(val, printFunctionName);
|
|
2513
|
-
}
|
|
2514
|
-
|
|
2515
|
-
if (typeOf === 'symbol') {
|
|
2516
|
-
return printSymbol(val);
|
|
2517
|
-
}
|
|
2518
|
-
|
|
2519
|
-
const toStringed = toString.call(val);
|
|
2520
|
-
|
|
2521
|
-
if (toStringed === '[object WeakMap]') {
|
|
2522
|
-
return 'WeakMap {}';
|
|
2523
|
-
}
|
|
2524
|
-
|
|
2525
|
-
if (toStringed === '[object WeakSet]') {
|
|
2526
|
-
return 'WeakSet {}';
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
if (
|
|
2530
|
-
toStringed === '[object Function]' ||
|
|
2531
|
-
toStringed === '[object GeneratorFunction]'
|
|
2532
|
-
) {
|
|
2533
|
-
return printFunction(val, printFunctionName);
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
if (toStringed === '[object Symbol]') {
|
|
2537
|
-
return printSymbol(val);
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2540
|
-
if (toStringed === '[object Date]') {
|
|
2541
|
-
return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);
|
|
2542
|
-
}
|
|
2543
|
-
|
|
2544
|
-
if (toStringed === '[object Error]') {
|
|
2545
|
-
return printError(val);
|
|
2546
|
-
}
|
|
2547
|
-
|
|
2548
|
-
if (toStringed === '[object RegExp]') {
|
|
2549
|
-
if (escapeRegex) {
|
|
2550
|
-
// https://github.com/benjamingr/RegExp.escape/blob/main/polyfill.js
|
|
2551
|
-
return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
2552
|
-
}
|
|
2553
|
-
|
|
2554
|
-
return regExpToString.call(val);
|
|
2555
|
-
}
|
|
2556
|
-
|
|
2557
|
-
if (val instanceof Error) {
|
|
2558
|
-
return printError(val);
|
|
2559
|
-
}
|
|
2560
|
-
|
|
2561
|
-
return null;
|
|
2562
|
-
}
|
|
2563
|
-
/**
|
|
2564
|
-
* Handles more complex objects ( such as objects with circular references.
|
|
2565
|
-
* maps and sets etc )
|
|
2566
|
-
*/
|
|
2567
|
-
|
|
2568
|
-
function printComplexValue(
|
|
2569
|
-
val,
|
|
2570
|
-
config,
|
|
2571
|
-
indentation,
|
|
2572
|
-
depth,
|
|
2573
|
-
refs,
|
|
2574
|
-
hasCalledToJSON
|
|
2575
|
-
) {
|
|
2576
|
-
if (refs.indexOf(val) !== -1) {
|
|
2577
|
-
return '[Circular]';
|
|
2578
|
-
}
|
|
2579
|
-
|
|
2580
|
-
refs = refs.slice();
|
|
2581
|
-
refs.push(val);
|
|
2582
|
-
const hitMaxDepth = ++depth > config.maxDepth;
|
|
2583
|
-
const min = config.min;
|
|
2584
|
-
|
|
2585
|
-
if (
|
|
2586
|
-
config.callToJSON &&
|
|
2587
|
-
!hitMaxDepth &&
|
|
2588
|
-
val.toJSON &&
|
|
2589
|
-
typeof val.toJSON === 'function' &&
|
|
2590
|
-
!hasCalledToJSON
|
|
2591
|
-
) {
|
|
2592
|
-
return printer(val.toJSON(), config, indentation, depth, refs, true);
|
|
2593
|
-
}
|
|
2594
|
-
|
|
2595
|
-
const toStringed = toString.call(val);
|
|
2596
|
-
|
|
2597
|
-
if (toStringed === '[object Arguments]') {
|
|
2598
|
-
return hitMaxDepth
|
|
2599
|
-
? '[Arguments]'
|
|
2600
|
-
: (min ? '' : 'Arguments ') +
|
|
2601
|
-
'[' +
|
|
2602
|
-
(0, _collections.printListItems)(
|
|
2603
|
-
val,
|
|
2604
|
-
config,
|
|
2605
|
-
indentation,
|
|
2606
|
-
depth,
|
|
2607
|
-
refs,
|
|
2608
|
-
printer
|
|
2609
|
-
) +
|
|
2610
|
-
']';
|
|
2611
|
-
}
|
|
2612
|
-
|
|
2613
|
-
if (isToStringedArrayType(toStringed)) {
|
|
2614
|
-
return hitMaxDepth
|
|
2615
|
-
? '[' + val.constructor.name + ']'
|
|
2616
|
-
: (min
|
|
2617
|
-
? ''
|
|
2618
|
-
: !config.printBasicPrototype && val.constructor.name === 'Array'
|
|
2619
|
-
? ''
|
|
2620
|
-
: val.constructor.name + ' ') +
|
|
2621
|
-
'[' +
|
|
2622
|
-
(0, _collections.printListItems)(
|
|
2623
|
-
val,
|
|
2624
|
-
config,
|
|
2625
|
-
indentation,
|
|
2626
|
-
depth,
|
|
2627
|
-
refs,
|
|
2628
|
-
printer
|
|
2629
|
-
) +
|
|
2630
|
-
']';
|
|
2631
|
-
}
|
|
2632
|
-
|
|
2633
|
-
if (toStringed === '[object Map]') {
|
|
2634
|
-
return hitMaxDepth
|
|
2635
|
-
? '[Map]'
|
|
2636
|
-
: 'Map {' +
|
|
2637
|
-
(0, _collections.printIteratorEntries)(
|
|
2638
|
-
val.entries(),
|
|
2639
|
-
config,
|
|
2640
|
-
indentation,
|
|
2641
|
-
depth,
|
|
2642
|
-
refs,
|
|
2643
|
-
printer,
|
|
2644
|
-
' => '
|
|
2645
|
-
) +
|
|
2646
|
-
'}';
|
|
2647
|
-
}
|
|
2648
|
-
|
|
2649
|
-
if (toStringed === '[object Set]') {
|
|
2650
|
-
return hitMaxDepth
|
|
2651
|
-
? '[Set]'
|
|
2652
|
-
: 'Set {' +
|
|
2653
|
-
(0, _collections.printIteratorValues)(
|
|
2654
|
-
val.values(),
|
|
2655
|
-
config,
|
|
2656
|
-
indentation,
|
|
2657
|
-
depth,
|
|
2658
|
-
refs,
|
|
2659
|
-
printer
|
|
2660
|
-
) +
|
|
2661
|
-
'}';
|
|
2662
|
-
} // Avoid failure to serialize global window object in jsdom test environment.
|
|
2663
|
-
// For example, not even relevant if window is prop of React element.
|
|
2664
|
-
|
|
2665
|
-
return hitMaxDepth || isWindow(val)
|
|
2666
|
-
? '[' + getConstructorName(val) + ']'
|
|
2667
|
-
: (min
|
|
2668
|
-
? ''
|
|
2669
|
-
: !config.printBasicPrototype && getConstructorName(val) === 'Object'
|
|
2670
|
-
? ''
|
|
2671
|
-
: getConstructorName(val) + ' ') +
|
|
2672
|
-
'{' +
|
|
2673
|
-
(0, _collections.printObjectProperties)(
|
|
2674
|
-
val,
|
|
2675
|
-
config,
|
|
2676
|
-
indentation,
|
|
2677
|
-
depth,
|
|
2678
|
-
refs,
|
|
2679
|
-
printer
|
|
2680
|
-
) +
|
|
2681
|
-
'}';
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
function isNewPlugin(plugin) {
|
|
2685
|
-
return plugin.serialize != null;
|
|
2686
|
-
}
|
|
2687
|
-
|
|
2688
|
-
function printPlugin(plugin, val, config, indentation, depth, refs) {
|
|
2689
|
-
let printed;
|
|
2690
|
-
|
|
2691
|
-
try {
|
|
2692
|
-
printed = isNewPlugin(plugin)
|
|
2693
|
-
? plugin.serialize(val, config, indentation, depth, refs, printer)
|
|
2694
|
-
: plugin.print(
|
|
2695
|
-
val,
|
|
2696
|
-
valChild => printer(valChild, config, indentation, depth, refs),
|
|
2697
|
-
str => {
|
|
2698
|
-
const indentationNext = indentation + config.indent;
|
|
2699
|
-
return (
|
|
2700
|
-
indentationNext +
|
|
2701
|
-
str.replace(NEWLINE_REGEXP, '\n' + indentationNext)
|
|
2702
|
-
);
|
|
2703
|
-
},
|
|
2704
|
-
{
|
|
2705
|
-
edgeSpacing: config.spacingOuter,
|
|
2706
|
-
min: config.min,
|
|
2707
|
-
spacing: config.spacingInner
|
|
2708
|
-
},
|
|
2709
|
-
config.colors
|
|
2710
|
-
);
|
|
2711
|
-
} catch (error) {
|
|
2712
|
-
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
|
-
if (typeof printed !== 'string') {
|
|
2716
|
-
throw new Error(
|
|
2717
|
-
`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`
|
|
2718
|
-
);
|
|
2719
|
-
}
|
|
2720
|
-
|
|
2721
|
-
return printed;
|
|
2722
|
-
}
|
|
2723
|
-
|
|
2724
|
-
function findPlugin(plugins, val) {
|
|
2725
|
-
for (let p = 0; p < plugins.length; p++) {
|
|
2726
|
-
try {
|
|
2727
|
-
if (plugins[p].test(val)) {
|
|
2728
|
-
return plugins[p];
|
|
521
|
+
if (matchedValue === true)
|
|
522
|
+
has = true;
|
|
523
|
+
}
|
|
524
|
+
if (has === false) {
|
|
525
|
+
allFound = false;
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
2729
529
|
}
|
|
2730
|
-
|
|
2731
|
-
|
|
530
|
+
aStack.pop();
|
|
531
|
+
bStack.pop();
|
|
532
|
+
return allFound;
|
|
2732
533
|
}
|
|
2733
534
|
}
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
const plugin = findPlugin(config.plugins, val);
|
|
2740
|
-
|
|
2741
|
-
if (plugin !== null) {
|
|
2742
|
-
return printPlugin(plugin, val, config, indentation, depth, refs);
|
|
2743
|
-
}
|
|
2744
|
-
|
|
2745
|
-
const basicResult = printBasicValue(
|
|
2746
|
-
val,
|
|
2747
|
-
config.printFunctionName,
|
|
2748
|
-
config.escapeRegex,
|
|
2749
|
-
config.escapeString
|
|
2750
|
-
);
|
|
2751
|
-
|
|
2752
|
-
if (basicResult !== null) {
|
|
2753
|
-
return basicResult;
|
|
535
|
+
const bIterator = b[IteratorSymbol]();
|
|
536
|
+
for (const aValue of a) {
|
|
537
|
+
const nextB = bIterator.next();
|
|
538
|
+
if (nextB.done || !equals(aValue, nextB.value, [iterableEqualityWithStack]))
|
|
539
|
+
return false;
|
|
2754
540
|
}
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
)
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
const DEFAULT_THEME = {
|
|
2767
|
-
comment: 'gray',
|
|
2768
|
-
content: 'reset',
|
|
2769
|
-
prop: 'yellow',
|
|
2770
|
-
tag: 'cyan',
|
|
2771
|
-
value: 'green'
|
|
541
|
+
if (!bIterator.next().done)
|
|
542
|
+
return false;
|
|
543
|
+
aStack.pop();
|
|
544
|
+
bStack.pop();
|
|
545
|
+
return true;
|
|
546
|
+
};
|
|
547
|
+
const hasPropertyInObject = (object, key) => {
|
|
548
|
+
const shouldTerminate = !object || typeof object !== "object" || object === Object.prototype;
|
|
549
|
+
if (shouldTerminate)
|
|
550
|
+
return false;
|
|
551
|
+
return Object.prototype.hasOwnProperty.call(object, key) || hasPropertyInObject(Object.getPrototypeOf(object), key);
|
|
2772
552
|
};
|
|
2773
|
-
const
|
|
2774
|
-
const
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
553
|
+
const isObjectWithKeys = (a) => isObject(a) && !(a instanceof Error) && !(a instanceof Array) && !(a instanceof Date);
|
|
554
|
+
const subsetEquality = (object, subset) => {
|
|
555
|
+
const subsetEqualityWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => (object2, subset2) => {
|
|
556
|
+
if (!isObjectWithKeys(subset2))
|
|
557
|
+
return void 0;
|
|
558
|
+
return Object.keys(subset2).every((key) => {
|
|
559
|
+
if (isObjectWithKeys(subset2[key])) {
|
|
560
|
+
if (seenReferences.has(subset2[key]))
|
|
561
|
+
return equals(object2[key], subset2[key], [iterableEquality]);
|
|
562
|
+
seenReferences.set(subset2[key], true);
|
|
563
|
+
}
|
|
564
|
+
const result = object2 != null && hasPropertyInObject(object2, key) && equals(object2[key], subset2[key], [
|
|
565
|
+
iterableEquality,
|
|
566
|
+
subsetEqualityWithContext(seenReferences)
|
|
567
|
+
]);
|
|
568
|
+
seenReferences.delete(subset2[key]);
|
|
569
|
+
return result;
|
|
570
|
+
});
|
|
571
|
+
};
|
|
572
|
+
return subsetEqualityWithContext()(object, subset);
|
|
2787
573
|
};
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
574
|
+
const typeEquality = (a, b) => {
|
|
575
|
+
if (a == null || b == null || a.constructor === b.constructor)
|
|
576
|
+
return void 0;
|
|
577
|
+
return false;
|
|
578
|
+
};
|
|
579
|
+
const arrayBufferEquality = (a, b) => {
|
|
580
|
+
if (!(a instanceof ArrayBuffer) || !(b instanceof ArrayBuffer))
|
|
581
|
+
return void 0;
|
|
582
|
+
const dataViewA = new DataView(a);
|
|
583
|
+
const dataViewB = new DataView(b);
|
|
584
|
+
if (dataViewA.byteLength !== dataViewB.byteLength)
|
|
585
|
+
return false;
|
|
586
|
+
for (let i = 0; i < dataViewA.byteLength; i++) {
|
|
587
|
+
if (dataViewA.getUint8(i) !== dataViewB.getUint8(i))
|
|
588
|
+
return false;
|
|
2801
589
|
}
|
|
590
|
+
return true;
|
|
591
|
+
};
|
|
592
|
+
const sparseArrayEquality = (a, b) => {
|
|
593
|
+
if (!Array.isArray(a) || !Array.isArray(b))
|
|
594
|
+
return void 0;
|
|
595
|
+
const aKeys = Object.keys(a);
|
|
596
|
+
const bKeys = Object.keys(b);
|
|
597
|
+
return equals(a, b, [iterableEquality, typeEquality], true) && equals(aKeys, bKeys);
|
|
598
|
+
};
|
|
2802
599
|
|
|
2803
|
-
|
|
2804
|
-
if (options.theme === null) {
|
|
2805
|
-
throw new Error('pretty-format: Option "theme" must not be null.');
|
|
2806
|
-
}
|
|
2807
|
-
|
|
2808
|
-
if (typeof options.theme !== 'object') {
|
|
2809
|
-
throw new Error(
|
|
2810
|
-
`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`
|
|
2811
|
-
);
|
|
2812
|
-
}
|
|
2813
|
-
}
|
|
2814
|
-
}
|
|
600
|
+
var naturalCompare$2 = {exports: {}};
|
|
2815
601
|
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
if (
|
|
2825
|
-
color &&
|
|
2826
|
-
typeof color.close === 'string' &&
|
|
2827
|
-
typeof color.open === 'string'
|
|
2828
|
-
) {
|
|
2829
|
-
colors[key] = color;
|
|
2830
|
-
} else {
|
|
2831
|
-
throw new Error(
|
|
2832
|
-
`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`
|
|
2833
|
-
);
|
|
2834
|
-
}
|
|
602
|
+
/*
|
|
603
|
+
* @version 1.4.0
|
|
604
|
+
* @date 2015-10-26
|
|
605
|
+
* @stability 3 - Stable
|
|
606
|
+
* @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
|
|
607
|
+
* @license MIT License
|
|
608
|
+
*/
|
|
2835
609
|
|
|
2836
|
-
return colors;
|
|
2837
|
-
}, Object.create(null));
|
|
2838
610
|
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
return colors;
|
|
2846
|
-
}, Object.create(null));
|
|
611
|
+
var naturalCompare = function(a, b) {
|
|
612
|
+
var i, codeA
|
|
613
|
+
, codeB = 1
|
|
614
|
+
, posA = 0
|
|
615
|
+
, posB = 0
|
|
616
|
+
, alphabet = String.alphabet;
|
|
2847
617
|
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
618
|
+
function getCode(str, pos, code) {
|
|
619
|
+
if (code) {
|
|
620
|
+
for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i;
|
|
621
|
+
return +str.slice(pos - 1, i)
|
|
622
|
+
}
|
|
623
|
+
code = alphabet && alphabet.indexOf(str.charAt(pos));
|
|
624
|
+
return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code
|
|
625
|
+
: code < 46 ? 65 // -
|
|
626
|
+
: code < 48 ? code - 1
|
|
627
|
+
: code < 58 ? code + 18 // 0-9
|
|
628
|
+
: code < 65 ? code - 11
|
|
629
|
+
: code < 91 ? code + 11 // A-Z
|
|
630
|
+
: code < 97 ? code - 37
|
|
631
|
+
: code < 123 ? code + 5 // a-z
|
|
632
|
+
: code - 63
|
|
633
|
+
}
|
|
2852
634
|
|
|
2853
|
-
const getEscapeRegex = options =>
|
|
2854
|
-
options && options.escapeRegex !== undefined
|
|
2855
|
-
? options.escapeRegex
|
|
2856
|
-
: DEFAULT_OPTIONS.escapeRegex;
|
|
2857
635
|
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
: DEFAULT_OPTIONS.escapeString;
|
|
636
|
+
if ((a+="") != (b+="")) for (;codeB;) {
|
|
637
|
+
codeA = getCode(a, posA++);
|
|
638
|
+
codeB = getCode(b, posB++);
|
|
2862
639
|
|
|
2863
|
-
|
|
2864
|
-
|
|
640
|
+
if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
|
|
641
|
+
codeA = getCode(a, posA, posA);
|
|
642
|
+
codeB = getCode(b, posB, posA = i);
|
|
643
|
+
posB = i;
|
|
644
|
+
}
|
|
2865
645
|
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
? options.callToJSON
|
|
2870
|
-
: DEFAULT_OPTIONS.callToJSON,
|
|
2871
|
-
colors:
|
|
2872
|
-
options && options.highlight
|
|
2873
|
-
? getColorsHighlight(options)
|
|
2874
|
-
: getColorsEmpty(),
|
|
2875
|
-
compareKeys:
|
|
2876
|
-
options && typeof options.compareKeys === 'function'
|
|
2877
|
-
? options.compareKeys
|
|
2878
|
-
: DEFAULT_OPTIONS.compareKeys,
|
|
2879
|
-
escapeRegex: getEscapeRegex(options),
|
|
2880
|
-
escapeString: getEscapeString(options),
|
|
2881
|
-
indent:
|
|
2882
|
-
options && options.min
|
|
2883
|
-
? ''
|
|
2884
|
-
: createIndent(
|
|
2885
|
-
options && options.indent !== undefined
|
|
2886
|
-
? options.indent
|
|
2887
|
-
: DEFAULT_OPTIONS.indent
|
|
2888
|
-
),
|
|
2889
|
-
maxDepth:
|
|
2890
|
-
options && options.maxDepth !== undefined
|
|
2891
|
-
? options.maxDepth
|
|
2892
|
-
: DEFAULT_OPTIONS.maxDepth,
|
|
2893
|
-
min:
|
|
2894
|
-
options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,
|
|
2895
|
-
plugins:
|
|
2896
|
-
options && options.plugins !== undefined
|
|
2897
|
-
? options.plugins
|
|
2898
|
-
: DEFAULT_OPTIONS.plugins,
|
|
2899
|
-
printBasicPrototype:
|
|
2900
|
-
(_options$printBasicPr =
|
|
2901
|
-
options === null || options === void 0
|
|
2902
|
-
? void 0
|
|
2903
|
-
: options.printBasicPrototype) !== null &&
|
|
2904
|
-
_options$printBasicPr !== void 0
|
|
2905
|
-
? _options$printBasicPr
|
|
2906
|
-
: true,
|
|
2907
|
-
printFunctionName: getPrintFunctionName(options),
|
|
2908
|
-
spacingInner: options && options.min ? ' ' : '\n',
|
|
2909
|
-
spacingOuter: options && options.min ? '' : '\n'
|
|
2910
|
-
};
|
|
646
|
+
if (codeA != codeB) return (codeA < codeB) ? -1 : 1
|
|
647
|
+
}
|
|
648
|
+
return 0
|
|
2911
649
|
};
|
|
2912
650
|
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
}
|
|
2916
|
-
|
|
2917
|
-
* Returns a presentation string of your `val` object
|
|
2918
|
-
* @param val any potential JavaScript object
|
|
2919
|
-
* @param options Custom settings
|
|
2920
|
-
*/
|
|
2921
|
-
|
|
2922
|
-
function format(val, options) {
|
|
2923
|
-
if (options) {
|
|
2924
|
-
validateOptions(options);
|
|
2925
|
-
|
|
2926
|
-
if (options.plugins) {
|
|
2927
|
-
const plugin = findPlugin(options.plugins, val);
|
|
2928
|
-
|
|
2929
|
-
if (plugin !== null) {
|
|
2930
|
-
return printPlugin(plugin, val, getConfig(options), '', 0, []);
|
|
2931
|
-
}
|
|
2932
|
-
}
|
|
2933
|
-
}
|
|
2934
|
-
|
|
2935
|
-
const basicResult = printBasicValue(
|
|
2936
|
-
val,
|
|
2937
|
-
getPrintFunctionName(options),
|
|
2938
|
-
getEscapeRegex(options),
|
|
2939
|
-
getEscapeString(options)
|
|
2940
|
-
);
|
|
2941
|
-
|
|
2942
|
-
if (basicResult !== null) {
|
|
2943
|
-
return basicResult;
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
return printComplexValue(val, getConfig(options), '', 0, []);
|
|
651
|
+
try {
|
|
652
|
+
naturalCompare$2.exports = naturalCompare;
|
|
653
|
+
} catch (e) {
|
|
654
|
+
String.naturalCompare = naturalCompare;
|
|
2947
655
|
}
|
|
2948
656
|
|
|
2949
|
-
|
|
2950
|
-
AsymmetricMatcher: _AsymmetricMatcher.default,
|
|
2951
|
-
ConvertAnsi: _ConvertAnsi.default,
|
|
2952
|
-
DOMCollection: _DOMCollection.default,
|
|
2953
|
-
DOMElement: _DOMElement.default,
|
|
2954
|
-
Immutable: _Immutable.default,
|
|
2955
|
-
ReactElement: _ReactElement.default,
|
|
2956
|
-
ReactTestComponent: _ReactTestComponent.default
|
|
2957
|
-
};
|
|
2958
|
-
plugins_1 = build.plugins = plugins;
|
|
2959
|
-
var _default = format;
|
|
2960
|
-
build.default = _default;
|
|
657
|
+
var naturalCompare$1 = naturalCompare$2.exports;
|
|
2961
658
|
|
|
2962
659
|
const {
|
|
2963
|
-
DOMCollection
|
|
2964
|
-
DOMElement
|
|
2965
|
-
Immutable
|
|
2966
|
-
ReactElement
|
|
2967
|
-
ReactTestComponent
|
|
2968
|
-
AsymmetricMatcher: AsymmetricMatcher$
|
|
660
|
+
DOMCollection,
|
|
661
|
+
DOMElement,
|
|
662
|
+
Immutable,
|
|
663
|
+
ReactElement,
|
|
664
|
+
ReactTestComponent,
|
|
665
|
+
AsymmetricMatcher: AsymmetricMatcher$1
|
|
2969
666
|
} = plugins_1;
|
|
2970
|
-
let PLUGINS
|
|
2971
|
-
ReactTestComponent
|
|
2972
|
-
ReactElement
|
|
2973
|
-
DOMElement
|
|
2974
|
-
DOMCollection
|
|
2975
|
-
Immutable
|
|
2976
|
-
AsymmetricMatcher$
|
|
667
|
+
let PLUGINS = [
|
|
668
|
+
ReactTestComponent,
|
|
669
|
+
ReactElement,
|
|
670
|
+
DOMElement,
|
|
671
|
+
DOMCollection,
|
|
672
|
+
Immutable,
|
|
673
|
+
AsymmetricMatcher$1
|
|
2977
674
|
];
|
|
2978
675
|
const addSerializer = (plugin) => {
|
|
2979
|
-
PLUGINS
|
|
676
|
+
PLUGINS = [plugin].concat(PLUGINS);
|
|
2980
677
|
};
|
|
2981
|
-
const getSerializers = () => PLUGINS
|
|
678
|
+
const getSerializers = () => PLUGINS;
|
|
2982
679
|
|
|
2983
|
-
var __defProp$
|
|
2984
|
-
var __getOwnPropSymbols$
|
|
2985
|
-
var __hasOwnProp$
|
|
2986
|
-
var __propIsEnum$
|
|
2987
|
-
var __defNormalProp$
|
|
2988
|
-
var __spreadValues$
|
|
680
|
+
var __defProp$3 = Object.defineProperty;
|
|
681
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
682
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
683
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
684
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
685
|
+
var __spreadValues$3 = (a, b) => {
|
|
2989
686
|
for (var prop in b || (b = {}))
|
|
2990
|
-
if (__hasOwnProp$
|
|
2991
|
-
__defNormalProp$
|
|
2992
|
-
if (__getOwnPropSymbols$
|
|
2993
|
-
for (var prop of __getOwnPropSymbols$
|
|
2994
|
-
if (__propIsEnum$
|
|
2995
|
-
__defNormalProp$
|
|
687
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
688
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
689
|
+
if (__getOwnPropSymbols$3)
|
|
690
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
691
|
+
if (__propIsEnum$3.call(b, prop))
|
|
692
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
2996
693
|
}
|
|
2997
694
|
return a;
|
|
2998
695
|
};
|
|
@@ -3028,7 +725,7 @@ const removeExtraLineBreaks = (string) => string.length > 2 && string.startsWith
|
|
|
3028
725
|
const escapeRegex = true;
|
|
3029
726
|
const printFunctionName = false;
|
|
3030
727
|
function serialize(val, indent = 2, formatOverrides = {}) {
|
|
3031
|
-
return normalizeNewlines(format_1(val, __spreadValues$
|
|
728
|
+
return normalizeNewlines(format_1(val, __spreadValues$3({
|
|
3032
729
|
escapeRegex,
|
|
3033
730
|
indent,
|
|
3034
731
|
plugins: getSerializers(),
|
|
@@ -3087,7 +784,7 @@ function deepMergeArray(target = [], source = []) {
|
|
|
3087
784
|
}
|
|
3088
785
|
function deepMergeSnapshot(target, source) {
|
|
3089
786
|
if (isObject(target) && isObject(source)) {
|
|
3090
|
-
const mergedOutput = __spreadValues$
|
|
787
|
+
const mergedOutput = __spreadValues$3({}, target);
|
|
3091
788
|
Object.keys(source).forEach((key) => {
|
|
3092
789
|
if (isObject(source[key]) && !source[key].$$typeof) {
|
|
3093
790
|
if (!(key in target))
|
|
@@ -3197,19 +894,19 @@ function stripSnapshotIndentation(inlineSnapshot) {
|
|
|
3197
894
|
return inlineSnapshot;
|
|
3198
895
|
}
|
|
3199
896
|
|
|
3200
|
-
var __defProp$
|
|
3201
|
-
var __getOwnPropSymbols$
|
|
3202
|
-
var __hasOwnProp$
|
|
3203
|
-
var __propIsEnum$
|
|
3204
|
-
var __defNormalProp$
|
|
3205
|
-
var __spreadValues$
|
|
897
|
+
var __defProp$2 = Object.defineProperty;
|
|
898
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
899
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
900
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
901
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
902
|
+
var __spreadValues$2 = (a, b) => {
|
|
3206
903
|
for (var prop in b || (b = {}))
|
|
3207
|
-
if (__hasOwnProp$
|
|
3208
|
-
__defNormalProp$
|
|
3209
|
-
if (__getOwnPropSymbols$
|
|
3210
|
-
for (var prop of __getOwnPropSymbols$
|
|
3211
|
-
if (__propIsEnum$
|
|
3212
|
-
__defNormalProp$
|
|
904
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
905
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
906
|
+
if (__getOwnPropSymbols$2)
|
|
907
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
908
|
+
if (__propIsEnum$2.call(b, prop))
|
|
909
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
3213
910
|
}
|
|
3214
911
|
return a;
|
|
3215
912
|
};
|
|
@@ -3229,7 +926,7 @@ class SnapshotState {
|
|
|
3229
926
|
this.unmatched = 0;
|
|
3230
927
|
this._updateSnapshot = options.updateSnapshot;
|
|
3231
928
|
this.updated = 0;
|
|
3232
|
-
this._snapshotFormat = __spreadValues$
|
|
929
|
+
this._snapshotFormat = __spreadValues$2({
|
|
3233
930
|
printBasicPrototype: false
|
|
3234
931
|
}, options.snapshotFormat);
|
|
3235
932
|
}
|
|
@@ -3257,7 +954,7 @@ class SnapshotState {
|
|
|
3257
954
|
throw new Error(`Vitest: Couldn't infer stack frame for inline snapshot.
|
|
3258
955
|
${JSON.stringify(stacks)}`);
|
|
3259
956
|
}
|
|
3260
|
-
this._inlineSnapshots.push(__spreadValues$
|
|
957
|
+
this._inlineSnapshots.push(__spreadValues$2({
|
|
3261
958
|
snapshot: receivedSerialized
|
|
3262
959
|
}, stack));
|
|
3263
960
|
} else {
|
|
@@ -3513,127 +1210,6 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
3513
1210
|
});
|
|
3514
1211
|
};
|
|
3515
1212
|
|
|
3516
|
-
var __defProp$2 = Object.defineProperty;
|
|
3517
|
-
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
3518
|
-
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
3519
|
-
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
3520
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3521
|
-
var __spreadValues$2 = (a, b) => {
|
|
3522
|
-
for (var prop in b || (b = {}))
|
|
3523
|
-
if (__hasOwnProp$2.call(b, prop))
|
|
3524
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
3525
|
-
if (__getOwnPropSymbols$2)
|
|
3526
|
-
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
3527
|
-
if (__propIsEnum$2.call(b, prop))
|
|
3528
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
3529
|
-
}
|
|
3530
|
-
return a;
|
|
3531
|
-
};
|
|
3532
|
-
const EXPECTED_COLOR = c$1.green;
|
|
3533
|
-
const RECEIVED_COLOR = c$1.red;
|
|
3534
|
-
const INVERTED_COLOR = c$1.inverse;
|
|
3535
|
-
const BOLD_WEIGHT = c$1.bold;
|
|
3536
|
-
const DIM_COLOR = c$1.dim;
|
|
3537
|
-
const {
|
|
3538
|
-
AsymmetricMatcher: AsymmetricMatcher$1,
|
|
3539
|
-
DOMCollection,
|
|
3540
|
-
DOMElement,
|
|
3541
|
-
Immutable,
|
|
3542
|
-
ReactElement,
|
|
3543
|
-
ReactTestComponent
|
|
3544
|
-
} = plugins_1;
|
|
3545
|
-
const PLUGINS = [
|
|
3546
|
-
ReactTestComponent,
|
|
3547
|
-
ReactElement,
|
|
3548
|
-
DOMElement,
|
|
3549
|
-
DOMCollection,
|
|
3550
|
-
Immutable,
|
|
3551
|
-
AsymmetricMatcher$1
|
|
3552
|
-
];
|
|
3553
|
-
function matcherHint(matcherName, received = "received", expected = "expected", options = {}) {
|
|
3554
|
-
const {
|
|
3555
|
-
comment = "",
|
|
3556
|
-
expectedColor = EXPECTED_COLOR,
|
|
3557
|
-
isDirectExpectCall = false,
|
|
3558
|
-
isNot = false,
|
|
3559
|
-
promise = "",
|
|
3560
|
-
receivedColor = RECEIVED_COLOR,
|
|
3561
|
-
secondArgument = "",
|
|
3562
|
-
secondArgumentColor = EXPECTED_COLOR
|
|
3563
|
-
} = options;
|
|
3564
|
-
let hint = "";
|
|
3565
|
-
let dimString = "expect";
|
|
3566
|
-
if (!isDirectExpectCall && received !== "") {
|
|
3567
|
-
hint += DIM_COLOR(`${dimString}(`) + receivedColor(received);
|
|
3568
|
-
dimString = ")";
|
|
3569
|
-
}
|
|
3570
|
-
if (promise !== "") {
|
|
3571
|
-
hint += DIM_COLOR(`${dimString}.`) + promise;
|
|
3572
|
-
dimString = "";
|
|
3573
|
-
}
|
|
3574
|
-
if (isNot) {
|
|
3575
|
-
hint += `${DIM_COLOR(`${dimString}.`)}not`;
|
|
3576
|
-
dimString = "";
|
|
3577
|
-
}
|
|
3578
|
-
if (matcherName.includes(".")) {
|
|
3579
|
-
dimString += matcherName;
|
|
3580
|
-
} else {
|
|
3581
|
-
hint += DIM_COLOR(`${dimString}.`) + matcherName;
|
|
3582
|
-
dimString = "";
|
|
3583
|
-
}
|
|
3584
|
-
if (expected === "") {
|
|
3585
|
-
dimString += "()";
|
|
3586
|
-
} else {
|
|
3587
|
-
hint += DIM_COLOR(`${dimString}(`) + expectedColor(expected);
|
|
3588
|
-
if (secondArgument)
|
|
3589
|
-
hint += DIM_COLOR(", ") + secondArgumentColor(secondArgument);
|
|
3590
|
-
dimString = ")";
|
|
3591
|
-
}
|
|
3592
|
-
if (comment !== "")
|
|
3593
|
-
dimString += ` // ${comment}`;
|
|
3594
|
-
if (dimString !== "")
|
|
3595
|
-
hint += DIM_COLOR(dimString);
|
|
3596
|
-
return hint;
|
|
3597
|
-
}
|
|
3598
|
-
const SPACE_SYMBOL = "\xB7";
|
|
3599
|
-
const replaceTrailingSpaces = (text) => text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
|
|
3600
|
-
const stringify = (object, maxDepth = 10, options) => {
|
|
3601
|
-
const MAX_LENGTH = 1e4;
|
|
3602
|
-
let result;
|
|
3603
|
-
try {
|
|
3604
|
-
result = format_1(object, __spreadValues$2({
|
|
3605
|
-
maxDepth,
|
|
3606
|
-
plugins: PLUGINS
|
|
3607
|
-
}, options));
|
|
3608
|
-
} catch {
|
|
3609
|
-
result = format_1(object, __spreadValues$2({
|
|
3610
|
-
callToJSON: false,
|
|
3611
|
-
maxDepth,
|
|
3612
|
-
plugins: PLUGINS
|
|
3613
|
-
}, options));
|
|
3614
|
-
}
|
|
3615
|
-
return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(maxDepth / 2)) : result;
|
|
3616
|
-
};
|
|
3617
|
-
const printReceived = (object) => RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));
|
|
3618
|
-
const printExpected = (value) => EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));
|
|
3619
|
-
function diff(a, b, options) {
|
|
3620
|
-
return unifiedDiff(stringify(a), stringify(b));
|
|
3621
|
-
}
|
|
3622
|
-
|
|
3623
|
-
var matcherUtils = /*#__PURE__*/Object.freeze({
|
|
3624
|
-
__proto__: null,
|
|
3625
|
-
EXPECTED_COLOR: EXPECTED_COLOR,
|
|
3626
|
-
RECEIVED_COLOR: RECEIVED_COLOR,
|
|
3627
|
-
INVERTED_COLOR: INVERTED_COLOR,
|
|
3628
|
-
BOLD_WEIGHT: BOLD_WEIGHT,
|
|
3629
|
-
DIM_COLOR: DIM_COLOR,
|
|
3630
|
-
matcherHint: matcherHint,
|
|
3631
|
-
stringify: stringify,
|
|
3632
|
-
printReceived: printReceived,
|
|
3633
|
-
printExpected: printExpected,
|
|
3634
|
-
diff: diff
|
|
3635
|
-
});
|
|
3636
|
-
|
|
3637
1213
|
const MATCHERS_OBJECT = Symbol.for("matchers-object");
|
|
3638
1214
|
if (!Object.prototype.hasOwnProperty.call(global, MATCHERS_OBJECT)) {
|
|
3639
1215
|
const defaultState = {
|
|
@@ -3816,11 +1392,11 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
3816
1392
|
return `${i}th`;
|
|
3817
1393
|
};
|
|
3818
1394
|
const formatCalls = (spy, msg, actualCall) => {
|
|
3819
|
-
msg += c
|
|
1395
|
+
msg += c.gray(`
|
|
3820
1396
|
|
|
3821
1397
|
Received:
|
|
3822
1398
|
${spy.mock.calls.map((callArg, i) => {
|
|
3823
|
-
let methodCall = c
|
|
1399
|
+
let methodCall = c.bold(` ${ordinalOf(i + 1)} ${spy.getMockName()} call:
|
|
3824
1400
|
|
|
3825
1401
|
`);
|
|
3826
1402
|
if (actualCall)
|
|
@@ -3830,9 +1406,9 @@ ${spy.mock.calls.map((callArg, i) => {
|
|
|
3830
1406
|
methodCall += "\n";
|
|
3831
1407
|
return methodCall;
|
|
3832
1408
|
}).join("\n")}`);
|
|
3833
|
-
msg += c
|
|
1409
|
+
msg += c.gray(`
|
|
3834
1410
|
|
|
3835
|
-
Number of calls: ${c
|
|
1411
|
+
Number of calls: ${c.bold(spy.mock.calls.length)}
|
|
3836
1412
|
`);
|
|
3837
1413
|
return msg;
|
|
3838
1414
|
};
|
|
@@ -7095,6 +4671,10 @@ class VitestUtils {
|
|
|
7095
4671
|
globalThis.window[name] = value;
|
|
7096
4672
|
return this;
|
|
7097
4673
|
}
|
|
4674
|
+
resetModules() {
|
|
4675
|
+
resetModules();
|
|
4676
|
+
return this;
|
|
4677
|
+
}
|
|
7098
4678
|
}
|
|
7099
4679
|
const vitest = new VitestUtils();
|
|
7100
4680
|
const vi = vitest;
|
|
@@ -7109,7 +4689,7 @@ function isWatchMode() {
|
|
|
7109
4689
|
var index = /*#__PURE__*/Object.freeze({
|
|
7110
4690
|
__proto__: null,
|
|
7111
4691
|
suite: suite,
|
|
7112
|
-
test: test
|
|
4692
|
+
test: test,
|
|
7113
4693
|
describe: describe,
|
|
7114
4694
|
it: it,
|
|
7115
4695
|
runOnce: runOnce,
|
|
@@ -7128,4 +4708,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
7128
4708
|
isWatchMode: isWatchMode
|
|
7129
4709
|
});
|
|
7130
4710
|
|
|
7131
|
-
export {
|
|
4711
|
+
export { RealDate as R, context as a, getSnapshotClient as b, clearContext as c, defaultSuite as d, setState as e, getFn as f, getHooks as g, getState as h, index as i, suite as j, describe as k, it as l, runOnce as m, isFirstRun as n, beforeAll as o, afterAll as p, beforeEach as q, resetRunOnceCounter as r, setHooks as s, test as t, afterEach as u, vi as v, expect as w, vitest as x, getRunningMode as y, isWatchMode as z };
|