vitest 0.9.0 → 0.9.3
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.e8071f5b.js → chunk-api-setup.d764f144.js} +4 -4
- package/dist/{chunk-constants.596ee4d5.js → chunk-constants.a6ce1057.js} +1 -1
- package/dist/{chunk-defaults.731639a8.js → chunk-defaults.aecec9d4.js} +1 -1
- package/dist/{chunk-integrations-globals.d1145578.js → chunk-integrations-globals.5686bfb8.js} +5 -5
- package/dist/{chunk-runtime-chain.a5280da7.js → chunk-runtime-chain.e17b859e.js} +155 -2578
- package/dist/{chunk-runtime-mocker.ff55be7d.js → chunk-runtime-mocker.d325f149.js} +6 -4
- package/dist/{chunk-runtime-rpc.3f693817.js → chunk-runtime-rpc.9e81f15b.js} +1 -1
- package/dist/{chunk-utils-global.35d3b35d.js → chunk-utils-global.46331799.js} +2 -2
- package/dist/{chunk-utils-timers.73950dcb.js → chunk-utils-timers.6cfeb494.js} +2433 -10
- package/dist/{chunk-vite-node-externalize.2004587d.js → chunk-vite-node-externalize.9aaddc2d.js} +51 -37
- package/dist/{chunk-vite-node-utils.5fa30ee7.js → chunk-vite-node-utils.3400d522.js} +1 -1
- package/dist/cli.js +9 -9
- package/dist/entry.js +6 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +4 -4
- package/dist/node.d.ts +4 -1
- package/dist/node.js +9 -9
- package/dist/{vendor-index.ee829ed6.js → vendor-index.13468339.js} +3 -3
- package/dist/worker.js +5 -5
- package/package.json +4 -4
|
@@ -1,10 +1,2312 @@
|
|
|
1
|
-
import { s as slash, f as notNullish,
|
|
1
|
+
import { s as slash, f as notNullish, e as c$1 } from './chunk-utils-global.46331799.js';
|
|
2
2
|
|
|
3
3
|
const setTimeout$1 = globalThis.setTimeout;
|
|
4
4
|
const setInterval = globalThis.setInterval;
|
|
5
5
|
const clearInterval = globalThis.clearInterval;
|
|
6
6
|
const clearTimeout = globalThis.clearTimeout;
|
|
7
7
|
|
|
8
|
+
var build = {};
|
|
9
|
+
|
|
10
|
+
var ansiStyles$1 = {exports: {}};
|
|
11
|
+
|
|
12
|
+
(function (module) {
|
|
13
|
+
|
|
14
|
+
const ANSI_BACKGROUND_OFFSET = 10;
|
|
15
|
+
|
|
16
|
+
const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
|
|
17
|
+
|
|
18
|
+
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
19
|
+
|
|
20
|
+
function assembleStyles() {
|
|
21
|
+
const codes = new Map();
|
|
22
|
+
const styles = {
|
|
23
|
+
modifier: {
|
|
24
|
+
reset: [0, 0],
|
|
25
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
26
|
+
bold: [1, 22],
|
|
27
|
+
dim: [2, 22],
|
|
28
|
+
italic: [3, 23],
|
|
29
|
+
underline: [4, 24],
|
|
30
|
+
overline: [53, 55],
|
|
31
|
+
inverse: [7, 27],
|
|
32
|
+
hidden: [8, 28],
|
|
33
|
+
strikethrough: [9, 29]
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
black: [30, 39],
|
|
37
|
+
red: [31, 39],
|
|
38
|
+
green: [32, 39],
|
|
39
|
+
yellow: [33, 39],
|
|
40
|
+
blue: [34, 39],
|
|
41
|
+
magenta: [35, 39],
|
|
42
|
+
cyan: [36, 39],
|
|
43
|
+
white: [37, 39],
|
|
44
|
+
|
|
45
|
+
// Bright color
|
|
46
|
+
blackBright: [90, 39],
|
|
47
|
+
redBright: [91, 39],
|
|
48
|
+
greenBright: [92, 39],
|
|
49
|
+
yellowBright: [93, 39],
|
|
50
|
+
blueBright: [94, 39],
|
|
51
|
+
magentaBright: [95, 39],
|
|
52
|
+
cyanBright: [96, 39],
|
|
53
|
+
whiteBright: [97, 39]
|
|
54
|
+
},
|
|
55
|
+
bgColor: {
|
|
56
|
+
bgBlack: [40, 49],
|
|
57
|
+
bgRed: [41, 49],
|
|
58
|
+
bgGreen: [42, 49],
|
|
59
|
+
bgYellow: [43, 49],
|
|
60
|
+
bgBlue: [44, 49],
|
|
61
|
+
bgMagenta: [45, 49],
|
|
62
|
+
bgCyan: [46, 49],
|
|
63
|
+
bgWhite: [47, 49],
|
|
64
|
+
|
|
65
|
+
// Bright color
|
|
66
|
+
bgBlackBright: [100, 49],
|
|
67
|
+
bgRedBright: [101, 49],
|
|
68
|
+
bgGreenBright: [102, 49],
|
|
69
|
+
bgYellowBright: [103, 49],
|
|
70
|
+
bgBlueBright: [104, 49],
|
|
71
|
+
bgMagentaBright: [105, 49],
|
|
72
|
+
bgCyanBright: [106, 49],
|
|
73
|
+
bgWhiteBright: [107, 49]
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// Alias bright black as gray (and grey)
|
|
78
|
+
styles.color.gray = styles.color.blackBright;
|
|
79
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
80
|
+
styles.color.grey = styles.color.blackBright;
|
|
81
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
82
|
+
|
|
83
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
84
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
85
|
+
styles[styleName] = {
|
|
86
|
+
open: `\u001B[${style[0]}m`,
|
|
87
|
+
close: `\u001B[${style[1]}m`
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
group[styleName] = styles[styleName];
|
|
91
|
+
|
|
92
|
+
codes.set(style[0], style[1]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
Object.defineProperty(styles, groupName, {
|
|
96
|
+
value: group,
|
|
97
|
+
enumerable: false
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
Object.defineProperty(styles, 'codes', {
|
|
102
|
+
value: codes,
|
|
103
|
+
enumerable: false
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
styles.color.close = '\u001B[39m';
|
|
107
|
+
styles.bgColor.close = '\u001B[49m';
|
|
108
|
+
|
|
109
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
110
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
111
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
112
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
113
|
+
|
|
114
|
+
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
|
115
|
+
Object.defineProperties(styles, {
|
|
116
|
+
rgbToAnsi256: {
|
|
117
|
+
value: (red, green, blue) => {
|
|
118
|
+
// We use the extended greyscale palette here, with the exception of
|
|
119
|
+
// black and white. normal palette only has 4 greyscale shades.
|
|
120
|
+
if (red === green && green === blue) {
|
|
121
|
+
if (red < 8) {
|
|
122
|
+
return 16;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (red > 248) {
|
|
126
|
+
return 231;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return Math.round(((red - 8) / 247) * 24) + 232;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return 16 +
|
|
133
|
+
(36 * Math.round(red / 255 * 5)) +
|
|
134
|
+
(6 * Math.round(green / 255 * 5)) +
|
|
135
|
+
Math.round(blue / 255 * 5);
|
|
136
|
+
},
|
|
137
|
+
enumerable: false
|
|
138
|
+
},
|
|
139
|
+
hexToRgb: {
|
|
140
|
+
value: hex => {
|
|
141
|
+
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
|
142
|
+
if (!matches) {
|
|
143
|
+
return [0, 0, 0];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let {colorString} = matches.groups;
|
|
147
|
+
|
|
148
|
+
if (colorString.length === 3) {
|
|
149
|
+
colorString = colorString.split('').map(character => character + character).join('');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const integer = Number.parseInt(colorString, 16);
|
|
153
|
+
|
|
154
|
+
return [
|
|
155
|
+
(integer >> 16) & 0xFF,
|
|
156
|
+
(integer >> 8) & 0xFF,
|
|
157
|
+
integer & 0xFF
|
|
158
|
+
];
|
|
159
|
+
},
|
|
160
|
+
enumerable: false
|
|
161
|
+
},
|
|
162
|
+
hexToAnsi256: {
|
|
163
|
+
value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
164
|
+
enumerable: false
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
return styles;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Make the export immutable
|
|
172
|
+
Object.defineProperty(module, 'exports', {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: assembleStyles
|
|
175
|
+
});
|
|
176
|
+
}(ansiStyles$1));
|
|
177
|
+
|
|
178
|
+
var collections = {};
|
|
179
|
+
|
|
180
|
+
Object.defineProperty(collections, '__esModule', {
|
|
181
|
+
value: true
|
|
182
|
+
});
|
|
183
|
+
collections.printIteratorEntries = printIteratorEntries;
|
|
184
|
+
collections.printIteratorValues = printIteratorValues;
|
|
185
|
+
collections.printListItems = printListItems;
|
|
186
|
+
collections.printObjectProperties = printObjectProperties;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the MIT license found in the
|
|
192
|
+
* LICENSE file in the root directory of this source tree.
|
|
193
|
+
*
|
|
194
|
+
*/
|
|
195
|
+
const getKeysOfEnumerableProperties = (object, compareKeys) => {
|
|
196
|
+
const keys = Object.keys(object).sort(compareKeys);
|
|
197
|
+
|
|
198
|
+
if (Object.getOwnPropertySymbols) {
|
|
199
|
+
Object.getOwnPropertySymbols(object).forEach(symbol => {
|
|
200
|
+
if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
|
|
201
|
+
keys.push(symbol);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return keys;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Return entries (for example, of a map)
|
|
210
|
+
* with spacing, indentation, and comma
|
|
211
|
+
* without surrounding punctuation (for example, braces)
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
function printIteratorEntries(
|
|
215
|
+
iterator,
|
|
216
|
+
config,
|
|
217
|
+
indentation,
|
|
218
|
+
depth,
|
|
219
|
+
refs,
|
|
220
|
+
printer, // Too bad, so sad that separator for ECMAScript Map has been ' => '
|
|
221
|
+
// What a distracting diff if you change a data structure to/from
|
|
222
|
+
// ECMAScript Object or Immutable.Map/OrderedMap which use the default.
|
|
223
|
+
separator = ': '
|
|
224
|
+
) {
|
|
225
|
+
let result = '';
|
|
226
|
+
let current = iterator.next();
|
|
227
|
+
|
|
228
|
+
if (!current.done) {
|
|
229
|
+
result += config.spacingOuter;
|
|
230
|
+
const indentationNext = indentation + config.indent;
|
|
231
|
+
|
|
232
|
+
while (!current.done) {
|
|
233
|
+
const name = printer(
|
|
234
|
+
current.value[0],
|
|
235
|
+
config,
|
|
236
|
+
indentationNext,
|
|
237
|
+
depth,
|
|
238
|
+
refs
|
|
239
|
+
);
|
|
240
|
+
const value = printer(
|
|
241
|
+
current.value[1],
|
|
242
|
+
config,
|
|
243
|
+
indentationNext,
|
|
244
|
+
depth,
|
|
245
|
+
refs
|
|
246
|
+
);
|
|
247
|
+
result += indentationNext + name + separator + value;
|
|
248
|
+
current = iterator.next();
|
|
249
|
+
|
|
250
|
+
if (!current.done) {
|
|
251
|
+
result += ',' + config.spacingInner;
|
|
252
|
+
} else if (!config.min) {
|
|
253
|
+
result += ',';
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
result += config.spacingOuter + indentation;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return result;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Return values (for example, of a set)
|
|
264
|
+
* with spacing, indentation, and comma
|
|
265
|
+
* without surrounding punctuation (braces or brackets)
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
function printIteratorValues(
|
|
269
|
+
iterator,
|
|
270
|
+
config,
|
|
271
|
+
indentation,
|
|
272
|
+
depth,
|
|
273
|
+
refs,
|
|
274
|
+
printer
|
|
275
|
+
) {
|
|
276
|
+
let result = '';
|
|
277
|
+
let current = iterator.next();
|
|
278
|
+
|
|
279
|
+
if (!current.done) {
|
|
280
|
+
result += config.spacingOuter;
|
|
281
|
+
const indentationNext = indentation + config.indent;
|
|
282
|
+
|
|
283
|
+
while (!current.done) {
|
|
284
|
+
result +=
|
|
285
|
+
indentationNext +
|
|
286
|
+
printer(current.value, config, indentationNext, depth, refs);
|
|
287
|
+
current = iterator.next();
|
|
288
|
+
|
|
289
|
+
if (!current.done) {
|
|
290
|
+
result += ',' + config.spacingInner;
|
|
291
|
+
} else if (!config.min) {
|
|
292
|
+
result += ',';
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
result += config.spacingOuter + indentation;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return result;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Return items (for example, of an array)
|
|
303
|
+
* with spacing, indentation, and comma
|
|
304
|
+
* without surrounding punctuation (for example, brackets)
|
|
305
|
+
**/
|
|
306
|
+
|
|
307
|
+
function printListItems(list, config, indentation, depth, refs, printer) {
|
|
308
|
+
let result = '';
|
|
309
|
+
|
|
310
|
+
if (list.length) {
|
|
311
|
+
result += config.spacingOuter;
|
|
312
|
+
const indentationNext = indentation + config.indent;
|
|
313
|
+
|
|
314
|
+
for (let i = 0; i < list.length; i++) {
|
|
315
|
+
result += indentationNext;
|
|
316
|
+
|
|
317
|
+
if (i in list) {
|
|
318
|
+
result += printer(list[i], config, indentationNext, depth, refs);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (i < list.length - 1) {
|
|
322
|
+
result += ',' + config.spacingInner;
|
|
323
|
+
} else if (!config.min) {
|
|
324
|
+
result += ',';
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
result += config.spacingOuter + indentation;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return result;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Return properties of an object
|
|
335
|
+
* with spacing, indentation, and comma
|
|
336
|
+
* without surrounding punctuation (for example, braces)
|
|
337
|
+
*/
|
|
338
|
+
|
|
339
|
+
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
|
340
|
+
let result = '';
|
|
341
|
+
const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
|
342
|
+
|
|
343
|
+
if (keys.length) {
|
|
344
|
+
result += config.spacingOuter;
|
|
345
|
+
const indentationNext = indentation + config.indent;
|
|
346
|
+
|
|
347
|
+
for (let i = 0; i < keys.length; i++) {
|
|
348
|
+
const key = keys[i];
|
|
349
|
+
const name = printer(key, config, indentationNext, depth, refs);
|
|
350
|
+
const value = printer(val[key], config, indentationNext, depth, refs);
|
|
351
|
+
result += indentationNext + name + ': ' + value;
|
|
352
|
+
|
|
353
|
+
if (i < keys.length - 1) {
|
|
354
|
+
result += ',' + config.spacingInner;
|
|
355
|
+
} else if (!config.min) {
|
|
356
|
+
result += ',';
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
result += config.spacingOuter + indentation;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return result;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
var AsymmetricMatcher$1 = {};
|
|
367
|
+
|
|
368
|
+
Object.defineProperty(AsymmetricMatcher$1, '__esModule', {
|
|
369
|
+
value: true
|
|
370
|
+
});
|
|
371
|
+
AsymmetricMatcher$1.test = AsymmetricMatcher$1.serialize = AsymmetricMatcher$1.default = void 0;
|
|
372
|
+
|
|
373
|
+
var _collections$3 = collections;
|
|
374
|
+
|
|
375
|
+
var global$1 = (function () {
|
|
376
|
+
if (typeof globalThis !== 'undefined') {
|
|
377
|
+
return globalThis;
|
|
378
|
+
} else if (typeof global$1 !== 'undefined') {
|
|
379
|
+
return global$1;
|
|
380
|
+
} else if (typeof self !== 'undefined') {
|
|
381
|
+
return self;
|
|
382
|
+
} else if (typeof window !== 'undefined') {
|
|
383
|
+
return window;
|
|
384
|
+
} else {
|
|
385
|
+
return Function('return this')();
|
|
386
|
+
}
|
|
387
|
+
})();
|
|
388
|
+
|
|
389
|
+
var Symbol$2 = global$1['jest-symbol-do-not-touch'] || global$1.Symbol;
|
|
390
|
+
const asymmetricMatcher =
|
|
391
|
+
typeof Symbol$2 === 'function' && Symbol$2.for
|
|
392
|
+
? Symbol$2.for('jest.asymmetricMatcher')
|
|
393
|
+
: 0x1357a5;
|
|
394
|
+
const SPACE$2 = ' ';
|
|
395
|
+
|
|
396
|
+
const serialize$6 = (val, config, indentation, depth, refs, printer) => {
|
|
397
|
+
const stringedValue = val.toString();
|
|
398
|
+
|
|
399
|
+
if (
|
|
400
|
+
stringedValue === 'ArrayContaining' ||
|
|
401
|
+
stringedValue === 'ArrayNotContaining'
|
|
402
|
+
) {
|
|
403
|
+
if (++depth > config.maxDepth) {
|
|
404
|
+
return '[' + stringedValue + ']';
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return (
|
|
408
|
+
stringedValue +
|
|
409
|
+
SPACE$2 +
|
|
410
|
+
'[' +
|
|
411
|
+
(0, _collections$3.printListItems)(
|
|
412
|
+
val.sample,
|
|
413
|
+
config,
|
|
414
|
+
indentation,
|
|
415
|
+
depth,
|
|
416
|
+
refs,
|
|
417
|
+
printer
|
|
418
|
+
) +
|
|
419
|
+
']'
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if (
|
|
424
|
+
stringedValue === 'ObjectContaining' ||
|
|
425
|
+
stringedValue === 'ObjectNotContaining'
|
|
426
|
+
) {
|
|
427
|
+
if (++depth > config.maxDepth) {
|
|
428
|
+
return '[' + stringedValue + ']';
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return (
|
|
432
|
+
stringedValue +
|
|
433
|
+
SPACE$2 +
|
|
434
|
+
'{' +
|
|
435
|
+
(0, _collections$3.printObjectProperties)(
|
|
436
|
+
val.sample,
|
|
437
|
+
config,
|
|
438
|
+
indentation,
|
|
439
|
+
depth,
|
|
440
|
+
refs,
|
|
441
|
+
printer
|
|
442
|
+
) +
|
|
443
|
+
'}'
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (
|
|
448
|
+
stringedValue === 'StringMatching' ||
|
|
449
|
+
stringedValue === 'StringNotMatching'
|
|
450
|
+
) {
|
|
451
|
+
return (
|
|
452
|
+
stringedValue +
|
|
453
|
+
SPACE$2 +
|
|
454
|
+
printer(val.sample, config, indentation, depth, refs)
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
if (
|
|
459
|
+
stringedValue === 'StringContaining' ||
|
|
460
|
+
stringedValue === 'StringNotContaining'
|
|
461
|
+
) {
|
|
462
|
+
return (
|
|
463
|
+
stringedValue +
|
|
464
|
+
SPACE$2 +
|
|
465
|
+
printer(val.sample, config, indentation, depth, refs)
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return val.toAsymmetricMatcher();
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
AsymmetricMatcher$1.serialize = serialize$6;
|
|
473
|
+
|
|
474
|
+
const test$6 = val => val && val.$$typeof === asymmetricMatcher;
|
|
475
|
+
|
|
476
|
+
AsymmetricMatcher$1.test = test$6;
|
|
477
|
+
const plugin$6 = {
|
|
478
|
+
serialize: serialize$6,
|
|
479
|
+
test: test$6
|
|
480
|
+
};
|
|
481
|
+
var _default$7 = plugin$6;
|
|
482
|
+
AsymmetricMatcher$1.default = _default$7;
|
|
483
|
+
|
|
484
|
+
var ConvertAnsi = {};
|
|
485
|
+
|
|
486
|
+
var ansiRegex$1 = ({onlyFirst = false} = {}) => {
|
|
487
|
+
const pattern = [
|
|
488
|
+
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
|
489
|
+
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
|
490
|
+
].join('|');
|
|
491
|
+
|
|
492
|
+
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
Object.defineProperty(ConvertAnsi, '__esModule', {
|
|
496
|
+
value: true
|
|
497
|
+
});
|
|
498
|
+
ConvertAnsi.test = ConvertAnsi.serialize = ConvertAnsi.default = void 0;
|
|
499
|
+
|
|
500
|
+
var _ansiRegex = _interopRequireDefault$2(ansiRegex$1);
|
|
501
|
+
|
|
502
|
+
var _ansiStyles$1 = _interopRequireDefault$2(ansiStyles$1.exports);
|
|
503
|
+
|
|
504
|
+
function _interopRequireDefault$2(obj) {
|
|
505
|
+
return obj && obj.__esModule ? obj : {default: obj};
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
510
|
+
*
|
|
511
|
+
* This source code is licensed under the MIT license found in the
|
|
512
|
+
* LICENSE file in the root directory of this source tree.
|
|
513
|
+
*/
|
|
514
|
+
const toHumanReadableAnsi = text =>
|
|
515
|
+
text.replace((0, _ansiRegex.default)(), match => {
|
|
516
|
+
switch (match) {
|
|
517
|
+
case _ansiStyles$1.default.red.close:
|
|
518
|
+
case _ansiStyles$1.default.green.close:
|
|
519
|
+
case _ansiStyles$1.default.cyan.close:
|
|
520
|
+
case _ansiStyles$1.default.gray.close:
|
|
521
|
+
case _ansiStyles$1.default.white.close:
|
|
522
|
+
case _ansiStyles$1.default.yellow.close:
|
|
523
|
+
case _ansiStyles$1.default.bgRed.close:
|
|
524
|
+
case _ansiStyles$1.default.bgGreen.close:
|
|
525
|
+
case _ansiStyles$1.default.bgYellow.close:
|
|
526
|
+
case _ansiStyles$1.default.inverse.close:
|
|
527
|
+
case _ansiStyles$1.default.dim.close:
|
|
528
|
+
case _ansiStyles$1.default.bold.close:
|
|
529
|
+
case _ansiStyles$1.default.reset.open:
|
|
530
|
+
case _ansiStyles$1.default.reset.close:
|
|
531
|
+
return '</>';
|
|
532
|
+
|
|
533
|
+
case _ansiStyles$1.default.red.open:
|
|
534
|
+
return '<red>';
|
|
535
|
+
|
|
536
|
+
case _ansiStyles$1.default.green.open:
|
|
537
|
+
return '<green>';
|
|
538
|
+
|
|
539
|
+
case _ansiStyles$1.default.cyan.open:
|
|
540
|
+
return '<cyan>';
|
|
541
|
+
|
|
542
|
+
case _ansiStyles$1.default.gray.open:
|
|
543
|
+
return '<gray>';
|
|
544
|
+
|
|
545
|
+
case _ansiStyles$1.default.white.open:
|
|
546
|
+
return '<white>';
|
|
547
|
+
|
|
548
|
+
case _ansiStyles$1.default.yellow.open:
|
|
549
|
+
return '<yellow>';
|
|
550
|
+
|
|
551
|
+
case _ansiStyles$1.default.bgRed.open:
|
|
552
|
+
return '<bgRed>';
|
|
553
|
+
|
|
554
|
+
case _ansiStyles$1.default.bgGreen.open:
|
|
555
|
+
return '<bgGreen>';
|
|
556
|
+
|
|
557
|
+
case _ansiStyles$1.default.bgYellow.open:
|
|
558
|
+
return '<bgYellow>';
|
|
559
|
+
|
|
560
|
+
case _ansiStyles$1.default.inverse.open:
|
|
561
|
+
return '<inverse>';
|
|
562
|
+
|
|
563
|
+
case _ansiStyles$1.default.dim.open:
|
|
564
|
+
return '<dim>';
|
|
565
|
+
|
|
566
|
+
case _ansiStyles$1.default.bold.open:
|
|
567
|
+
return '<bold>';
|
|
568
|
+
|
|
569
|
+
default:
|
|
570
|
+
return '';
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
const test$5 = val =>
|
|
575
|
+
typeof val === 'string' && !!val.match((0, _ansiRegex.default)());
|
|
576
|
+
|
|
577
|
+
ConvertAnsi.test = test$5;
|
|
578
|
+
|
|
579
|
+
const serialize$5 = (val, config, indentation, depth, refs, printer) =>
|
|
580
|
+
printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
|
|
581
|
+
|
|
582
|
+
ConvertAnsi.serialize = serialize$5;
|
|
583
|
+
const plugin$5 = {
|
|
584
|
+
serialize: serialize$5,
|
|
585
|
+
test: test$5
|
|
586
|
+
};
|
|
587
|
+
var _default$6 = plugin$5;
|
|
588
|
+
ConvertAnsi.default = _default$6;
|
|
589
|
+
|
|
590
|
+
var DOMCollection$1 = {};
|
|
591
|
+
|
|
592
|
+
Object.defineProperty(DOMCollection$1, '__esModule', {
|
|
593
|
+
value: true
|
|
594
|
+
});
|
|
595
|
+
DOMCollection$1.test = DOMCollection$1.serialize = DOMCollection$1.default = void 0;
|
|
596
|
+
|
|
597
|
+
var _collections$2 = collections;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
601
|
+
*
|
|
602
|
+
* This source code is licensed under the MIT license found in the
|
|
603
|
+
* LICENSE file in the root directory of this source tree.
|
|
604
|
+
*/
|
|
605
|
+
|
|
606
|
+
/* eslint-disable local/ban-types-eventually */
|
|
607
|
+
const SPACE$1 = ' ';
|
|
608
|
+
const OBJECT_NAMES = ['DOMStringMap', 'NamedNodeMap'];
|
|
609
|
+
const ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
|
|
610
|
+
|
|
611
|
+
const testName = name =>
|
|
612
|
+
OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name);
|
|
613
|
+
|
|
614
|
+
const test$4 = val =>
|
|
615
|
+
val &&
|
|
616
|
+
val.constructor &&
|
|
617
|
+
!!val.constructor.name &&
|
|
618
|
+
testName(val.constructor.name);
|
|
619
|
+
|
|
620
|
+
DOMCollection$1.test = test$4;
|
|
621
|
+
|
|
622
|
+
const isNamedNodeMap = collection =>
|
|
623
|
+
collection.constructor.name === 'NamedNodeMap';
|
|
624
|
+
|
|
625
|
+
const serialize$4 = (collection, config, indentation, depth, refs, printer) => {
|
|
626
|
+
const name = collection.constructor.name;
|
|
627
|
+
|
|
628
|
+
if (++depth > config.maxDepth) {
|
|
629
|
+
return '[' + name + ']';
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return (
|
|
633
|
+
(config.min ? '' : name + SPACE$1) +
|
|
634
|
+
(OBJECT_NAMES.indexOf(name) !== -1
|
|
635
|
+
? '{' +
|
|
636
|
+
(0, _collections$2.printObjectProperties)(
|
|
637
|
+
isNamedNodeMap(collection)
|
|
638
|
+
? Array.from(collection).reduce((props, attribute) => {
|
|
639
|
+
props[attribute.name] = attribute.value;
|
|
640
|
+
return props;
|
|
641
|
+
}, {})
|
|
642
|
+
: {...collection},
|
|
643
|
+
config,
|
|
644
|
+
indentation,
|
|
645
|
+
depth,
|
|
646
|
+
refs,
|
|
647
|
+
printer
|
|
648
|
+
) +
|
|
649
|
+
'}'
|
|
650
|
+
: '[' +
|
|
651
|
+
(0, _collections$2.printListItems)(
|
|
652
|
+
Array.from(collection),
|
|
653
|
+
config,
|
|
654
|
+
indentation,
|
|
655
|
+
depth,
|
|
656
|
+
refs,
|
|
657
|
+
printer
|
|
658
|
+
) +
|
|
659
|
+
']')
|
|
660
|
+
);
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
DOMCollection$1.serialize = serialize$4;
|
|
664
|
+
const plugin$4 = {
|
|
665
|
+
serialize: serialize$4,
|
|
666
|
+
test: test$4
|
|
667
|
+
};
|
|
668
|
+
var _default$5 = plugin$4;
|
|
669
|
+
DOMCollection$1.default = _default$5;
|
|
670
|
+
|
|
671
|
+
var DOMElement$1 = {};
|
|
672
|
+
|
|
673
|
+
var markup = {};
|
|
674
|
+
|
|
675
|
+
var escapeHTML$1 = {};
|
|
676
|
+
|
|
677
|
+
Object.defineProperty(escapeHTML$1, '__esModule', {
|
|
678
|
+
value: true
|
|
679
|
+
});
|
|
680
|
+
escapeHTML$1.default = escapeHTML;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
684
|
+
*
|
|
685
|
+
* This source code is licensed under the MIT license found in the
|
|
686
|
+
* LICENSE file in the root directory of this source tree.
|
|
687
|
+
*/
|
|
688
|
+
function escapeHTML(str) {
|
|
689
|
+
return str.replace(/</g, '<').replace(/>/g, '>');
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
Object.defineProperty(markup, '__esModule', {
|
|
693
|
+
value: true
|
|
694
|
+
});
|
|
695
|
+
markup.printText =
|
|
696
|
+
markup.printProps =
|
|
697
|
+
markup.printElementAsLeaf =
|
|
698
|
+
markup.printElement =
|
|
699
|
+
markup.printComment =
|
|
700
|
+
markup.printChildren =
|
|
701
|
+
void 0;
|
|
702
|
+
|
|
703
|
+
var _escapeHTML = _interopRequireDefault$1(escapeHTML$1);
|
|
704
|
+
|
|
705
|
+
function _interopRequireDefault$1(obj) {
|
|
706
|
+
return obj && obj.__esModule ? obj : {default: obj};
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
711
|
+
*
|
|
712
|
+
* This source code is licensed under the MIT license found in the
|
|
713
|
+
* LICENSE file in the root directory of this source tree.
|
|
714
|
+
*/
|
|
715
|
+
// Return empty string if keys is empty.
|
|
716
|
+
const printProps = (keys, props, config, indentation, depth, refs, printer) => {
|
|
717
|
+
const indentationNext = indentation + config.indent;
|
|
718
|
+
const colors = config.colors;
|
|
719
|
+
return keys
|
|
720
|
+
.map(key => {
|
|
721
|
+
const value = props[key];
|
|
722
|
+
let printed = printer(value, config, indentationNext, depth, refs);
|
|
723
|
+
|
|
724
|
+
if (typeof value !== 'string') {
|
|
725
|
+
if (printed.indexOf('\n') !== -1) {
|
|
726
|
+
printed =
|
|
727
|
+
config.spacingOuter +
|
|
728
|
+
indentationNext +
|
|
729
|
+
printed +
|
|
730
|
+
config.spacingOuter +
|
|
731
|
+
indentation;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
printed = '{' + printed + '}';
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
return (
|
|
738
|
+
config.spacingInner +
|
|
739
|
+
indentation +
|
|
740
|
+
colors.prop.open +
|
|
741
|
+
key +
|
|
742
|
+
colors.prop.close +
|
|
743
|
+
'=' +
|
|
744
|
+
colors.value.open +
|
|
745
|
+
printed +
|
|
746
|
+
colors.value.close
|
|
747
|
+
);
|
|
748
|
+
})
|
|
749
|
+
.join('');
|
|
750
|
+
}; // Return empty string if children is empty.
|
|
751
|
+
|
|
752
|
+
markup.printProps = printProps;
|
|
753
|
+
|
|
754
|
+
const printChildren = (children, config, indentation, depth, refs, printer) =>
|
|
755
|
+
children
|
|
756
|
+
.map(
|
|
757
|
+
child =>
|
|
758
|
+
config.spacingOuter +
|
|
759
|
+
indentation +
|
|
760
|
+
(typeof child === 'string'
|
|
761
|
+
? printText(child, config)
|
|
762
|
+
: printer(child, config, indentation, depth, refs))
|
|
763
|
+
)
|
|
764
|
+
.join('');
|
|
765
|
+
|
|
766
|
+
markup.printChildren = printChildren;
|
|
767
|
+
|
|
768
|
+
const printText = (text, config) => {
|
|
769
|
+
const contentColor = config.colors.content;
|
|
770
|
+
return (
|
|
771
|
+
contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close
|
|
772
|
+
);
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
markup.printText = printText;
|
|
776
|
+
|
|
777
|
+
const printComment = (comment, config) => {
|
|
778
|
+
const commentColor = config.colors.comment;
|
|
779
|
+
return (
|
|
780
|
+
commentColor.open +
|
|
781
|
+
'<!--' +
|
|
782
|
+
(0, _escapeHTML.default)(comment) +
|
|
783
|
+
'-->' +
|
|
784
|
+
commentColor.close
|
|
785
|
+
);
|
|
786
|
+
}; // Separate the functions to format props, children, and element,
|
|
787
|
+
// so a plugin could override a particular function, if needed.
|
|
788
|
+
// Too bad, so sad: the traditional (but unnecessary) space
|
|
789
|
+
// in a self-closing tagColor requires a second test of printedProps.
|
|
790
|
+
|
|
791
|
+
markup.printComment = printComment;
|
|
792
|
+
|
|
793
|
+
const printElement = (
|
|
794
|
+
type,
|
|
795
|
+
printedProps,
|
|
796
|
+
printedChildren,
|
|
797
|
+
config,
|
|
798
|
+
indentation
|
|
799
|
+
) => {
|
|
800
|
+
const tagColor = config.colors.tag;
|
|
801
|
+
return (
|
|
802
|
+
tagColor.open +
|
|
803
|
+
'<' +
|
|
804
|
+
type +
|
|
805
|
+
(printedProps &&
|
|
806
|
+
tagColor.close +
|
|
807
|
+
printedProps +
|
|
808
|
+
config.spacingOuter +
|
|
809
|
+
indentation +
|
|
810
|
+
tagColor.open) +
|
|
811
|
+
(printedChildren
|
|
812
|
+
? '>' +
|
|
813
|
+
tagColor.close +
|
|
814
|
+
printedChildren +
|
|
815
|
+
config.spacingOuter +
|
|
816
|
+
indentation +
|
|
817
|
+
tagColor.open +
|
|
818
|
+
'</' +
|
|
819
|
+
type
|
|
820
|
+
: (printedProps && !config.min ? '' : ' ') + '/') +
|
|
821
|
+
'>' +
|
|
822
|
+
tagColor.close
|
|
823
|
+
);
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
markup.printElement = printElement;
|
|
827
|
+
|
|
828
|
+
const printElementAsLeaf = (type, config) => {
|
|
829
|
+
const tagColor = config.colors.tag;
|
|
830
|
+
return (
|
|
831
|
+
tagColor.open +
|
|
832
|
+
'<' +
|
|
833
|
+
type +
|
|
834
|
+
tagColor.close +
|
|
835
|
+
' …' +
|
|
836
|
+
tagColor.open +
|
|
837
|
+
' />' +
|
|
838
|
+
tagColor.close
|
|
839
|
+
);
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
markup.printElementAsLeaf = printElementAsLeaf;
|
|
843
|
+
|
|
844
|
+
Object.defineProperty(DOMElement$1, '__esModule', {
|
|
845
|
+
value: true
|
|
846
|
+
});
|
|
847
|
+
DOMElement$1.test = DOMElement$1.serialize = DOMElement$1.default = void 0;
|
|
848
|
+
|
|
849
|
+
var _markup$2 = markup;
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
853
|
+
*
|
|
854
|
+
* This source code is licensed under the MIT license found in the
|
|
855
|
+
* LICENSE file in the root directory of this source tree.
|
|
856
|
+
*/
|
|
857
|
+
const ELEMENT_NODE = 1;
|
|
858
|
+
const TEXT_NODE = 3;
|
|
859
|
+
const COMMENT_NODE = 8;
|
|
860
|
+
const FRAGMENT_NODE = 11;
|
|
861
|
+
const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
|
|
862
|
+
|
|
863
|
+
const testHasAttribute = val => {
|
|
864
|
+
try {
|
|
865
|
+
return typeof val.hasAttribute === 'function' && val.hasAttribute('is');
|
|
866
|
+
} catch {
|
|
867
|
+
return false;
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
const testNode = val => {
|
|
872
|
+
const constructorName = val.constructor.name;
|
|
873
|
+
const {nodeType, tagName} = val;
|
|
874
|
+
const isCustomElement =
|
|
875
|
+
(typeof tagName === 'string' && tagName.includes('-')) ||
|
|
876
|
+
testHasAttribute(val);
|
|
877
|
+
return (
|
|
878
|
+
(nodeType === ELEMENT_NODE &&
|
|
879
|
+
(ELEMENT_REGEXP.test(constructorName) || isCustomElement)) ||
|
|
880
|
+
(nodeType === TEXT_NODE && constructorName === 'Text') ||
|
|
881
|
+
(nodeType === COMMENT_NODE && constructorName === 'Comment') ||
|
|
882
|
+
(nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment')
|
|
883
|
+
);
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
const test$3 = val => {
|
|
887
|
+
var _val$constructor;
|
|
888
|
+
|
|
889
|
+
return (
|
|
890
|
+
(val === null || val === void 0
|
|
891
|
+
? void 0
|
|
892
|
+
: (_val$constructor = val.constructor) === null ||
|
|
893
|
+
_val$constructor === void 0
|
|
894
|
+
? void 0
|
|
895
|
+
: _val$constructor.name) && testNode(val)
|
|
896
|
+
);
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
DOMElement$1.test = test$3;
|
|
900
|
+
|
|
901
|
+
function nodeIsText(node) {
|
|
902
|
+
return node.nodeType === TEXT_NODE;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
function nodeIsComment(node) {
|
|
906
|
+
return node.nodeType === COMMENT_NODE;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
function nodeIsFragment(node) {
|
|
910
|
+
return node.nodeType === FRAGMENT_NODE;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
const serialize$3 = (node, config, indentation, depth, refs, printer) => {
|
|
914
|
+
if (nodeIsText(node)) {
|
|
915
|
+
return (0, _markup$2.printText)(node.data, config);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
if (nodeIsComment(node)) {
|
|
919
|
+
return (0, _markup$2.printComment)(node.data, config);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
const type = nodeIsFragment(node)
|
|
923
|
+
? 'DocumentFragment'
|
|
924
|
+
: node.tagName.toLowerCase();
|
|
925
|
+
|
|
926
|
+
if (++depth > config.maxDepth) {
|
|
927
|
+
return (0, _markup$2.printElementAsLeaf)(type, config);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
return (0, _markup$2.printElement)(
|
|
931
|
+
type,
|
|
932
|
+
(0, _markup$2.printProps)(
|
|
933
|
+
nodeIsFragment(node)
|
|
934
|
+
? []
|
|
935
|
+
: Array.from(node.attributes)
|
|
936
|
+
.map(attr => attr.name)
|
|
937
|
+
.sort(),
|
|
938
|
+
nodeIsFragment(node)
|
|
939
|
+
? {}
|
|
940
|
+
: Array.from(node.attributes).reduce((props, attribute) => {
|
|
941
|
+
props[attribute.name] = attribute.value;
|
|
942
|
+
return props;
|
|
943
|
+
}, {}),
|
|
944
|
+
config,
|
|
945
|
+
indentation + config.indent,
|
|
946
|
+
depth,
|
|
947
|
+
refs,
|
|
948
|
+
printer
|
|
949
|
+
),
|
|
950
|
+
(0, _markup$2.printChildren)(
|
|
951
|
+
Array.prototype.slice.call(node.childNodes || node.children),
|
|
952
|
+
config,
|
|
953
|
+
indentation + config.indent,
|
|
954
|
+
depth,
|
|
955
|
+
refs,
|
|
956
|
+
printer
|
|
957
|
+
),
|
|
958
|
+
config,
|
|
959
|
+
indentation
|
|
960
|
+
);
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
DOMElement$1.serialize = serialize$3;
|
|
964
|
+
const plugin$3 = {
|
|
965
|
+
serialize: serialize$3,
|
|
966
|
+
test: test$3
|
|
967
|
+
};
|
|
968
|
+
var _default$4 = plugin$3;
|
|
969
|
+
DOMElement$1.default = _default$4;
|
|
970
|
+
|
|
971
|
+
var Immutable$1 = {};
|
|
972
|
+
|
|
973
|
+
Object.defineProperty(Immutable$1, '__esModule', {
|
|
974
|
+
value: true
|
|
975
|
+
});
|
|
976
|
+
Immutable$1.test = Immutable$1.serialize = Immutable$1.default = void 0;
|
|
977
|
+
|
|
978
|
+
var _collections$1 = collections;
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
982
|
+
*
|
|
983
|
+
* This source code is licensed under the MIT license found in the
|
|
984
|
+
* LICENSE file in the root directory of this source tree.
|
|
985
|
+
*/
|
|
986
|
+
// SENTINEL constants are from https://github.com/facebook/immutable-js
|
|
987
|
+
const IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
|
|
988
|
+
const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
|
|
989
|
+
const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
|
|
990
|
+
const IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
|
|
991
|
+
const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
|
|
992
|
+
const IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4
|
|
993
|
+
|
|
994
|
+
const IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
|
|
995
|
+
const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
|
|
996
|
+
const IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
|
|
997
|
+
|
|
998
|
+
const getImmutableName = name => 'Immutable.' + name;
|
|
999
|
+
|
|
1000
|
+
const printAsLeaf = name => '[' + name + ']';
|
|
1001
|
+
|
|
1002
|
+
const SPACE = ' ';
|
|
1003
|
+
const LAZY = '…'; // Seq is lazy if it calls a method like filter
|
|
1004
|
+
|
|
1005
|
+
const printImmutableEntries = (
|
|
1006
|
+
val,
|
|
1007
|
+
config,
|
|
1008
|
+
indentation,
|
|
1009
|
+
depth,
|
|
1010
|
+
refs,
|
|
1011
|
+
printer,
|
|
1012
|
+
type
|
|
1013
|
+
) =>
|
|
1014
|
+
++depth > config.maxDepth
|
|
1015
|
+
? printAsLeaf(getImmutableName(type))
|
|
1016
|
+
: getImmutableName(type) +
|
|
1017
|
+
SPACE +
|
|
1018
|
+
'{' +
|
|
1019
|
+
(0, _collections$1.printIteratorEntries)(
|
|
1020
|
+
val.entries(),
|
|
1021
|
+
config,
|
|
1022
|
+
indentation,
|
|
1023
|
+
depth,
|
|
1024
|
+
refs,
|
|
1025
|
+
printer
|
|
1026
|
+
) +
|
|
1027
|
+
'}'; // Record has an entries method because it is a collection in immutable v3.
|
|
1028
|
+
// Return an iterator for Immutable Record from version v3 or v4.
|
|
1029
|
+
|
|
1030
|
+
function getRecordEntries(val) {
|
|
1031
|
+
let i = 0;
|
|
1032
|
+
return {
|
|
1033
|
+
next() {
|
|
1034
|
+
if (i < val._keys.length) {
|
|
1035
|
+
const key = val._keys[i++];
|
|
1036
|
+
return {
|
|
1037
|
+
done: false,
|
|
1038
|
+
value: [key, val.get(key)]
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
return {
|
|
1043
|
+
done: true,
|
|
1044
|
+
value: undefined
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
const printImmutableRecord = (
|
|
1051
|
+
val,
|
|
1052
|
+
config,
|
|
1053
|
+
indentation,
|
|
1054
|
+
depth,
|
|
1055
|
+
refs,
|
|
1056
|
+
printer
|
|
1057
|
+
) => {
|
|
1058
|
+
// _name property is defined only for an Immutable Record instance
|
|
1059
|
+
// which was constructed with a second optional descriptive name arg
|
|
1060
|
+
const name = getImmutableName(val._name || 'Record');
|
|
1061
|
+
return ++depth > config.maxDepth
|
|
1062
|
+
? printAsLeaf(name)
|
|
1063
|
+
: name +
|
|
1064
|
+
SPACE +
|
|
1065
|
+
'{' +
|
|
1066
|
+
(0, _collections$1.printIteratorEntries)(
|
|
1067
|
+
getRecordEntries(val),
|
|
1068
|
+
config,
|
|
1069
|
+
indentation,
|
|
1070
|
+
depth,
|
|
1071
|
+
refs,
|
|
1072
|
+
printer
|
|
1073
|
+
) +
|
|
1074
|
+
'}';
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1077
|
+
const printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
|
|
1078
|
+
const name = getImmutableName('Seq');
|
|
1079
|
+
|
|
1080
|
+
if (++depth > config.maxDepth) {
|
|
1081
|
+
return printAsLeaf(name);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
if (val[IS_KEYED_SENTINEL]) {
|
|
1085
|
+
return (
|
|
1086
|
+
name +
|
|
1087
|
+
SPACE +
|
|
1088
|
+
'{' + // from Immutable collection of entries or from ECMAScript object
|
|
1089
|
+
(val._iter || val._object
|
|
1090
|
+
? (0, _collections$1.printIteratorEntries)(
|
|
1091
|
+
val.entries(),
|
|
1092
|
+
config,
|
|
1093
|
+
indentation,
|
|
1094
|
+
depth,
|
|
1095
|
+
refs,
|
|
1096
|
+
printer
|
|
1097
|
+
)
|
|
1098
|
+
: LAZY) +
|
|
1099
|
+
'}'
|
|
1100
|
+
);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
return (
|
|
1104
|
+
name +
|
|
1105
|
+
SPACE +
|
|
1106
|
+
'[' +
|
|
1107
|
+
(val._iter || // from Immutable collection of values
|
|
1108
|
+
val._array || // from ECMAScript array
|
|
1109
|
+
val._collection || // from ECMAScript collection in immutable v4
|
|
1110
|
+
val._iterable // from ECMAScript collection in immutable v3
|
|
1111
|
+
? (0, _collections$1.printIteratorValues)(
|
|
1112
|
+
val.values(),
|
|
1113
|
+
config,
|
|
1114
|
+
indentation,
|
|
1115
|
+
depth,
|
|
1116
|
+
refs,
|
|
1117
|
+
printer
|
|
1118
|
+
)
|
|
1119
|
+
: LAZY) +
|
|
1120
|
+
']'
|
|
1121
|
+
);
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
const printImmutableValues = (
|
|
1125
|
+
val,
|
|
1126
|
+
config,
|
|
1127
|
+
indentation,
|
|
1128
|
+
depth,
|
|
1129
|
+
refs,
|
|
1130
|
+
printer,
|
|
1131
|
+
type
|
|
1132
|
+
) =>
|
|
1133
|
+
++depth > config.maxDepth
|
|
1134
|
+
? printAsLeaf(getImmutableName(type))
|
|
1135
|
+
: getImmutableName(type) +
|
|
1136
|
+
SPACE +
|
|
1137
|
+
'[' +
|
|
1138
|
+
(0, _collections$1.printIteratorValues)(
|
|
1139
|
+
val.values(),
|
|
1140
|
+
config,
|
|
1141
|
+
indentation,
|
|
1142
|
+
depth,
|
|
1143
|
+
refs,
|
|
1144
|
+
printer
|
|
1145
|
+
) +
|
|
1146
|
+
']';
|
|
1147
|
+
|
|
1148
|
+
const serialize$2 = (val, config, indentation, depth, refs, printer) => {
|
|
1149
|
+
if (val[IS_MAP_SENTINEL]) {
|
|
1150
|
+
return printImmutableEntries(
|
|
1151
|
+
val,
|
|
1152
|
+
config,
|
|
1153
|
+
indentation,
|
|
1154
|
+
depth,
|
|
1155
|
+
refs,
|
|
1156
|
+
printer,
|
|
1157
|
+
val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map'
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
if (val[IS_LIST_SENTINEL]) {
|
|
1162
|
+
return printImmutableValues(
|
|
1163
|
+
val,
|
|
1164
|
+
config,
|
|
1165
|
+
indentation,
|
|
1166
|
+
depth,
|
|
1167
|
+
refs,
|
|
1168
|
+
printer,
|
|
1169
|
+
'List'
|
|
1170
|
+
);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (val[IS_SET_SENTINEL]) {
|
|
1174
|
+
return printImmutableValues(
|
|
1175
|
+
val,
|
|
1176
|
+
config,
|
|
1177
|
+
indentation,
|
|
1178
|
+
depth,
|
|
1179
|
+
refs,
|
|
1180
|
+
printer,
|
|
1181
|
+
val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set'
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
if (val[IS_STACK_SENTINEL]) {
|
|
1186
|
+
return printImmutableValues(
|
|
1187
|
+
val,
|
|
1188
|
+
config,
|
|
1189
|
+
indentation,
|
|
1190
|
+
depth,
|
|
1191
|
+
refs,
|
|
1192
|
+
printer,
|
|
1193
|
+
'Stack'
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
if (val[IS_SEQ_SENTINEL]) {
|
|
1198
|
+
return printImmutableSeq(val, config, indentation, depth, refs, printer);
|
|
1199
|
+
} // For compatibility with immutable v3 and v4, let record be the default.
|
|
1200
|
+
|
|
1201
|
+
return printImmutableRecord(val, config, indentation, depth, refs, printer);
|
|
1202
|
+
}; // Explicitly comparing sentinel properties to true avoids false positive
|
|
1203
|
+
// when mock identity-obj-proxy returns the key as the value for any key.
|
|
1204
|
+
|
|
1205
|
+
Immutable$1.serialize = serialize$2;
|
|
1206
|
+
|
|
1207
|
+
const test$2 = val =>
|
|
1208
|
+
val &&
|
|
1209
|
+
(val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
|
|
1210
|
+
|
|
1211
|
+
Immutable$1.test = test$2;
|
|
1212
|
+
const plugin$2 = {
|
|
1213
|
+
serialize: serialize$2,
|
|
1214
|
+
test: test$2
|
|
1215
|
+
};
|
|
1216
|
+
var _default$3 = plugin$2;
|
|
1217
|
+
Immutable$1.default = _default$3;
|
|
1218
|
+
|
|
1219
|
+
var ReactElement$1 = {};
|
|
1220
|
+
|
|
1221
|
+
var reactIs = {exports: {}};
|
|
1222
|
+
|
|
1223
|
+
var reactIs_production_min = {};
|
|
1224
|
+
|
|
1225
|
+
/** @license React v17.0.2
|
|
1226
|
+
* react-is.production.min.js
|
|
1227
|
+
*
|
|
1228
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1229
|
+
*
|
|
1230
|
+
* This source code is licensed under the MIT license found in the
|
|
1231
|
+
* LICENSE file in the root directory of this source tree.
|
|
1232
|
+
*/
|
|
1233
|
+
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;
|
|
1234
|
+
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");}
|
|
1235
|
+
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;
|
|
1236
|
+
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};
|
|
1237
|
+
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};
|
|
1238
|
+
reactIs_production_min.typeOf=y;
|
|
1239
|
+
|
|
1240
|
+
var reactIs_development = {};
|
|
1241
|
+
|
|
1242
|
+
/** @license React v17.0.2
|
|
1243
|
+
* react-is.development.js
|
|
1244
|
+
*
|
|
1245
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1246
|
+
*
|
|
1247
|
+
* This source code is licensed under the MIT license found in the
|
|
1248
|
+
* LICENSE file in the root directory of this source tree.
|
|
1249
|
+
*/
|
|
1250
|
+
|
|
1251
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1252
|
+
(function() {
|
|
1253
|
+
|
|
1254
|
+
// ATTENTION
|
|
1255
|
+
// When adding new symbols to this file,
|
|
1256
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
1257
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
1258
|
+
// nor polyfill, then a plain number is used for performance.
|
|
1259
|
+
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
1260
|
+
var REACT_PORTAL_TYPE = 0xeaca;
|
|
1261
|
+
var REACT_FRAGMENT_TYPE = 0xeacb;
|
|
1262
|
+
var REACT_STRICT_MODE_TYPE = 0xeacc;
|
|
1263
|
+
var REACT_PROFILER_TYPE = 0xead2;
|
|
1264
|
+
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
1265
|
+
var REACT_CONTEXT_TYPE = 0xeace;
|
|
1266
|
+
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
1267
|
+
var REACT_SUSPENSE_TYPE = 0xead1;
|
|
1268
|
+
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
1269
|
+
var REACT_MEMO_TYPE = 0xead3;
|
|
1270
|
+
var REACT_LAZY_TYPE = 0xead4;
|
|
1271
|
+
var REACT_BLOCK_TYPE = 0xead9;
|
|
1272
|
+
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
1273
|
+
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
1274
|
+
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
1275
|
+
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
1276
|
+
|
|
1277
|
+
if (typeof Symbol === 'function' && Symbol.for) {
|
|
1278
|
+
var symbolFor = Symbol.for;
|
|
1279
|
+
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
1280
|
+
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
1281
|
+
REACT_FRAGMENT_TYPE = symbolFor('react.fragment');
|
|
1282
|
+
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
|
|
1283
|
+
REACT_PROFILER_TYPE = symbolFor('react.profiler');
|
|
1284
|
+
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
1285
|
+
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
1286
|
+
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
1287
|
+
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
|
|
1288
|
+
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
1289
|
+
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
1290
|
+
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
1291
|
+
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
1292
|
+
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
1293
|
+
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
1294
|
+
symbolFor('react.scope');
|
|
1295
|
+
symbolFor('react.opaque.id');
|
|
1296
|
+
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
1297
|
+
symbolFor('react.offscreen');
|
|
1298
|
+
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1302
|
+
|
|
1303
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1304
|
+
|
|
1305
|
+
function isValidElementType(type) {
|
|
1306
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
1307
|
+
return true;
|
|
1308
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
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 ) {
|
|
1312
|
+
return true;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
if (typeof type === 'object' && type !== null) {
|
|
1316
|
+
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) {
|
|
1317
|
+
return true;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
return false;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
function typeOf(object) {
|
|
1325
|
+
if (typeof object === 'object' && object !== null) {
|
|
1326
|
+
var $$typeof = object.$$typeof;
|
|
1327
|
+
|
|
1328
|
+
switch ($$typeof) {
|
|
1329
|
+
case REACT_ELEMENT_TYPE:
|
|
1330
|
+
var type = object.type;
|
|
1331
|
+
|
|
1332
|
+
switch (type) {
|
|
1333
|
+
case REACT_FRAGMENT_TYPE:
|
|
1334
|
+
case REACT_PROFILER_TYPE:
|
|
1335
|
+
case REACT_STRICT_MODE_TYPE:
|
|
1336
|
+
case REACT_SUSPENSE_TYPE:
|
|
1337
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1338
|
+
return type;
|
|
1339
|
+
|
|
1340
|
+
default:
|
|
1341
|
+
var $$typeofType = type && type.$$typeof;
|
|
1342
|
+
|
|
1343
|
+
switch ($$typeofType) {
|
|
1344
|
+
case REACT_CONTEXT_TYPE:
|
|
1345
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1346
|
+
case REACT_LAZY_TYPE:
|
|
1347
|
+
case REACT_MEMO_TYPE:
|
|
1348
|
+
case REACT_PROVIDER_TYPE:
|
|
1349
|
+
return $$typeofType;
|
|
1350
|
+
|
|
1351
|
+
default:
|
|
1352
|
+
return $$typeof;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
case REACT_PORTAL_TYPE:
|
|
1358
|
+
return $$typeof;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
return undefined;
|
|
1363
|
+
}
|
|
1364
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
1365
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1366
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
1367
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
1368
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
1369
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
1370
|
+
var Memo = REACT_MEMO_TYPE;
|
|
1371
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
1372
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
1373
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1374
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
1375
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
1376
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
1377
|
+
|
|
1378
|
+
function isAsyncMode(object) {
|
|
1379
|
+
{
|
|
1380
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
1381
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1382
|
+
|
|
1383
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
return false;
|
|
1388
|
+
}
|
|
1389
|
+
function isConcurrentMode(object) {
|
|
1390
|
+
{
|
|
1391
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
1392
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1393
|
+
|
|
1394
|
+
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
return false;
|
|
1399
|
+
}
|
|
1400
|
+
function isContextConsumer(object) {
|
|
1401
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
1402
|
+
}
|
|
1403
|
+
function isContextProvider(object) {
|
|
1404
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
1405
|
+
}
|
|
1406
|
+
function isElement(object) {
|
|
1407
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1408
|
+
}
|
|
1409
|
+
function isForwardRef(object) {
|
|
1410
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
1411
|
+
}
|
|
1412
|
+
function isFragment(object) {
|
|
1413
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
1414
|
+
}
|
|
1415
|
+
function isLazy(object) {
|
|
1416
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
1417
|
+
}
|
|
1418
|
+
function isMemo(object) {
|
|
1419
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
1420
|
+
}
|
|
1421
|
+
function isPortal(object) {
|
|
1422
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
1423
|
+
}
|
|
1424
|
+
function isProfiler(object) {
|
|
1425
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
1426
|
+
}
|
|
1427
|
+
function isStrictMode(object) {
|
|
1428
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
1429
|
+
}
|
|
1430
|
+
function isSuspense(object) {
|
|
1431
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
1435
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
1436
|
+
reactIs_development.Element = Element;
|
|
1437
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
1438
|
+
reactIs_development.Fragment = Fragment;
|
|
1439
|
+
reactIs_development.Lazy = Lazy;
|
|
1440
|
+
reactIs_development.Memo = Memo;
|
|
1441
|
+
reactIs_development.Portal = Portal;
|
|
1442
|
+
reactIs_development.Profiler = Profiler;
|
|
1443
|
+
reactIs_development.StrictMode = StrictMode;
|
|
1444
|
+
reactIs_development.Suspense = Suspense;
|
|
1445
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
1446
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
1447
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
1448
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
1449
|
+
reactIs_development.isElement = isElement;
|
|
1450
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
1451
|
+
reactIs_development.isFragment = isFragment;
|
|
1452
|
+
reactIs_development.isLazy = isLazy;
|
|
1453
|
+
reactIs_development.isMemo = isMemo;
|
|
1454
|
+
reactIs_development.isPortal = isPortal;
|
|
1455
|
+
reactIs_development.isProfiler = isProfiler;
|
|
1456
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
1457
|
+
reactIs_development.isSuspense = isSuspense;
|
|
1458
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
1459
|
+
reactIs_development.typeOf = typeOf;
|
|
1460
|
+
})();
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
if (process.env.NODE_ENV === 'production') {
|
|
1464
|
+
reactIs.exports = reactIs_production_min;
|
|
1465
|
+
} else {
|
|
1466
|
+
reactIs.exports = reactIs_development;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
Object.defineProperty(ReactElement$1, '__esModule', {
|
|
1470
|
+
value: true
|
|
1471
|
+
});
|
|
1472
|
+
ReactElement$1.test = ReactElement$1.serialize = ReactElement$1.default = void 0;
|
|
1473
|
+
|
|
1474
|
+
var ReactIs = _interopRequireWildcard(reactIs.exports);
|
|
1475
|
+
|
|
1476
|
+
var _markup$1 = markup;
|
|
1477
|
+
|
|
1478
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
1479
|
+
if (typeof WeakMap !== 'function') return null;
|
|
1480
|
+
var cacheBabelInterop = new WeakMap();
|
|
1481
|
+
var cacheNodeInterop = new WeakMap();
|
|
1482
|
+
return (_getRequireWildcardCache = function (nodeInterop) {
|
|
1483
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
1484
|
+
})(nodeInterop);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
1488
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
1489
|
+
return obj;
|
|
1490
|
+
}
|
|
1491
|
+
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
1492
|
+
return {default: obj};
|
|
1493
|
+
}
|
|
1494
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
1495
|
+
if (cache && cache.has(obj)) {
|
|
1496
|
+
return cache.get(obj);
|
|
1497
|
+
}
|
|
1498
|
+
var newObj = {};
|
|
1499
|
+
var hasPropertyDescriptor =
|
|
1500
|
+
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1501
|
+
for (var key in obj) {
|
|
1502
|
+
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1503
|
+
var desc = hasPropertyDescriptor
|
|
1504
|
+
? Object.getOwnPropertyDescriptor(obj, key)
|
|
1505
|
+
: null;
|
|
1506
|
+
if (desc && (desc.get || desc.set)) {
|
|
1507
|
+
Object.defineProperty(newObj, key, desc);
|
|
1508
|
+
} else {
|
|
1509
|
+
newObj[key] = obj[key];
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
newObj.default = obj;
|
|
1514
|
+
if (cache) {
|
|
1515
|
+
cache.set(obj, newObj);
|
|
1516
|
+
}
|
|
1517
|
+
return newObj;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1522
|
+
*
|
|
1523
|
+
* This source code is licensed under the MIT license found in the
|
|
1524
|
+
* LICENSE file in the root directory of this source tree.
|
|
1525
|
+
*/
|
|
1526
|
+
// Given element.props.children, or subtree during recursive traversal,
|
|
1527
|
+
// return flattened array of children.
|
|
1528
|
+
const getChildren = (arg, children = []) => {
|
|
1529
|
+
if (Array.isArray(arg)) {
|
|
1530
|
+
arg.forEach(item => {
|
|
1531
|
+
getChildren(item, children);
|
|
1532
|
+
});
|
|
1533
|
+
} else if (arg != null && arg !== false) {
|
|
1534
|
+
children.push(arg);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
return children;
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
const getType = element => {
|
|
1541
|
+
const type = element.type;
|
|
1542
|
+
|
|
1543
|
+
if (typeof type === 'string') {
|
|
1544
|
+
return type;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
if (typeof type === 'function') {
|
|
1548
|
+
return type.displayName || type.name || 'Unknown';
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
if (ReactIs.isFragment(element)) {
|
|
1552
|
+
return 'React.Fragment';
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
if (ReactIs.isSuspense(element)) {
|
|
1556
|
+
return 'React.Suspense';
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
if (typeof type === 'object' && type !== null) {
|
|
1560
|
+
if (ReactIs.isContextProvider(element)) {
|
|
1561
|
+
return 'Context.Provider';
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
if (ReactIs.isContextConsumer(element)) {
|
|
1565
|
+
return 'Context.Consumer';
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
if (ReactIs.isForwardRef(element)) {
|
|
1569
|
+
if (type.displayName) {
|
|
1570
|
+
return type.displayName;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
const functionName = type.render.displayName || type.render.name || '';
|
|
1574
|
+
return functionName !== ''
|
|
1575
|
+
? 'ForwardRef(' + functionName + ')'
|
|
1576
|
+
: 'ForwardRef';
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
if (ReactIs.isMemo(element)) {
|
|
1580
|
+
const functionName =
|
|
1581
|
+
type.displayName || type.type.displayName || type.type.name || '';
|
|
1582
|
+
return functionName !== '' ? 'Memo(' + functionName + ')' : 'Memo';
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
return 'UNDEFINED';
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
const getPropKeys$1 = element => {
|
|
1590
|
+
const {props} = element;
|
|
1591
|
+
return Object.keys(props)
|
|
1592
|
+
.filter(key => key !== 'children' && props[key] !== undefined)
|
|
1593
|
+
.sort();
|
|
1594
|
+
};
|
|
1595
|
+
|
|
1596
|
+
const serialize$1 = (element, config, indentation, depth, refs, printer) =>
|
|
1597
|
+
++depth > config.maxDepth
|
|
1598
|
+
? (0, _markup$1.printElementAsLeaf)(getType(element), config)
|
|
1599
|
+
: (0, _markup$1.printElement)(
|
|
1600
|
+
getType(element),
|
|
1601
|
+
(0, _markup$1.printProps)(
|
|
1602
|
+
getPropKeys$1(element),
|
|
1603
|
+
element.props,
|
|
1604
|
+
config,
|
|
1605
|
+
indentation + config.indent,
|
|
1606
|
+
depth,
|
|
1607
|
+
refs,
|
|
1608
|
+
printer
|
|
1609
|
+
),
|
|
1610
|
+
(0, _markup$1.printChildren)(
|
|
1611
|
+
getChildren(element.props.children),
|
|
1612
|
+
config,
|
|
1613
|
+
indentation + config.indent,
|
|
1614
|
+
depth,
|
|
1615
|
+
refs,
|
|
1616
|
+
printer
|
|
1617
|
+
),
|
|
1618
|
+
config,
|
|
1619
|
+
indentation
|
|
1620
|
+
);
|
|
1621
|
+
|
|
1622
|
+
ReactElement$1.serialize = serialize$1;
|
|
1623
|
+
|
|
1624
|
+
const test$1 = val => val != null && ReactIs.isElement(val);
|
|
1625
|
+
|
|
1626
|
+
ReactElement$1.test = test$1;
|
|
1627
|
+
const plugin$1 = {
|
|
1628
|
+
serialize: serialize$1,
|
|
1629
|
+
test: test$1
|
|
1630
|
+
};
|
|
1631
|
+
var _default$2 = plugin$1;
|
|
1632
|
+
ReactElement$1.default = _default$2;
|
|
1633
|
+
|
|
1634
|
+
var ReactTestComponent$1 = {};
|
|
1635
|
+
|
|
1636
|
+
Object.defineProperty(ReactTestComponent$1, '__esModule', {
|
|
1637
|
+
value: true
|
|
1638
|
+
});
|
|
1639
|
+
ReactTestComponent$1.test = ReactTestComponent$1.serialize = ReactTestComponent$1.default = void 0;
|
|
1640
|
+
|
|
1641
|
+
var _markup = markup;
|
|
1642
|
+
|
|
1643
|
+
var global = (function () {
|
|
1644
|
+
if (typeof globalThis !== 'undefined') {
|
|
1645
|
+
return globalThis;
|
|
1646
|
+
} else if (typeof global !== 'undefined') {
|
|
1647
|
+
return global;
|
|
1648
|
+
} else if (typeof self !== 'undefined') {
|
|
1649
|
+
return self;
|
|
1650
|
+
} else if (typeof window !== 'undefined') {
|
|
1651
|
+
return window;
|
|
1652
|
+
} else {
|
|
1653
|
+
return Function('return this')();
|
|
1654
|
+
}
|
|
1655
|
+
})();
|
|
1656
|
+
|
|
1657
|
+
var Symbol$1 = global['jest-symbol-do-not-touch'] || global.Symbol;
|
|
1658
|
+
const testSymbol =
|
|
1659
|
+
typeof Symbol$1 === 'function' && Symbol$1.for
|
|
1660
|
+
? Symbol$1.for('react.test.json')
|
|
1661
|
+
: 0xea71357;
|
|
1662
|
+
|
|
1663
|
+
const getPropKeys = object => {
|
|
1664
|
+
const {props} = object;
|
|
1665
|
+
return props
|
|
1666
|
+
? Object.keys(props)
|
|
1667
|
+
.filter(key => props[key] !== undefined)
|
|
1668
|
+
.sort()
|
|
1669
|
+
: [];
|
|
1670
|
+
};
|
|
1671
|
+
|
|
1672
|
+
const serialize = (object, config, indentation, depth, refs, printer) =>
|
|
1673
|
+
++depth > config.maxDepth
|
|
1674
|
+
? (0, _markup.printElementAsLeaf)(object.type, config)
|
|
1675
|
+
: (0, _markup.printElement)(
|
|
1676
|
+
object.type,
|
|
1677
|
+
object.props
|
|
1678
|
+
? (0, _markup.printProps)(
|
|
1679
|
+
getPropKeys(object),
|
|
1680
|
+
object.props,
|
|
1681
|
+
config,
|
|
1682
|
+
indentation + config.indent,
|
|
1683
|
+
depth,
|
|
1684
|
+
refs,
|
|
1685
|
+
printer
|
|
1686
|
+
)
|
|
1687
|
+
: '',
|
|
1688
|
+
object.children
|
|
1689
|
+
? (0, _markup.printChildren)(
|
|
1690
|
+
object.children,
|
|
1691
|
+
config,
|
|
1692
|
+
indentation + config.indent,
|
|
1693
|
+
depth,
|
|
1694
|
+
refs,
|
|
1695
|
+
printer
|
|
1696
|
+
)
|
|
1697
|
+
: '',
|
|
1698
|
+
config,
|
|
1699
|
+
indentation
|
|
1700
|
+
);
|
|
1701
|
+
|
|
1702
|
+
ReactTestComponent$1.serialize = serialize;
|
|
1703
|
+
|
|
1704
|
+
const test = val => val && val.$$typeof === testSymbol;
|
|
1705
|
+
|
|
1706
|
+
ReactTestComponent$1.test = test;
|
|
1707
|
+
const plugin = {
|
|
1708
|
+
serialize,
|
|
1709
|
+
test
|
|
1710
|
+
};
|
|
1711
|
+
var _default$1 = plugin;
|
|
1712
|
+
ReactTestComponent$1.default = _default$1;
|
|
1713
|
+
|
|
1714
|
+
Object.defineProperty(build, '__esModule', {
|
|
1715
|
+
value: true
|
|
1716
|
+
});
|
|
1717
|
+
build.default = build.DEFAULT_OPTIONS = void 0;
|
|
1718
|
+
var format_1 = build.format = format;
|
|
1719
|
+
var plugins_1 = build.plugins = void 0;
|
|
1720
|
+
|
|
1721
|
+
var _ansiStyles = _interopRequireDefault(ansiStyles$1.exports);
|
|
1722
|
+
|
|
1723
|
+
var _collections = collections;
|
|
1724
|
+
|
|
1725
|
+
var _AsymmetricMatcher = _interopRequireDefault(
|
|
1726
|
+
AsymmetricMatcher$1
|
|
1727
|
+
);
|
|
1728
|
+
|
|
1729
|
+
var _ConvertAnsi = _interopRequireDefault(ConvertAnsi);
|
|
1730
|
+
|
|
1731
|
+
var _DOMCollection = _interopRequireDefault(DOMCollection$1);
|
|
1732
|
+
|
|
1733
|
+
var _DOMElement = _interopRequireDefault(DOMElement$1);
|
|
1734
|
+
|
|
1735
|
+
var _Immutable = _interopRequireDefault(Immutable$1);
|
|
1736
|
+
|
|
1737
|
+
var _ReactElement = _interopRequireDefault(ReactElement$1);
|
|
1738
|
+
|
|
1739
|
+
var _ReactTestComponent = _interopRequireDefault(
|
|
1740
|
+
ReactTestComponent$1
|
|
1741
|
+
);
|
|
1742
|
+
|
|
1743
|
+
function _interopRequireDefault(obj) {
|
|
1744
|
+
return obj && obj.__esModule ? obj : {default: obj};
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1749
|
+
*
|
|
1750
|
+
* This source code is licensed under the MIT license found in the
|
|
1751
|
+
* LICENSE file in the root directory of this source tree.
|
|
1752
|
+
*/
|
|
1753
|
+
|
|
1754
|
+
/* eslint-disable local/ban-types-eventually */
|
|
1755
|
+
const toString = Object.prototype.toString;
|
|
1756
|
+
const toISOString = Date.prototype.toISOString;
|
|
1757
|
+
const errorToString = Error.prototype.toString;
|
|
1758
|
+
const regExpToString = RegExp.prototype.toString;
|
|
1759
|
+
/**
|
|
1760
|
+
* Explicitly comparing typeof constructor to function avoids undefined as name
|
|
1761
|
+
* when mock identity-obj-proxy returns the key as the value for any key.
|
|
1762
|
+
*/
|
|
1763
|
+
|
|
1764
|
+
const getConstructorName = val =>
|
|
1765
|
+
(typeof val.constructor === 'function' && val.constructor.name) || 'Object';
|
|
1766
|
+
/* global window */
|
|
1767
|
+
|
|
1768
|
+
/** Is val is equal to global window object? Works even if it does not exist :) */
|
|
1769
|
+
|
|
1770
|
+
const isWindow = val => typeof window !== 'undefined' && val === window;
|
|
1771
|
+
|
|
1772
|
+
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
|
|
1773
|
+
const NEWLINE_REGEXP = /\n/gi;
|
|
1774
|
+
|
|
1775
|
+
class PrettyFormatPluginError extends Error {
|
|
1776
|
+
constructor(message, stack) {
|
|
1777
|
+
super(message);
|
|
1778
|
+
this.stack = stack;
|
|
1779
|
+
this.name = this.constructor.name;
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
function isToStringedArrayType(toStringed) {
|
|
1784
|
+
return (
|
|
1785
|
+
toStringed === '[object Array]' ||
|
|
1786
|
+
toStringed === '[object ArrayBuffer]' ||
|
|
1787
|
+
toStringed === '[object DataView]' ||
|
|
1788
|
+
toStringed === '[object Float32Array]' ||
|
|
1789
|
+
toStringed === '[object Float64Array]' ||
|
|
1790
|
+
toStringed === '[object Int8Array]' ||
|
|
1791
|
+
toStringed === '[object Int16Array]' ||
|
|
1792
|
+
toStringed === '[object Int32Array]' ||
|
|
1793
|
+
toStringed === '[object Uint8Array]' ||
|
|
1794
|
+
toStringed === '[object Uint8ClampedArray]' ||
|
|
1795
|
+
toStringed === '[object Uint16Array]' ||
|
|
1796
|
+
toStringed === '[object Uint32Array]'
|
|
1797
|
+
);
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
function printNumber(val) {
|
|
1801
|
+
return Object.is(val, -0) ? '-0' : String(val);
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
function printBigInt(val) {
|
|
1805
|
+
return String(`${val}n`);
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
function printFunction(val, printFunctionName) {
|
|
1809
|
+
if (!printFunctionName) {
|
|
1810
|
+
return '[Function]';
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
return '[Function ' + (val.name || 'anonymous') + ']';
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
function printSymbol(val) {
|
|
1817
|
+
return String(val).replace(SYMBOL_REGEXP, 'Symbol($1)');
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
function printError(val) {
|
|
1821
|
+
return '[' + errorToString.call(val) + ']';
|
|
1822
|
+
}
|
|
1823
|
+
/**
|
|
1824
|
+
* The first port of call for printing an object, handles most of the
|
|
1825
|
+
* data-types in JS.
|
|
1826
|
+
*/
|
|
1827
|
+
|
|
1828
|
+
function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
|
|
1829
|
+
if (val === true || val === false) {
|
|
1830
|
+
return '' + val;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
if (val === undefined) {
|
|
1834
|
+
return 'undefined';
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
if (val === null) {
|
|
1838
|
+
return 'null';
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
const typeOf = typeof val;
|
|
1842
|
+
|
|
1843
|
+
if (typeOf === 'number') {
|
|
1844
|
+
return printNumber(val);
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
if (typeOf === 'bigint') {
|
|
1848
|
+
return printBigInt(val);
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
if (typeOf === 'string') {
|
|
1852
|
+
if (escapeString) {
|
|
1853
|
+
return '"' + val.replace(/"|\\/g, '\\$&') + '"';
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
return '"' + val + '"';
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
if (typeOf === 'function') {
|
|
1860
|
+
return printFunction(val, printFunctionName);
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
if (typeOf === 'symbol') {
|
|
1864
|
+
return printSymbol(val);
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
const toStringed = toString.call(val);
|
|
1868
|
+
|
|
1869
|
+
if (toStringed === '[object WeakMap]') {
|
|
1870
|
+
return 'WeakMap {}';
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
if (toStringed === '[object WeakSet]') {
|
|
1874
|
+
return 'WeakSet {}';
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
if (
|
|
1878
|
+
toStringed === '[object Function]' ||
|
|
1879
|
+
toStringed === '[object GeneratorFunction]'
|
|
1880
|
+
) {
|
|
1881
|
+
return printFunction(val, printFunctionName);
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
if (toStringed === '[object Symbol]') {
|
|
1885
|
+
return printSymbol(val);
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
if (toStringed === '[object Date]') {
|
|
1889
|
+
return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
if (toStringed === '[object Error]') {
|
|
1893
|
+
return printError(val);
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
if (toStringed === '[object RegExp]') {
|
|
1897
|
+
if (escapeRegex) {
|
|
1898
|
+
// https://github.com/benjamingr/RegExp.escape/blob/main/polyfill.js
|
|
1899
|
+
return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
return regExpToString.call(val);
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
if (val instanceof Error) {
|
|
1906
|
+
return printError(val);
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
return null;
|
|
1910
|
+
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Handles more complex objects ( such as objects with circular references.
|
|
1913
|
+
* maps and sets etc )
|
|
1914
|
+
*/
|
|
1915
|
+
|
|
1916
|
+
function printComplexValue(
|
|
1917
|
+
val,
|
|
1918
|
+
config,
|
|
1919
|
+
indentation,
|
|
1920
|
+
depth,
|
|
1921
|
+
refs,
|
|
1922
|
+
hasCalledToJSON
|
|
1923
|
+
) {
|
|
1924
|
+
if (refs.indexOf(val) !== -1) {
|
|
1925
|
+
return '[Circular]';
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
refs = refs.slice();
|
|
1929
|
+
refs.push(val);
|
|
1930
|
+
const hitMaxDepth = ++depth > config.maxDepth;
|
|
1931
|
+
const min = config.min;
|
|
1932
|
+
|
|
1933
|
+
if (
|
|
1934
|
+
config.callToJSON &&
|
|
1935
|
+
!hitMaxDepth &&
|
|
1936
|
+
val.toJSON &&
|
|
1937
|
+
typeof val.toJSON === 'function' &&
|
|
1938
|
+
!hasCalledToJSON
|
|
1939
|
+
) {
|
|
1940
|
+
return printer(val.toJSON(), config, indentation, depth, refs, true);
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
const toStringed = toString.call(val);
|
|
1944
|
+
|
|
1945
|
+
if (toStringed === '[object Arguments]') {
|
|
1946
|
+
return hitMaxDepth
|
|
1947
|
+
? '[Arguments]'
|
|
1948
|
+
: (min ? '' : 'Arguments ') +
|
|
1949
|
+
'[' +
|
|
1950
|
+
(0, _collections.printListItems)(
|
|
1951
|
+
val,
|
|
1952
|
+
config,
|
|
1953
|
+
indentation,
|
|
1954
|
+
depth,
|
|
1955
|
+
refs,
|
|
1956
|
+
printer
|
|
1957
|
+
) +
|
|
1958
|
+
']';
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
if (isToStringedArrayType(toStringed)) {
|
|
1962
|
+
return hitMaxDepth
|
|
1963
|
+
? '[' + val.constructor.name + ']'
|
|
1964
|
+
: (min
|
|
1965
|
+
? ''
|
|
1966
|
+
: !config.printBasicPrototype && val.constructor.name === 'Array'
|
|
1967
|
+
? ''
|
|
1968
|
+
: val.constructor.name + ' ') +
|
|
1969
|
+
'[' +
|
|
1970
|
+
(0, _collections.printListItems)(
|
|
1971
|
+
val,
|
|
1972
|
+
config,
|
|
1973
|
+
indentation,
|
|
1974
|
+
depth,
|
|
1975
|
+
refs,
|
|
1976
|
+
printer
|
|
1977
|
+
) +
|
|
1978
|
+
']';
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
if (toStringed === '[object Map]') {
|
|
1982
|
+
return hitMaxDepth
|
|
1983
|
+
? '[Map]'
|
|
1984
|
+
: 'Map {' +
|
|
1985
|
+
(0, _collections.printIteratorEntries)(
|
|
1986
|
+
val.entries(),
|
|
1987
|
+
config,
|
|
1988
|
+
indentation,
|
|
1989
|
+
depth,
|
|
1990
|
+
refs,
|
|
1991
|
+
printer,
|
|
1992
|
+
' => '
|
|
1993
|
+
) +
|
|
1994
|
+
'}';
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
if (toStringed === '[object Set]') {
|
|
1998
|
+
return hitMaxDepth
|
|
1999
|
+
? '[Set]'
|
|
2000
|
+
: 'Set {' +
|
|
2001
|
+
(0, _collections.printIteratorValues)(
|
|
2002
|
+
val.values(),
|
|
2003
|
+
config,
|
|
2004
|
+
indentation,
|
|
2005
|
+
depth,
|
|
2006
|
+
refs,
|
|
2007
|
+
printer
|
|
2008
|
+
) +
|
|
2009
|
+
'}';
|
|
2010
|
+
} // Avoid failure to serialize global window object in jsdom test environment.
|
|
2011
|
+
// For example, not even relevant if window is prop of React element.
|
|
2012
|
+
|
|
2013
|
+
return hitMaxDepth || isWindow(val)
|
|
2014
|
+
? '[' + getConstructorName(val) + ']'
|
|
2015
|
+
: (min
|
|
2016
|
+
? ''
|
|
2017
|
+
: !config.printBasicPrototype && getConstructorName(val) === 'Object'
|
|
2018
|
+
? ''
|
|
2019
|
+
: getConstructorName(val) + ' ') +
|
|
2020
|
+
'{' +
|
|
2021
|
+
(0, _collections.printObjectProperties)(
|
|
2022
|
+
val,
|
|
2023
|
+
config,
|
|
2024
|
+
indentation,
|
|
2025
|
+
depth,
|
|
2026
|
+
refs,
|
|
2027
|
+
printer
|
|
2028
|
+
) +
|
|
2029
|
+
'}';
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
function isNewPlugin(plugin) {
|
|
2033
|
+
return plugin.serialize != null;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
function printPlugin(plugin, val, config, indentation, depth, refs) {
|
|
2037
|
+
let printed;
|
|
2038
|
+
|
|
2039
|
+
try {
|
|
2040
|
+
printed = isNewPlugin(plugin)
|
|
2041
|
+
? plugin.serialize(val, config, indentation, depth, refs, printer)
|
|
2042
|
+
: plugin.print(
|
|
2043
|
+
val,
|
|
2044
|
+
valChild => printer(valChild, config, indentation, depth, refs),
|
|
2045
|
+
str => {
|
|
2046
|
+
const indentationNext = indentation + config.indent;
|
|
2047
|
+
return (
|
|
2048
|
+
indentationNext +
|
|
2049
|
+
str.replace(NEWLINE_REGEXP, '\n' + indentationNext)
|
|
2050
|
+
);
|
|
2051
|
+
},
|
|
2052
|
+
{
|
|
2053
|
+
edgeSpacing: config.spacingOuter,
|
|
2054
|
+
min: config.min,
|
|
2055
|
+
spacing: config.spacingInner
|
|
2056
|
+
},
|
|
2057
|
+
config.colors
|
|
2058
|
+
);
|
|
2059
|
+
} catch (error) {
|
|
2060
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
if (typeof printed !== 'string') {
|
|
2064
|
+
throw new Error(
|
|
2065
|
+
`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`
|
|
2066
|
+
);
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
return printed;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
function findPlugin(plugins, val) {
|
|
2073
|
+
for (let p = 0; p < plugins.length; p++) {
|
|
2074
|
+
try {
|
|
2075
|
+
if (plugins[p].test(val)) {
|
|
2076
|
+
return plugins[p];
|
|
2077
|
+
}
|
|
2078
|
+
} catch (error) {
|
|
2079
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
return null;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
2087
|
+
const plugin = findPlugin(config.plugins, val);
|
|
2088
|
+
|
|
2089
|
+
if (plugin !== null) {
|
|
2090
|
+
return printPlugin(plugin, val, config, indentation, depth, refs);
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
const basicResult = printBasicValue(
|
|
2094
|
+
val,
|
|
2095
|
+
config.printFunctionName,
|
|
2096
|
+
config.escapeRegex,
|
|
2097
|
+
config.escapeString
|
|
2098
|
+
);
|
|
2099
|
+
|
|
2100
|
+
if (basicResult !== null) {
|
|
2101
|
+
return basicResult;
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
return printComplexValue(
|
|
2105
|
+
val,
|
|
2106
|
+
config,
|
|
2107
|
+
indentation,
|
|
2108
|
+
depth,
|
|
2109
|
+
refs,
|
|
2110
|
+
hasCalledToJSON
|
|
2111
|
+
);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
const DEFAULT_THEME = {
|
|
2115
|
+
comment: 'gray',
|
|
2116
|
+
content: 'reset',
|
|
2117
|
+
prop: 'yellow',
|
|
2118
|
+
tag: 'cyan',
|
|
2119
|
+
value: 'green'
|
|
2120
|
+
};
|
|
2121
|
+
const DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
|
|
2122
|
+
const DEFAULT_OPTIONS = {
|
|
2123
|
+
callToJSON: true,
|
|
2124
|
+
compareKeys: undefined,
|
|
2125
|
+
escapeRegex: false,
|
|
2126
|
+
escapeString: true,
|
|
2127
|
+
highlight: false,
|
|
2128
|
+
indent: 2,
|
|
2129
|
+
maxDepth: Infinity,
|
|
2130
|
+
min: false,
|
|
2131
|
+
plugins: [],
|
|
2132
|
+
printBasicPrototype: true,
|
|
2133
|
+
printFunctionName: true,
|
|
2134
|
+
theme: DEFAULT_THEME
|
|
2135
|
+
};
|
|
2136
|
+
build.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
|
|
2137
|
+
|
|
2138
|
+
function validateOptions(options) {
|
|
2139
|
+
Object.keys(options).forEach(key => {
|
|
2140
|
+
if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
|
|
2141
|
+
throw new Error(`pretty-format: Unknown option "${key}".`);
|
|
2142
|
+
}
|
|
2143
|
+
});
|
|
2144
|
+
|
|
2145
|
+
if (options.min && options.indent !== undefined && options.indent !== 0) {
|
|
2146
|
+
throw new Error(
|
|
2147
|
+
'pretty-format: Options "min" and "indent" cannot be used together.'
|
|
2148
|
+
);
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
if (options.theme !== undefined) {
|
|
2152
|
+
if (options.theme === null) {
|
|
2153
|
+
throw new Error('pretty-format: Option "theme" must not be null.');
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
if (typeof options.theme !== 'object') {
|
|
2157
|
+
throw new Error(
|
|
2158
|
+
`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`
|
|
2159
|
+
);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
const getColorsHighlight = options =>
|
|
2165
|
+
DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
2166
|
+
const value =
|
|
2167
|
+
options.theme && options.theme[key] !== undefined
|
|
2168
|
+
? options.theme[key]
|
|
2169
|
+
: DEFAULT_THEME[key];
|
|
2170
|
+
const color = value && _ansiStyles.default[value];
|
|
2171
|
+
|
|
2172
|
+
if (
|
|
2173
|
+
color &&
|
|
2174
|
+
typeof color.close === 'string' &&
|
|
2175
|
+
typeof color.open === 'string'
|
|
2176
|
+
) {
|
|
2177
|
+
colors[key] = color;
|
|
2178
|
+
} else {
|
|
2179
|
+
throw new Error(
|
|
2180
|
+
`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`
|
|
2181
|
+
);
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
return colors;
|
|
2185
|
+
}, Object.create(null));
|
|
2186
|
+
|
|
2187
|
+
const getColorsEmpty = () =>
|
|
2188
|
+
DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
2189
|
+
colors[key] = {
|
|
2190
|
+
close: '',
|
|
2191
|
+
open: ''
|
|
2192
|
+
};
|
|
2193
|
+
return colors;
|
|
2194
|
+
}, Object.create(null));
|
|
2195
|
+
|
|
2196
|
+
const getPrintFunctionName = options =>
|
|
2197
|
+
options && options.printFunctionName !== undefined
|
|
2198
|
+
? options.printFunctionName
|
|
2199
|
+
: DEFAULT_OPTIONS.printFunctionName;
|
|
2200
|
+
|
|
2201
|
+
const getEscapeRegex = options =>
|
|
2202
|
+
options && options.escapeRegex !== undefined
|
|
2203
|
+
? options.escapeRegex
|
|
2204
|
+
: DEFAULT_OPTIONS.escapeRegex;
|
|
2205
|
+
|
|
2206
|
+
const getEscapeString = options =>
|
|
2207
|
+
options && options.escapeString !== undefined
|
|
2208
|
+
? options.escapeString
|
|
2209
|
+
: DEFAULT_OPTIONS.escapeString;
|
|
2210
|
+
|
|
2211
|
+
const getConfig = options => {
|
|
2212
|
+
var _options$printBasicPr;
|
|
2213
|
+
|
|
2214
|
+
return {
|
|
2215
|
+
callToJSON:
|
|
2216
|
+
options && options.callToJSON !== undefined
|
|
2217
|
+
? options.callToJSON
|
|
2218
|
+
: DEFAULT_OPTIONS.callToJSON,
|
|
2219
|
+
colors:
|
|
2220
|
+
options && options.highlight
|
|
2221
|
+
? getColorsHighlight(options)
|
|
2222
|
+
: getColorsEmpty(),
|
|
2223
|
+
compareKeys:
|
|
2224
|
+
options && typeof options.compareKeys === 'function'
|
|
2225
|
+
? options.compareKeys
|
|
2226
|
+
: DEFAULT_OPTIONS.compareKeys,
|
|
2227
|
+
escapeRegex: getEscapeRegex(options),
|
|
2228
|
+
escapeString: getEscapeString(options),
|
|
2229
|
+
indent:
|
|
2230
|
+
options && options.min
|
|
2231
|
+
? ''
|
|
2232
|
+
: createIndent(
|
|
2233
|
+
options && options.indent !== undefined
|
|
2234
|
+
? options.indent
|
|
2235
|
+
: DEFAULT_OPTIONS.indent
|
|
2236
|
+
),
|
|
2237
|
+
maxDepth:
|
|
2238
|
+
options && options.maxDepth !== undefined
|
|
2239
|
+
? options.maxDepth
|
|
2240
|
+
: DEFAULT_OPTIONS.maxDepth,
|
|
2241
|
+
min:
|
|
2242
|
+
options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,
|
|
2243
|
+
plugins:
|
|
2244
|
+
options && options.plugins !== undefined
|
|
2245
|
+
? options.plugins
|
|
2246
|
+
: DEFAULT_OPTIONS.plugins,
|
|
2247
|
+
printBasicPrototype:
|
|
2248
|
+
(_options$printBasicPr =
|
|
2249
|
+
options === null || options === void 0
|
|
2250
|
+
? void 0
|
|
2251
|
+
: options.printBasicPrototype) !== null &&
|
|
2252
|
+
_options$printBasicPr !== void 0
|
|
2253
|
+
? _options$printBasicPr
|
|
2254
|
+
: true,
|
|
2255
|
+
printFunctionName: getPrintFunctionName(options),
|
|
2256
|
+
spacingInner: options && options.min ? ' ' : '\n',
|
|
2257
|
+
spacingOuter: options && options.min ? '' : '\n'
|
|
2258
|
+
};
|
|
2259
|
+
};
|
|
2260
|
+
|
|
2261
|
+
function createIndent(indent) {
|
|
2262
|
+
return new Array(indent + 1).join(' ');
|
|
2263
|
+
}
|
|
2264
|
+
/**
|
|
2265
|
+
* Returns a presentation string of your `val` object
|
|
2266
|
+
* @param val any potential JavaScript object
|
|
2267
|
+
* @param options Custom settings
|
|
2268
|
+
*/
|
|
2269
|
+
|
|
2270
|
+
function format(val, options) {
|
|
2271
|
+
if (options) {
|
|
2272
|
+
validateOptions(options);
|
|
2273
|
+
|
|
2274
|
+
if (options.plugins) {
|
|
2275
|
+
const plugin = findPlugin(options.plugins, val);
|
|
2276
|
+
|
|
2277
|
+
if (plugin !== null) {
|
|
2278
|
+
return printPlugin(plugin, val, getConfig(options), '', 0, []);
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
const basicResult = printBasicValue(
|
|
2284
|
+
val,
|
|
2285
|
+
getPrintFunctionName(options),
|
|
2286
|
+
getEscapeRegex(options),
|
|
2287
|
+
getEscapeString(options)
|
|
2288
|
+
);
|
|
2289
|
+
|
|
2290
|
+
if (basicResult !== null) {
|
|
2291
|
+
return basicResult;
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
return printComplexValue(val, getConfig(options), '', 0, []);
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
const plugins = {
|
|
2298
|
+
AsymmetricMatcher: _AsymmetricMatcher.default,
|
|
2299
|
+
ConvertAnsi: _ConvertAnsi.default,
|
|
2300
|
+
DOMCollection: _DOMCollection.default,
|
|
2301
|
+
DOMElement: _DOMElement.default,
|
|
2302
|
+
Immutable: _Immutable.default,
|
|
2303
|
+
ReactElement: _ReactElement.default,
|
|
2304
|
+
ReactTestComponent: _ReactTestComponent.default
|
|
2305
|
+
};
|
|
2306
|
+
plugins_1 = build.plugins = plugins;
|
|
2307
|
+
var _default = format;
|
|
2308
|
+
build.default = _default;
|
|
2309
|
+
|
|
8
2310
|
var sourceMapGenerator = {};
|
|
9
2311
|
|
|
10
2312
|
var base64Vlq = {};
|
|
@@ -4613,7 +6915,7 @@ function unifiedDiff(actual, expected, options = {}) {
|
|
|
4613
6915
|
previousCount++;
|
|
4614
6916
|
counts[char]++;
|
|
4615
6917
|
if (previousCount === diffLimit)
|
|
4616
|
-
return c.dim(`${char} ...`);
|
|
6918
|
+
return c$1.dim(`${char} ...`);
|
|
4617
6919
|
else if (previousCount > diffLimit)
|
|
4618
6920
|
return;
|
|
4619
6921
|
}
|
|
@@ -4626,14 +6928,14 @@ function unifiedDiff(actual, expected, options = {}) {
|
|
|
4626
6928
|
if (line[0] === "-") {
|
|
4627
6929
|
line = formatLine(line.slice(1), outputTruncateLength);
|
|
4628
6930
|
if (isCompact)
|
|
4629
|
-
return c.green(line);
|
|
4630
|
-
return c.green(`- ${formatLine(line, outputTruncateLength)}`);
|
|
6931
|
+
return c$1.green(line);
|
|
6932
|
+
return c$1.green(`- ${formatLine(line, outputTruncateLength)}`);
|
|
4631
6933
|
}
|
|
4632
6934
|
if (line[0] === "+") {
|
|
4633
6935
|
line = formatLine(line.slice(1), outputTruncateLength);
|
|
4634
6936
|
if (isCompact)
|
|
4635
|
-
return c.red(line);
|
|
4636
|
-
return c.red(`+ ${formatLine(line, outputTruncateLength)}`);
|
|
6937
|
+
return c$1.red(line);
|
|
6938
|
+
return c$1.red(`+ ${formatLine(line, outputTruncateLength)}`);
|
|
4637
6939
|
}
|
|
4638
6940
|
if (line.match(/@@/))
|
|
4639
6941
|
return "--";
|
|
@@ -4642,14 +6944,135 @@ function unifiedDiff(actual, expected, options = {}) {
|
|
|
4642
6944
|
if (showLegend) {
|
|
4643
6945
|
if (isCompact) {
|
|
4644
6946
|
formatted = [
|
|
4645
|
-
`${c.green("- Expected")} ${formatted[0]}`,
|
|
4646
|
-
`${c.red("+ Received")} ${formatted[1]}`
|
|
6947
|
+
`${c$1.green("- Expected")} ${formatted[0]}`,
|
|
6948
|
+
`${c$1.red("+ Received")} ${formatted[1]}`
|
|
4647
6949
|
];
|
|
4648
6950
|
} else {
|
|
4649
|
-
formatted.unshift(c.green(`- Expected - ${counts["-"]}`), c.red(`+ Received + ${counts["+"]}`), "");
|
|
6951
|
+
formatted.unshift(c$1.green(`- Expected - ${counts["-"]}`), c$1.red(`+ Received + ${counts["+"]}`), "");
|
|
4650
6952
|
}
|
|
4651
6953
|
}
|
|
4652
6954
|
return formatted.map((i) => indent + i).join("\n");
|
|
4653
6955
|
}
|
|
4654
6956
|
|
|
4655
|
-
|
|
6957
|
+
var __defProp = Object.defineProperty;
|
|
6958
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6959
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6960
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6961
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6962
|
+
var __spreadValues = (a, b) => {
|
|
6963
|
+
for (var prop in b || (b = {}))
|
|
6964
|
+
if (__hasOwnProp.call(b, prop))
|
|
6965
|
+
__defNormalProp(a, prop, b[prop]);
|
|
6966
|
+
if (__getOwnPropSymbols)
|
|
6967
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
6968
|
+
if (__propIsEnum.call(b, prop))
|
|
6969
|
+
__defNormalProp(a, prop, b[prop]);
|
|
6970
|
+
}
|
|
6971
|
+
return a;
|
|
6972
|
+
};
|
|
6973
|
+
const EXPECTED_COLOR = c$1.green;
|
|
6974
|
+
const RECEIVED_COLOR = c$1.red;
|
|
6975
|
+
const INVERTED_COLOR = c$1.inverse;
|
|
6976
|
+
const BOLD_WEIGHT = c$1.bold;
|
|
6977
|
+
const DIM_COLOR = c$1.dim;
|
|
6978
|
+
const {
|
|
6979
|
+
AsymmetricMatcher,
|
|
6980
|
+
DOMCollection,
|
|
6981
|
+
DOMElement,
|
|
6982
|
+
Immutable,
|
|
6983
|
+
ReactElement,
|
|
6984
|
+
ReactTestComponent
|
|
6985
|
+
} = plugins_1;
|
|
6986
|
+
const PLUGINS = [
|
|
6987
|
+
ReactTestComponent,
|
|
6988
|
+
ReactElement,
|
|
6989
|
+
DOMElement,
|
|
6990
|
+
DOMCollection,
|
|
6991
|
+
Immutable,
|
|
6992
|
+
AsymmetricMatcher
|
|
6993
|
+
];
|
|
6994
|
+
function matcherHint(matcherName, received = "received", expected = "expected", options = {}) {
|
|
6995
|
+
const {
|
|
6996
|
+
comment = "",
|
|
6997
|
+
expectedColor = EXPECTED_COLOR,
|
|
6998
|
+
isDirectExpectCall = false,
|
|
6999
|
+
isNot = false,
|
|
7000
|
+
promise = "",
|
|
7001
|
+
receivedColor = RECEIVED_COLOR,
|
|
7002
|
+
secondArgument = "",
|
|
7003
|
+
secondArgumentColor = EXPECTED_COLOR
|
|
7004
|
+
} = options;
|
|
7005
|
+
let hint = "";
|
|
7006
|
+
let dimString = "expect";
|
|
7007
|
+
if (!isDirectExpectCall && received !== "") {
|
|
7008
|
+
hint += DIM_COLOR(`${dimString}(`) + receivedColor(received);
|
|
7009
|
+
dimString = ")";
|
|
7010
|
+
}
|
|
7011
|
+
if (promise !== "") {
|
|
7012
|
+
hint += DIM_COLOR(`${dimString}.`) + promise;
|
|
7013
|
+
dimString = "";
|
|
7014
|
+
}
|
|
7015
|
+
if (isNot) {
|
|
7016
|
+
hint += `${DIM_COLOR(`${dimString}.`)}not`;
|
|
7017
|
+
dimString = "";
|
|
7018
|
+
}
|
|
7019
|
+
if (matcherName.includes(".")) {
|
|
7020
|
+
dimString += matcherName;
|
|
7021
|
+
} else {
|
|
7022
|
+
hint += DIM_COLOR(`${dimString}.`) + matcherName;
|
|
7023
|
+
dimString = "";
|
|
7024
|
+
}
|
|
7025
|
+
if (expected === "") {
|
|
7026
|
+
dimString += "()";
|
|
7027
|
+
} else {
|
|
7028
|
+
hint += DIM_COLOR(`${dimString}(`) + expectedColor(expected);
|
|
7029
|
+
if (secondArgument)
|
|
7030
|
+
hint += DIM_COLOR(", ") + secondArgumentColor(secondArgument);
|
|
7031
|
+
dimString = ")";
|
|
7032
|
+
}
|
|
7033
|
+
if (comment !== "")
|
|
7034
|
+
dimString += ` // ${comment}`;
|
|
7035
|
+
if (dimString !== "")
|
|
7036
|
+
hint += DIM_COLOR(dimString);
|
|
7037
|
+
return hint;
|
|
7038
|
+
}
|
|
7039
|
+
const SPACE_SYMBOL = "\xB7";
|
|
7040
|
+
const replaceTrailingSpaces = (text) => text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
|
|
7041
|
+
function stringify(object, maxDepth = 10, options) {
|
|
7042
|
+
const MAX_LENGTH = 1e4;
|
|
7043
|
+
let result;
|
|
7044
|
+
try {
|
|
7045
|
+
result = format_1(object, __spreadValues({
|
|
7046
|
+
maxDepth,
|
|
7047
|
+
plugins: PLUGINS
|
|
7048
|
+
}, options));
|
|
7049
|
+
} catch {
|
|
7050
|
+
result = format_1(object, __spreadValues({
|
|
7051
|
+
callToJSON: false,
|
|
7052
|
+
maxDepth,
|
|
7053
|
+
plugins: PLUGINS
|
|
7054
|
+
}, options));
|
|
7055
|
+
}
|
|
7056
|
+
return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(maxDepth / 2)) : result;
|
|
7057
|
+
}
|
|
7058
|
+
const printReceived = (object) => RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));
|
|
7059
|
+
const printExpected = (value) => EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));
|
|
7060
|
+
function diff(a, b, options) {
|
|
7061
|
+
return unifiedDiff(stringify(a), stringify(b));
|
|
7062
|
+
}
|
|
7063
|
+
|
|
7064
|
+
var matcherUtils = /*#__PURE__*/Object.freeze({
|
|
7065
|
+
__proto__: null,
|
|
7066
|
+
EXPECTED_COLOR: EXPECTED_COLOR,
|
|
7067
|
+
RECEIVED_COLOR: RECEIVED_COLOR,
|
|
7068
|
+
INVERTED_COLOR: INVERTED_COLOR,
|
|
7069
|
+
BOLD_WEIGHT: BOLD_WEIGHT,
|
|
7070
|
+
DIM_COLOR: DIM_COLOR,
|
|
7071
|
+
matcherHint: matcherHint,
|
|
7072
|
+
stringify: stringify,
|
|
7073
|
+
printReceived: printReceived,
|
|
7074
|
+
printExpected: printExpected,
|
|
7075
|
+
diff: diff
|
|
7076
|
+
});
|
|
7077
|
+
|
|
7078
|
+
export { posToNumber as a, parseStacktrace as b, clearTimeout as c, stringify as d, stripAnsi as e, format_1 as f, getOriginalPos as g, stringWidth as h, ansiStyles as i, sliceAnsi as j, setInterval as k, lineSplitRE as l, matcherUtils as m, numberToPos as n, clearInterval as o, plugins_1 as p, cliTruncate as q, interpretSourcePos as r, setTimeout$1 as s, unifiedDiff as u };
|