@storybook/addon-vitest 10.1.0-alpha.9 → 10.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,144 +1,106 @@
1
- import CJS_COMPAT_NODE_URL_6xsmo987rp5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_6xsmo987rp5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_6xsmo987rp5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_2cm23o1mqpi from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_2cm23o1mqpi from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_2cm23o1mqpi from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_6xsmo987rp5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_6xsmo987rp5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_6xsmo987rp5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_2cm23o1mqpi.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_2cm23o1mqpi.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_2cm23o1mqpi.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  require_gte
14
- } from "../_node-chunks/chunk-EWGF3LDY.js";
14
+ } from "../_node-chunks/chunk-AP5IIXAM.js";
15
15
  import {
16
16
  __commonJS,
17
- __name,
18
17
  __require,
19
18
  __toESM
20
- } from "../_node-chunks/chunk-W5CYX7PP.js";
19
+ } from "../_node-chunks/chunk-BGBUUVQU.js";
21
20
 
22
21
  // ../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
23
22
  var require_make_dir = __commonJS({
24
23
  "../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js"(exports, module) {
25
24
  "use strict";
26
- var fs = __require("fs");
27
- var path = __require("path");
28
- var { promisify } = __require("util");
29
- var semverGte = require_gte();
30
- var useNativeRecursiveOption = semverGte(process.version, "10.12.0");
31
- var checkPath = /* @__PURE__ */ __name((pth) => {
32
- if (process.platform === "win32") {
33
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
34
- if (pathHasInvalidWinCharacters) {
35
- const error = new Error(`Path contains invalid characters: ${pth}`);
36
- error.code = "EINVAL";
37
- throw error;
38
- }
25
+ var fs = __require("fs"), path = __require("path"), { promisify } = __require("util"), semverGte = require_gte(), useNativeRecursiveOption = semverGte(process.version, "10.12.0"), checkPath = (pth) => {
26
+ if (process.platform === "win32" && /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""))) {
27
+ let error = new Error(`Path contains invalid characters: ${pth}`);
28
+ throw error.code = "EINVAL", error;
39
29
  }
40
- }, "checkPath");
41
- var processOptions = /* @__PURE__ */ __name((options) => {
42
- const defaults = {
30
+ }, processOptions = (options) => ({
31
+ ...{
43
32
  mode: 511,
44
33
  fs
45
- };
46
- return {
47
- ...defaults,
48
- ...options
49
- };
50
- }, "processOptions");
51
- var permissionError = /* @__PURE__ */ __name((pth) => {
52
- const error = new Error(`operation not permitted, mkdir '${pth}'`);
53
- error.code = "EPERM";
54
- error.errno = -4048;
55
- error.path = pth;
56
- error.syscall = "mkdir";
57
- return error;
58
- }, "permissionError");
59
- var makeDir = /* @__PURE__ */ __name(async (input, options) => {
60
- checkPath(input);
61
- options = processOptions(options);
62
- const mkdir = promisify(options.fs.mkdir);
63
- const stat = promisify(options.fs.stat);
34
+ },
35
+ ...options
36
+ }), permissionError = (pth) => {
37
+ let error = new Error(`operation not permitted, mkdir '${pth}'`);
38
+ return error.code = "EPERM", error.errno = -4048, error.path = pth, error.syscall = "mkdir", error;
39
+ }, makeDir = async (input, options) => {
40
+ checkPath(input), options = processOptions(options);
41
+ let mkdir = promisify(options.fs.mkdir), stat = promisify(options.fs.stat);
64
42
  if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
65
- const pth = path.resolve(input);
66
- await mkdir(pth, {
43
+ let pth = path.resolve(input);
44
+ return await mkdir(pth, {
67
45
  mode: options.mode,
68
- recursive: true
69
- });
70
- return pth;
46
+ recursive: !0
47
+ }), pth;
71
48
  }
72
- const make = /* @__PURE__ */ __name(async (pth) => {
49
+ let make = async (pth) => {
73
50
  try {
74
- await mkdir(pth, options.mode);
75
- return pth;
51
+ return await mkdir(pth, options.mode), pth;
76
52
  } catch (error) {
77
- if (error.code === "EPERM") {
53
+ if (error.code === "EPERM")
78
54
  throw error;
79
- }
80
55
  if (error.code === "ENOENT") {
81
- if (path.dirname(pth) === pth) {
56
+ if (path.dirname(pth) === pth)
82
57
  throw permissionError(pth);
83
- }
84
- if (error.message.includes("null bytes")) {
58
+ if (error.message.includes("null bytes"))
85
59
  throw error;
86
- }
87
- await make(path.dirname(pth));
88
- return make(pth);
60
+ return await make(path.dirname(pth)), make(pth);
89
61
  }
90
62
  try {
91
- const stats = await stat(pth);
92
- if (!stats.isDirectory()) {
63
+ if (!(await stat(pth)).isDirectory())
93
64
  throw new Error("The path is not a directory");
94
- }
95
65
  } catch {
96
66
  throw error;
97
67
  }
98
68
  return pth;
99
69
  }
100
- }, "make");
70
+ };
101
71
  return make(path.resolve(input));
102
- }, "makeDir");
72
+ };
103
73
  module.exports = makeDir;
104
74
  module.exports.sync = (input, options) => {
105
- checkPath(input);
106
- options = processOptions(options);
107
- if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
108
- const pth = path.resolve(input);
109
- fs.mkdirSync(pth, {
75
+ if (checkPath(input), options = processOptions(options), useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
76
+ let pth = path.resolve(input);
77
+ return fs.mkdirSync(pth, {
110
78
  mode: options.mode,
111
- recursive: true
112
- });
113
- return pth;
79
+ recursive: !0
80
+ }), pth;
114
81
  }
115
- const make = /* @__PURE__ */ __name((pth) => {
82
+ let make = (pth) => {
116
83
  try {
117
84
  options.fs.mkdirSync(pth, options.mode);
118
85
  } catch (error) {
119
- if (error.code === "EPERM") {
86
+ if (error.code === "EPERM")
120
87
  throw error;
121
- }
122
88
  if (error.code === "ENOENT") {
123
- if (path.dirname(pth) === pth) {
89
+ if (path.dirname(pth) === pth)
124
90
  throw permissionError(pth);
125
- }
126
- if (error.message.includes("null bytes")) {
91
+ if (error.message.includes("null bytes"))
127
92
  throw error;
128
- }
129
- make(path.dirname(pth));
130
- return make(pth);
93
+ return make(path.dirname(pth)), make(pth);
131
94
  }
132
95
  try {
133
- if (!options.fs.statSync(pth).isDirectory()) {
96
+ if (!options.fs.statSync(pth).isDirectory())
134
97
  throw new Error("The path is not a directory");
135
- }
136
98
  } catch {
137
99
  throw error;
138
100
  }
139
101
  }
140
102
  return pth;
141
- }, "make");
103
+ };
142
104
  return make(path.resolve(input));
143
105
  };
144
106
  }
@@ -149,9 +111,7 @@ var require_has_flag = __commonJS({
149
111
  "../../node_modules/has-flag/index.js"(exports, module) {
150
112
  "use strict";
151
113
  module.exports = (flag, argv = process.argv) => {
152
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
153
- const position = argv.indexOf(prefix + flag);
154
- const terminatorPosition = argv.indexOf("--");
114
+ let prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--", position = argv.indexOf(prefix + flag), terminatorPosition = argv.indexOf("--");
155
115
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
156
116
  };
157
117
  }
@@ -161,75 +121,41 @@ var require_has_flag = __commonJS({
161
121
  var require_supports_color = __commonJS({
162
122
  "../../node_modules/supports-color/index.js"(exports, module) {
163
123
  "use strict";
164
- var os = __require("os");
165
- var tty = __require("tty");
166
- var hasFlag = require_has_flag();
167
- var { env } = process;
168
- var forceColor;
169
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
170
- forceColor = 0;
171
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
172
- forceColor = 1;
173
- }
174
- if ("FORCE_COLOR" in env) {
175
- if (env.FORCE_COLOR === "true") {
176
- forceColor = 1;
177
- } else if (env.FORCE_COLOR === "false") {
178
- forceColor = 0;
179
- } else {
180
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
181
- }
182
- }
124
+ var os = __require("os"), tty = __require("tty"), hasFlag = require_has_flag(), { env } = process, forceColor;
125
+ hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never") ? forceColor = 0 : (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) && (forceColor = 1);
126
+ "FORCE_COLOR" in env && (env.FORCE_COLOR === "true" ? forceColor = 1 : env.FORCE_COLOR === "false" ? forceColor = 0 : forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3));
183
127
  function translateLevel(level) {
184
- if (level === 0) {
185
- return false;
186
- }
187
- return {
128
+ return level === 0 ? !1 : {
188
129
  level,
189
- hasBasic: true,
130
+ hasBasic: !0,
190
131
  has256: level >= 2,
191
132
  has16m: level >= 3
192
133
  };
193
134
  }
194
- __name(translateLevel, "translateLevel");
195
135
  function supportsColor(haveStream, streamIsTTY) {
196
- if (forceColor === 0) {
136
+ if (forceColor === 0)
197
137
  return 0;
198
- }
199
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
138
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor"))
200
139
  return 3;
201
- }
202
- if (hasFlag("color=256")) {
140
+ if (hasFlag("color=256"))
203
141
  return 2;
204
- }
205
- if (haveStream && !streamIsTTY && forceColor === void 0) {
142
+ if (haveStream && !streamIsTTY && forceColor === void 0)
206
143
  return 0;
207
- }
208
- const min = forceColor || 0;
209
- if (env.TERM === "dumb") {
144
+ let min = forceColor || 0;
145
+ if (env.TERM === "dumb")
210
146
  return min;
211
- }
212
147
  if (process.platform === "win32") {
213
- const osRelease = os.release().split(".");
214
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
215
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
216
- }
217
- return 1;
218
- }
219
- if ("CI" in env) {
220
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
221
- return 1;
222
- }
223
- return min;
148
+ let osRelease = os.release().split(".");
149
+ return Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ? Number(osRelease[2]) >= 14931 ? 3 : 2 : 1;
224
150
  }
225
- if ("TEAMCITY_VERSION" in env) {
151
+ if ("CI" in env)
152
+ return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship" ? 1 : min;
153
+ if ("TEAMCITY_VERSION" in env)
226
154
  return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
227
- }
228
- if (env.COLORTERM === "truecolor") {
155
+ if (env.COLORTERM === "truecolor")
229
156
  return 3;
230
- }
231
157
  if ("TERM_PROGRAM" in env) {
232
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
158
+ let version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
233
159
  switch (env.TERM_PROGRAM) {
234
160
  case "iTerm.app":
235
161
  return version >= 3 ? 3 : 2;
@@ -237,27 +163,16 @@ var require_supports_color = __commonJS({
237
163
  return 2;
238
164
  }
239
165
  }
240
- if (/-256(color)?$/i.test(env.TERM)) {
241
- return 2;
242
- }
243
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
244
- return 1;
245
- }
246
- if ("COLORTERM" in env) {
247
- return 1;
248
- }
249
- return min;
166
+ return /-256(color)?$/i.test(env.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM) || "COLORTERM" in env ? 1 : min;
250
167
  }
251
- __name(supportsColor, "supportsColor");
252
168
  function getSupportLevel(stream) {
253
- const level = supportsColor(stream, stream && stream.isTTY);
169
+ let level = supportsColor(stream, stream && stream.isTTY);
254
170
  return translateLevel(level);
255
171
  }
256
- __name(getSupportLevel, "getSupportLevel");
257
172
  module.exports = {
258
173
  supportsColor: getSupportLevel,
259
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
260
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
174
+ stdout: translateLevel(supportsColor(!0, tty.isatty(1))),
175
+ stderr: translateLevel(supportsColor(!0, tty.isatty(2)))
261
176
  };
262
177
  }
263
178
  });
@@ -266,14 +181,7 @@ var require_supports_color = __commonJS({
266
181
  var require_file_writer = __commonJS({
267
182
  "../../node_modules/istanbul-lib-report/lib/file-writer.js"(exports, module) {
268
183
  "use strict";
269
- var path = __require("path");
270
- var fs = __require("fs");
271
- var mkdirp = require_make_dir();
272
- var supportsColor = require_supports_color();
273
- var ContentWriter = class {
274
- static {
275
- __name(this, "ContentWriter");
276
- }
184
+ var path = __require("path"), fs = __require("fs"), mkdirp = require_make_dir(), supportsColor = require_supports_color(), ContentWriter = class {
277
185
  /**
278
186
  * returns the colorized version of a string. Typically,
279
187
  * content writers that write to files will return the
@@ -299,14 +207,9 @@ var require_file_writer = __commonJS({
299
207
  */
300
208
  close() {
301
209
  }
302
- };
303
- var FileContentWriter = class extends ContentWriter {
304
- static {
305
- __name(this, "FileContentWriter");
306
- }
210
+ }, FileContentWriter = class extends ContentWriter {
307
211
  constructor(fd) {
308
- super();
309
- this.fd = fd;
212
+ super(), this.fd = fd;
310
213
  }
311
214
  write(str) {
312
215
  fs.writeSync(this.fd, str);
@@ -314,40 +217,22 @@ var require_file_writer = __commonJS({
314
217
  close() {
315
218
  fs.closeSync(this.fd);
316
219
  }
317
- };
318
- var capture = false;
319
- var output = "";
320
- var ConsoleWriter = class extends ContentWriter {
321
- static {
322
- __name(this, "ConsoleWriter");
323
- }
220
+ }, capture = !1, output = "", ConsoleWriter = class extends ContentWriter {
324
221
  write(str) {
325
- if (capture) {
326
- output += str;
327
- } else {
328
- process.stdout.write(str);
329
- }
222
+ capture ? output += str : process.stdout.write(str);
330
223
  }
331
224
  colorize(str, clazz) {
332
- const colors = {
225
+ let colors = {
333
226
  low: "31;1",
334
227
  medium: "33;1",
335
228
  high: "32;1"
336
229
  };
337
- if (supportsColor.stdout && colors[clazz]) {
338
- return `\x1B[${colors[clazz]}m${str}\x1B[0m`;
339
- }
340
- return str;
341
- }
342
- };
343
- var FileWriter = class _FileWriter {
344
- static {
345
- __name(this, "FileWriter");
230
+ return supportsColor.stdout && colors[clazz] ? `\x1B[${colors[clazz]}m${str}\x1B[0m` : str;
346
231
  }
232
+ }, FileWriter = class _FileWriter {
347
233
  constructor(baseDir) {
348
- if (!baseDir) {
234
+ if (!baseDir)
349
235
  throw new Error("baseDir must be specified");
350
- }
351
236
  this.baseDir = baseDir;
352
237
  }
353
238
  /**
@@ -355,10 +240,10 @@ var require_file_writer = __commonJS({
355
240
  * super useful for tests!
356
241
  */
357
242
  static startCapture() {
358
- capture = true;
243
+ capture = !0;
359
244
  }
360
245
  static stopCapture() {
361
- capture = false;
246
+ capture = !1;
362
247
  }
363
248
  static getOutput() {
364
249
  return output;
@@ -373,11 +258,10 @@ var require_file_writer = __commonJS({
373
258
  * @returns {FileWriter}
374
259
  */
375
260
  writerForDir(subdir) {
376
- if (path.isAbsolute(subdir)) {
261
+ if (path.isAbsolute(subdir))
377
262
  throw new Error(
378
263
  `Cannot create subdir writer for absolute path: ${subdir}`
379
264
  );
380
- }
381
265
  return new _FileWriter(`${this.baseDir}/${subdir}`);
382
266
  }
383
267
  /**
@@ -388,18 +272,11 @@ var require_file_writer = __commonJS({
388
272
  * (e.g., an "this file is autogenerated" comment, copyright notice, etc.)
389
273
  */
390
274
  copyFile(source, dest, header) {
391
- if (path.isAbsolute(dest)) {
275
+ if (path.isAbsolute(dest))
392
276
  throw new Error(`Cannot write to absolute path: ${dest}`);
393
- }
394
- dest = path.resolve(this.baseDir, dest);
395
- mkdirp.sync(path.dirname(dest));
277
+ dest = path.resolve(this.baseDir, dest), mkdirp.sync(path.dirname(dest));
396
278
  let contents;
397
- if (header) {
398
- contents = header + fs.readFileSync(source, "utf8");
399
- } else {
400
- contents = fs.readFileSync(source);
401
- }
402
- fs.writeFileSync(dest, contents);
279
+ header ? contents = header + fs.readFileSync(source, "utf8") : contents = fs.readFileSync(source), fs.writeFileSync(dest, contents);
403
280
  }
404
281
  /**
405
282
  * returns a content writer for writing content to the supplied file.
@@ -408,15 +285,11 @@ var require_file_writer = __commonJS({
408
285
  * @returns {ContentWriter}
409
286
  */
410
287
  writeFile(file) {
411
- if (file === null || file === "-") {
288
+ if (file === null || file === "-")
412
289
  return new ConsoleWriter();
413
- }
414
- if (path.isAbsolute(file)) {
290
+ if (path.isAbsolute(file))
415
291
  throw new Error(`Cannot write to absolute path: ${file}`);
416
- }
417
- file = path.resolve(this.baseDir, file);
418
- mkdirp.sync(path.dirname(file));
419
- return new FileContentWriter(fs.openSync(file, "w"));
292
+ return file = path.resolve(this.baseDir, file), mkdirp.sync(path.dirname(file)), new FileContentWriter(fs.openSync(file, "w"));
420
293
  }
421
294
  };
422
295
  module.exports = FileWriter;
@@ -427,21 +300,15 @@ var require_file_writer = __commonJS({
427
300
  var require_xml_writer = __commonJS({
428
301
  "../../node_modules/istanbul-lib-report/lib/xml-writer.js"(exports, module) {
429
302
  "use strict";
430
- var INDENT = " ";
431
303
  function attrString(attrs) {
432
304
  return Object.entries(attrs || {}).map(([k, v]) => ` ${k}="${v}"`).join("");
433
305
  }
434
- __name(attrString, "attrString");
435
306
  var XMLWriter = class {
436
- static {
437
- __name(this, "XMLWriter");
438
- }
439
307
  constructor(contentWriter) {
440
- this.cw = contentWriter;
441
- this.stack = [];
308
+ this.cw = contentWriter, this.stack = [];
442
309
  }
443
310
  indent(str) {
444
- return this.stack.map(() => INDENT).join("") + str;
311
+ return this.stack.map(() => " ").join("") + str;
445
312
  }
446
313
  /**
447
314
  * writes the opening XML tag with the supplied attributes
@@ -449,9 +316,8 @@ var require_xml_writer = __commonJS({
449
316
  * @param {Object} [attrs=null] attrs attributes for the tag
450
317
  */
451
318
  openTag(name, attrs) {
452
- const str = this.indent(`<${name + attrString(attrs)}>`);
453
- this.cw.println(str);
454
- this.stack.push(name);
319
+ let str = this.indent(`<${name + attrString(attrs)}>`);
320
+ this.cw.println(str), this.stack.push(name);
455
321
  }
456
322
  /**
457
323
  * closes an open XML tag.
@@ -459,16 +325,13 @@ var require_xml_writer = __commonJS({
459
325
  * notion of the tag that is currently open.
460
326
  */
461
327
  closeTag(name) {
462
- if (this.stack.length === 0) {
328
+ if (this.stack.length === 0)
463
329
  throw new Error(`Attempt to close tag ${name} when not opened`);
464
- }
465
- const stashed = this.stack.pop();
466
- const str = `</${name}>`;
467
- if (stashed !== name) {
330
+ let stashed = this.stack.pop(), str = `</${name}>`;
331
+ if (stashed !== name)
468
332
  throw new Error(
469
333
  `Attempt to close tag ${name} when ${stashed} was the one open`
470
334
  );
471
- }
472
335
  this.cw.println(this.indent(str));
473
336
  }
474
337
  /**
@@ -479,13 +342,7 @@ var require_xml_writer = __commonJS({
479
342
  */
480
343
  inlineTag(name, attrs, content) {
481
344
  let str = "<" + name + attrString(attrs);
482
- if (content) {
483
- str += `>${content}</${name}>`;
484
- } else {
485
- str += "/>";
486
- }
487
- str = this.indent(str);
488
- this.cw.println(str);
345
+ content ? str += `>${content}</${name}>` : str += "/>", str = this.indent(str), this.cw.println(str);
489
346
  }
490
347
  /**
491
348
  * closes all open tags and ends the document
@@ -505,38 +362,21 @@ var require_tree = __commonJS({
505
362
  "../../node_modules/istanbul-lib-report/lib/tree.js"(exports, module) {
506
363
  "use strict";
507
364
  var Visitor = class {
508
- static {
509
- __name(this, "Visitor");
510
- }
511
365
  constructor(delegate) {
512
366
  this.delegate = delegate;
513
367
  }
514
368
  };
515
369
  ["Start", "End", "Summary", "SummaryEnd", "Detail"].map((k) => `on${k}`).forEach((fn) => {
516
370
  Object.defineProperty(Visitor.prototype, fn, {
517
- writable: true,
371
+ writable: !0,
518
372
  value(node, state) {
519
- if (typeof this.delegate[fn] === "function") {
520
- this.delegate[fn](node, state);
521
- }
373
+ typeof this.delegate[fn] == "function" && this.delegate[fn](node, state);
522
374
  }
523
375
  });
524
376
  });
525
377
  var CompositeVisitor = class extends Visitor {
526
- static {
527
- __name(this, "CompositeVisitor");
528
- }
529
378
  constructor(visitors) {
530
- super();
531
- if (!Array.isArray(visitors)) {
532
- visitors = [visitors];
533
- }
534
- this.visitors = visitors.map((v) => {
535
- if (v instanceof Visitor) {
536
- return v;
537
- }
538
- return new Visitor(v);
539
- });
379
+ super(), Array.isArray(visitors) || (visitors = [visitors]), this.visitors = visitors.map((v) => v instanceof Visitor ? v : new Visitor(v));
540
380
  }
541
381
  };
542
382
  ["Start", "Summary", "SummaryEnd", "Detail", "End"].map((k) => `on${k}`).forEach((fn) => {
@@ -549,9 +389,6 @@ var require_tree = __commonJS({
549
389
  });
550
390
  });
551
391
  var BaseNode = class {
552
- static {
553
- __name(this, "BaseNode");
554
- }
555
392
  isRoot() {
556
393
  return !this.getParent();
557
394
  }
@@ -563,23 +400,11 @@ var require_tree = __commonJS({
563
400
  * @param state optional state that is passed around
564
401
  */
565
402
  visit(visitor, state) {
566
- if (this.isSummary()) {
567
- visitor.onSummary(this, state);
568
- } else {
569
- visitor.onDetail(this, state);
570
- }
571
- this.getChildren().forEach((child) => {
403
+ this.isSummary() ? visitor.onSummary(this, state) : visitor.onDetail(this, state), this.getChildren().forEach((child) => {
572
404
  child.visit(visitor, state);
573
- });
574
- if (this.isSummary()) {
575
- visitor.onSummaryEnd(this, state);
576
- }
577
- }
578
- };
579
- var BaseTree = class {
580
- static {
581
- __name(this, "BaseTree");
405
+ }), this.isSummary() && visitor.onSummaryEnd(this, state);
582
406
  }
407
+ }, BaseTree = class {
583
408
  constructor(root) {
584
409
  this.root = root;
585
410
  }
@@ -595,12 +420,7 @@ var require_tree = __commonJS({
595
420
  * @param state - the state to be passed around during tree traversal
596
421
  */
597
422
  visit(visitor, state) {
598
- if (!(visitor instanceof Visitor)) {
599
- visitor = new Visitor(visitor);
600
- }
601
- visitor.onStart(this.getRoot(), state);
602
- this.getRoot().visit(visitor, state);
603
- visitor.onEnd(this.getRoot(), state);
423
+ visitor instanceof Visitor || (visitor = new Visitor(visitor)), visitor.onStart(this.getRoot(), state), this.getRoot().visit(visitor, state), visitor.onEnd(this.getRoot(), state);
604
424
  }
605
425
  };
606
426
  module.exports = {
@@ -633,15 +453,10 @@ var require_watermarks = __commonJS({
633
453
  var require_percent = __commonJS({
634
454
  "../../node_modules/istanbul-lib-coverage/lib/percent.js"(exports, module) {
635
455
  "use strict";
636
- module.exports = /* @__PURE__ */ __name(function percent(covered, total) {
456
+ module.exports = function(covered, total) {
637
457
  let tmp;
638
- if (total > 0) {
639
- tmp = 1e3 * 100 * covered / total;
640
- return Math.floor(tmp / 10) / 100;
641
- } else {
642
- return 100;
643
- }
644
- }, "percent");
458
+ return total > 0 ? (tmp = 1e3 * 100 * covered / total, Math.floor(tmp / 10) / 100) : 100;
459
+ };
645
460
  }
646
461
  });
647
462
 
@@ -649,16 +464,16 @@ var require_percent = __commonJS({
649
464
  var require_data_properties = __commonJS({
650
465
  "../../node_modules/istanbul-lib-coverage/lib/data-properties.js"(exports, module) {
651
466
  "use strict";
652
- module.exports = /* @__PURE__ */ __name(function dataProperties(klass, properties) {
467
+ module.exports = function(klass, properties) {
653
468
  properties.forEach((p) => {
654
469
  Object.defineProperty(klass.prototype, p, {
655
- enumerable: true,
470
+ enumerable: !0,
656
471
  get() {
657
472
  return this.data[p];
658
473
  }
659
474
  });
660
475
  });
661
- }, "dataProperties");
476
+ };
662
477
  }
663
478
  });
664
479
 
@@ -666,15 +481,14 @@ var require_data_properties = __commonJS({
666
481
  var require_coverage_summary = __commonJS({
667
482
  "../../node_modules/istanbul-lib-coverage/lib/coverage-summary.js"(exports, module) {
668
483
  "use strict";
669
- var percent = require_percent();
670
- var dataProperties = require_data_properties();
484
+ var percent = require_percent(), dataProperties = require_data_properties();
671
485
  function blankSummary() {
672
- const empty = /* @__PURE__ */ __name(() => ({
486
+ let empty = () => ({
673
487
  total: 0,
674
488
  covered: 0,
675
489
  skipped: 0,
676
490
  pct: "Unknown"
677
- }), "empty");
491
+ });
678
492
  return {
679
493
  lines: empty(),
680
494
  statements: empty(),
@@ -683,56 +497,35 @@ var require_coverage_summary = __commonJS({
683
497
  branchesTrue: empty()
684
498
  };
685
499
  }
686
- __name(blankSummary, "blankSummary");
687
500
  function assertValidSummary(obj) {
688
- const valid = obj && obj.lines && obj.statements && obj.functions && obj.branches;
689
- if (!valid) {
501
+ if (!(obj && obj.lines && obj.statements && obj.functions && obj.branches))
690
502
  throw new Error(
691
503
  "Invalid summary coverage object, missing keys, found:" + Object.keys(obj).join(",")
692
504
  );
693
- }
694
505
  }
695
- __name(assertValidSummary, "assertValidSummary");
696
506
  var CoverageSummary = class _CoverageSummary {
697
- static {
698
- __name(this, "CoverageSummary");
699
- }
700
507
  /**
701
508
  * @constructor
702
509
  * @param {Object|CoverageSummary} [obj=undefined] an optional data object or
703
510
  * another coverage summary to initialize this object with.
704
511
  */
705
512
  constructor(obj) {
706
- if (!obj) {
707
- this.data = blankSummary();
708
- } else if (obj instanceof _CoverageSummary) {
709
- this.data = obj.data;
710
- } else {
711
- this.data = obj;
712
- }
713
- assertValidSummary(this.data);
513
+ obj ? obj instanceof _CoverageSummary ? this.data = obj.data : this.data = obj : this.data = blankSummary(), assertValidSummary(this.data);
714
514
  }
715
515
  /**
716
516
  * merges a second summary coverage object into this one
717
517
  * @param {CoverageSummary} obj - another coverage summary object
718
518
  */
719
519
  merge(obj) {
720
- const keys = [
520
+ return [
721
521
  "lines",
722
522
  "statements",
723
523
  "branches",
724
524
  "functions",
725
525
  "branchesTrue"
726
- ];
727
- keys.forEach((key) => {
728
- if (obj[key]) {
729
- this[key].total += obj[key].total;
730
- this[key].covered += obj[key].covered;
731
- this[key].skipped += obj[key].skipped;
732
- this[key].pct = percent(this[key].covered, this[key].total);
733
- }
734
- });
735
- return this;
526
+ ].forEach((key) => {
527
+ obj[key] && (this[key].total += obj[key].total, this[key].covered += obj[key].covered, this[key].skipped += obj[key].skipped, this[key].pct = percent(this[key].covered, this[key].total));
528
+ }), this;
736
529
  }
737
530
  /**
738
531
  * returns a POJO that is JSON serializable. May be used to get the raw
@@ -765,11 +558,9 @@ var require_coverage_summary = __commonJS({
765
558
  var require_file_coverage = __commonJS({
766
559
  "../../node_modules/istanbul-lib-coverage/lib/file-coverage.js"(exports, module) {
767
560
  "use strict";
768
- var percent = require_percent();
769
- var dataProperties = require_data_properties();
770
- var { CoverageSummary } = require_coverage_summary();
561
+ var percent = require_percent(), dataProperties = require_data_properties(), { CoverageSummary } = require_coverage_summary();
771
562
  function emptyCoverage(filePath, reportLogic) {
772
- const cov = {
563
+ let cov = {
773
564
  path: filePath,
774
565
  statementMap: {},
775
566
  fnMap: {},
@@ -778,137 +569,84 @@ var require_file_coverage = __commonJS({
778
569
  f: {},
779
570
  b: {}
780
571
  };
781
- if (reportLogic) cov.bT = {};
782
- return cov;
572
+ return reportLogic && (cov.bT = {}), cov;
783
573
  }
784
- __name(emptyCoverage, "emptyCoverage");
785
574
  function assertValidObject(obj) {
786
- const valid = obj && obj.path && obj.statementMap && obj.fnMap && obj.branchMap && obj.s && obj.f && obj.b;
787
- if (!valid) {
575
+ if (!(obj && obj.path && obj.statementMap && obj.fnMap && obj.branchMap && obj.s && obj.f && obj.b))
788
576
  throw new Error(
789
577
  "Invalid file coverage object, missing keys, found:" + Object.keys(obj).join(",")
790
578
  );
791
- }
792
579
  }
793
- __name(assertValidObject, "assertValidObject");
794
- var keyFromLoc = /* @__PURE__ */ __name(({ start, end }) => `${start.line}|${start.column}|${end.line}|${end.column}`, "keyFromLoc");
795
- var isObj = /* @__PURE__ */ __name((o) => !!o && typeof o === "object", "isObj");
796
- var isLineCol = /* @__PURE__ */ __name((o) => isObj(o) && typeof o.line === "number" && typeof o.column === "number", "isLineCol");
797
- var isLoc = /* @__PURE__ */ __name((o) => isObj(o) && isLineCol(o.start) && isLineCol(o.end), "isLoc");
798
- var getLoc = /* @__PURE__ */ __name((o) => isLoc(o) ? o : isLoc(o.loc) ? o.loc : null, "getLoc");
799
- var findNearestContainer = /* @__PURE__ */ __name((item, map) => {
800
- const itemLoc = getLoc(item);
580
+ var keyFromLoc = ({ start, end }) => `${start.line}|${start.column}|${end.line}|${end.column}`, isObj = (o) => !!o && typeof o == "object", isLineCol = (o) => isObj(o) && typeof o.line == "number" && typeof o.column == "number", isLoc = (o) => isObj(o) && isLineCol(o.start) && isLineCol(o.end), getLoc = (o) => isLoc(o) ? o : isLoc(o.loc) ? o.loc : null, findNearestContainer = (item, map) => {
581
+ let itemLoc = getLoc(item);
801
582
  if (!itemLoc) return null;
802
- let nearestContainingItem = null;
803
- let containerDistance = null;
804
- let containerKey = null;
805
- for (const [i, mapItem] of Object.entries(map)) {
806
- const mapLoc = getLoc(mapItem);
583
+ let nearestContainingItem = null, containerDistance = null, containerKey = null;
584
+ for (let [i, mapItem] of Object.entries(map)) {
585
+ let mapLoc = getLoc(mapItem);
807
586
  if (!mapLoc) continue;
808
- const distance = [
587
+ let distance = [
809
588
  itemLoc.start.line - mapLoc.start.line,
810
589
  itemLoc.start.column - mapLoc.start.column,
811
590
  mapLoc.end.line - itemLoc.end.line,
812
591
  mapLoc.end.column - itemLoc.end.column
813
592
  ];
814
- if (distance[0] < 0 || distance[2] < 0 || distance[0] === 0 && distance[1] < 0 || distance[2] === 0 && distance[3] < 0) {
593
+ if (distance[0] < 0 || distance[2] < 0 || distance[0] === 0 && distance[1] < 0 || distance[2] === 0 && distance[3] < 0)
815
594
  continue;
816
- }
817
595
  if (nearestContainingItem === null) {
818
- containerDistance = distance;
819
- nearestContainingItem = mapItem;
820
- containerKey = i;
596
+ containerDistance = distance, nearestContainingItem = mapItem, containerKey = i;
821
597
  continue;
822
598
  }
823
- const closerBefore = distance[0] < containerDistance[0] || distance[0] === 0 && distance[1] < containerDistance[1];
824
- const closerAfter = distance[2] < containerDistance[2] || distance[2] === 0 && distance[3] < containerDistance[3];
825
- if (closerBefore || closerAfter) {
826
- containerDistance = distance;
827
- nearestContainingItem = mapItem;
828
- containerKey = i;
829
- }
599
+ let closerBefore = distance[0] < containerDistance[0] || distance[0] === 0 && distance[1] < containerDistance[1], closerAfter = distance[2] < containerDistance[2] || distance[2] === 0 && distance[3] < containerDistance[3];
600
+ (closerBefore || closerAfter) && (containerDistance = distance, nearestContainingItem = mapItem, containerKey = i);
830
601
  }
831
602
  return containerKey;
832
- }, "findNearestContainer");
833
- var addHits = /* @__PURE__ */ __name((aHits, bHits) => {
834
- if (typeof aHits === "number" && typeof bHits === "number") {
835
- return aHits + bHits;
836
- } else if (Array.isArray(aHits) && Array.isArray(bHits)) {
837
- return aHits.map((a, i) => (a || 0) + (bHits[i] || 0));
838
- }
839
- return null;
840
- }, "addHits");
841
- var addNearestContainerHits = /* @__PURE__ */ __name((item, itemHits, map, mapHits) => {
842
- const container = findNearestContainer(item, map);
843
- if (container) {
844
- return addHits(itemHits, mapHits[container]);
845
- } else {
846
- return itemHits;
847
- }
848
- }, "addNearestContainerHits");
849
- var mergeProp = /* @__PURE__ */ __name((aHits, aMap, bHits, bMap, itemKey = keyFromLoc) => {
850
- const aItems = {};
851
- for (const [key, itemHits] of Object.entries(aHits)) {
852
- const item = aMap[key];
603
+ }, addHits = (aHits, bHits) => typeof aHits == "number" && typeof bHits == "number" ? aHits + bHits : Array.isArray(aHits) && Array.isArray(bHits) ? aHits.map((a, i) => (a || 0) + (bHits[i] || 0)) : null, addNearestContainerHits = (item, itemHits, map, mapHits) => {
604
+ let container = findNearestContainer(item, map);
605
+ return container ? addHits(itemHits, mapHits[container]) : itemHits;
606
+ }, mergeProp = (aHits, aMap, bHits, bMap, itemKey = keyFromLoc) => {
607
+ let aItems = {};
608
+ for (let [key, itemHits] of Object.entries(aHits)) {
609
+ let item = aMap[key];
853
610
  aItems[itemKey(item)] = [itemHits, item];
854
611
  }
855
- const bItems = {};
856
- for (const [key, itemHits] of Object.entries(bHits)) {
857
- const item = bMap[key];
612
+ let bItems = {};
613
+ for (let [key, itemHits] of Object.entries(bHits)) {
614
+ let item = bMap[key];
858
615
  bItems[itemKey(item)] = [itemHits, item];
859
616
  }
860
- const mergedItems = {};
861
- for (const [key, aValue] of Object.entries(aItems)) {
862
- let aItemHits = aValue[0];
863
- const aItem = aValue[1];
864
- const bValue = bItems[key];
865
- if (!bValue) {
866
- aItemHits = addNearestContainerHits(aItem, aItemHits, bMap, bHits);
867
- } else {
868
- aItemHits = addHits(aItemHits, bValue[0]);
869
- }
870
- mergedItems[key] = [aItemHits, aItem];
871
- }
872
- for (const [key, bValue] of Object.entries(bItems)) {
873
- let bItemHits = bValue[0];
874
- const bItem = bValue[1];
875
- if (mergedItems[key]) continue;
876
- bItemHits = addNearestContainerHits(bItem, bItemHits, aMap, aHits);
877
- mergedItems[key] = [bItemHits, bItem];
878
- }
879
- const hits = {};
880
- const map = {};
881
- Object.values(mergedItems).forEach(([itemHits, item], i) => {
882
- hits[i] = itemHits;
883
- map[i] = item;
884
- });
885
- return [hits, map];
886
- }, "mergeProp");
887
- var FileCoverage = class _FileCoverage {
888
- static {
889
- __name(this, "FileCoverage");
617
+ let mergedItems = {};
618
+ for (let [key, aValue] of Object.entries(aItems)) {
619
+ let aItemHits = aValue[0], aItem = aValue[1], bValue = bItems[key];
620
+ bValue ? aItemHits = addHits(aItemHits, bValue[0]) : aItemHits = addNearestContainerHits(aItem, aItemHits, bMap, bHits), mergedItems[key] = [aItemHits, aItem];
621
+ }
622
+ for (let [key, bValue] of Object.entries(bItems)) {
623
+ let bItemHits = bValue[0], bItem = bValue[1];
624
+ mergedItems[key] || (bItemHits = addNearestContainerHits(bItem, bItemHits, aMap, aHits), mergedItems[key] = [bItemHits, bItem]);
890
625
  }
626
+ let hits = {}, map = {};
627
+ return Object.values(mergedItems).forEach(([itemHits, item], i) => {
628
+ hits[i] = itemHits, map[i] = item;
629
+ }), [hits, map];
630
+ }, FileCoverage = class _FileCoverage {
891
631
  /**
892
632
  * @constructor
893
633
  * @param {Object|FileCoverage|String} pathOrObj is a string that initializes
894
634
  * and empty coverage object with the specified file path or a data object that
895
635
  * has all the required properties for a file coverage object.
896
636
  */
897
- constructor(pathOrObj, reportLogic = false) {
898
- if (!pathOrObj) {
637
+ constructor(pathOrObj, reportLogic = !1) {
638
+ if (!pathOrObj)
899
639
  throw new Error(
900
640
  "Coverage must be initialized with a path or an object"
901
641
  );
902
- }
903
- if (typeof pathOrObj === "string") {
642
+ if (typeof pathOrObj == "string")
904
643
  this.data = emptyCoverage(pathOrObj, reportLogic);
905
- } else if (pathOrObj instanceof _FileCoverage) {
644
+ else if (pathOrObj instanceof _FileCoverage)
906
645
  this.data = pathOrObj.data;
907
- } else if (typeof pathOrObj === "object") {
646
+ else if (typeof pathOrObj == "object")
908
647
  this.data = pathOrObj;
909
- } else {
648
+ else
910
649
  throw new Error("Invalid argument to coverage constructor");
911
- }
912
650
  assertValidObject(this.data);
913
651
  }
914
652
  /**
@@ -916,20 +654,13 @@ var require_file_coverage = __commonJS({
916
654
  * This is a map of hits keyed by line number in the source.
917
655
  */
918
656
  getLineCoverage() {
919
- const statementMap = this.data.statementMap;
920
- const statements = this.data.s;
921
- const lineMap = /* @__PURE__ */ Object.create(null);
922
- Object.entries(statements).forEach(([st, count]) => {
923
- if (!statementMap[st]) {
657
+ let statementMap = this.data.statementMap, statements = this.data.s, lineMap = /* @__PURE__ */ Object.create(null);
658
+ return Object.entries(statements).forEach(([st, count]) => {
659
+ if (!statementMap[st])
924
660
  return;
925
- }
926
- const { line } = statementMap[st].start;
927
- const prevVal = lineMap[line];
928
- if (prevVal === void 0 || prevVal < count) {
929
- lineMap[line] = count;
930
- }
931
- });
932
- return lineMap;
661
+ let { line } = statementMap[st].start, prevVal = lineMap[line];
662
+ (prevVal === void 0 || prevVal < count) && (lineMap[line] = count);
663
+ }), lineMap;
933
664
  }
934
665
  /**
935
666
  * returns an array of uncovered line numbers.
@@ -937,14 +668,10 @@ var require_file_coverage = __commonJS({
937
668
  * collected.
938
669
  */
939
670
  getUncoveredLines() {
940
- const lc = this.getLineCoverage();
941
- const ret = [];
942
- Object.entries(lc).forEach(([l, hits]) => {
943
- if (hits === 0) {
944
- ret.push(l);
945
- }
946
- });
947
- return ret;
671
+ let lc = this.getLineCoverage(), ret = [];
672
+ return Object.entries(lc).forEach(([l, hits]) => {
673
+ hits === 0 && ret.push(l);
674
+ }), ret;
948
675
  }
949
676
  /**
950
677
  * returns a map of branch coverage by source line number.
@@ -952,25 +679,18 @@ var require_file_coverage = __commonJS({
952
679
  * has a `covered`, `total` and `coverage` (percentage) property.
953
680
  */
954
681
  getBranchCoverageByLine() {
955
- const branchMap = this.branchMap;
956
- const branches = this.b;
957
- const ret = {};
958
- Object.entries(branchMap).forEach(([k, map]) => {
959
- const line = map.line || map.loc.start.line;
960
- const branchData = branches[k];
961
- ret[line] = ret[line] || [];
962
- ret[line].push(...branchData);
963
- });
964
- Object.entries(ret).forEach(([k, dataArray]) => {
965
- const covered = dataArray.filter((item) => item > 0);
966
- const coverage = covered.length / dataArray.length * 100;
682
+ let branchMap = this.branchMap, branches = this.b, ret = {};
683
+ return Object.entries(branchMap).forEach(([k, map]) => {
684
+ let line = map.line || map.loc.start.line, branchData = branches[k];
685
+ ret[line] = ret[line] || [], ret[line].push(...branchData);
686
+ }), Object.entries(ret).forEach(([k, dataArray]) => {
687
+ let covered = dataArray.filter((item) => item > 0), coverage = covered.length / dataArray.length * 100;
967
688
  ret[k] = {
968
689
  covered: covered.length,
969
690
  total: dataArray.length,
970
691
  coverage
971
692
  };
972
- });
973
- return ret;
693
+ }), ret;
974
694
  }
975
695
  /**
976
696
  * return a JSON-serializable POJO for this file coverage object
@@ -984,10 +704,9 @@ var require_file_coverage = __commonJS({
984
704
  * Note that the other object should have the same structure as this one (same file).
985
705
  */
986
706
  merge(other) {
987
- if (other.all === true) {
707
+ if (other.all === !0)
988
708
  return;
989
- }
990
- if (this.all === true) {
709
+ if (this.all === !0) {
991
710
  this.data = other.data;
992
711
  return;
993
712
  }
@@ -997,100 +716,67 @@ var require_file_coverage = __commonJS({
997
716
  other.s,
998
717
  other.statementMap
999
718
  );
1000
- this.data.s = hits;
1001
- this.data.statementMap = map;
1002
- const keyFromLocProp = /* @__PURE__ */ __name((x) => keyFromLoc(x.loc), "keyFromLocProp");
1003
- const keyFromLocationsProp = /* @__PURE__ */ __name((x) => keyFromLoc(x.locations[0]), "keyFromLocationsProp");
719
+ this.data.s = hits, this.data.statementMap = map;
720
+ let keyFromLocProp = (x) => keyFromLoc(x.loc), keyFromLocationsProp = (x) => keyFromLoc(x.locations[0]);
1004
721
  [hits, map] = mergeProp(
1005
722
  this.f,
1006
723
  this.fnMap,
1007
724
  other.f,
1008
725
  other.fnMap,
1009
726
  keyFromLocProp
1010
- );
1011
- this.data.f = hits;
1012
- this.data.fnMap = map;
1013
- [hits, map] = mergeProp(
727
+ ), this.data.f = hits, this.data.fnMap = map, [hits, map] = mergeProp(
1014
728
  this.b,
1015
729
  this.branchMap,
1016
730
  other.b,
1017
731
  other.branchMap,
1018
732
  keyFromLocationsProp
1019
- );
1020
- this.data.b = hits;
1021
- this.data.branchMap = map;
1022
- if (this.bT && other.bT) {
1023
- [hits, map] = mergeProp(
1024
- this.bT,
1025
- this.branchMap,
1026
- other.bT,
1027
- other.branchMap,
1028
- keyFromLocationsProp
1029
- );
1030
- this.data.bT = hits;
1031
- }
733
+ ), this.data.b = hits, this.data.branchMap = map, this.bT && other.bT && ([hits, map] = mergeProp(
734
+ this.bT,
735
+ this.branchMap,
736
+ other.bT,
737
+ other.branchMap,
738
+ keyFromLocationsProp
739
+ ), this.data.bT = hits);
1032
740
  }
1033
741
  computeSimpleTotals(property) {
1034
742
  let stats = this[property];
1035
- if (typeof stats === "function") {
1036
- stats = stats.call(this);
1037
- }
1038
- const ret = {
743
+ typeof stats == "function" && (stats = stats.call(this));
744
+ let ret = {
1039
745
  total: Object.keys(stats).length,
1040
746
  covered: Object.values(stats).filter((v) => !!v).length,
1041
747
  skipped: 0
1042
748
  };
1043
- ret.pct = percent(ret.covered, ret.total);
1044
- return ret;
749
+ return ret.pct = percent(ret.covered, ret.total), ret;
1045
750
  }
1046
751
  computeBranchTotals(property) {
1047
- const stats = this[property];
1048
- const ret = { total: 0, covered: 0, skipped: 0 };
1049
- Object.values(stats).forEach((branches) => {
1050
- ret.covered += branches.filter((hits) => hits > 0).length;
1051
- ret.total += branches.length;
1052
- });
1053
- ret.pct = percent(ret.covered, ret.total);
1054
- return ret;
752
+ let stats = this[property], ret = { total: 0, covered: 0, skipped: 0 };
753
+ return Object.values(stats).forEach((branches) => {
754
+ ret.covered += branches.filter((hits) => hits > 0).length, ret.total += branches.length;
755
+ }), ret.pct = percent(ret.covered, ret.total), ret;
1055
756
  }
1056
757
  /**
1057
758
  * resets hit counts for all statements, functions and branches
1058
759
  * in this coverage object resulting in zero coverage.
1059
760
  */
1060
761
  resetHits() {
1061
- const statements = this.s;
1062
- const functions = this.f;
1063
- const branches = this.b;
1064
- const branchesTrue = this.bT;
762
+ let statements = this.s, functions = this.f, branches = this.b, branchesTrue = this.bT;
1065
763
  Object.keys(statements).forEach((s) => {
1066
764
  statements[s] = 0;
1067
- });
1068
- Object.keys(functions).forEach((f) => {
765
+ }), Object.keys(functions).forEach((f) => {
1069
766
  functions[f] = 0;
1070
- });
1071
- Object.keys(branches).forEach((b) => {
767
+ }), Object.keys(branches).forEach((b) => {
1072
768
  branches[b].fill(0);
769
+ }), branchesTrue && Object.keys(branchesTrue).forEach((bT) => {
770
+ branchesTrue[bT].fill(0);
1073
771
  });
1074
- if (branchesTrue) {
1075
- Object.keys(branchesTrue).forEach((bT) => {
1076
- branchesTrue[bT].fill(0);
1077
- });
1078
- }
1079
772
  }
1080
773
  /**
1081
774
  * returns a CoverageSummary for this file coverage object
1082
775
  * @returns {CoverageSummary}
1083
776
  */
1084
777
  toSummary() {
1085
- const ret = {};
1086
- ret.lines = this.computeSimpleTotals("getLineCoverage");
1087
- ret.functions = this.computeSimpleTotals("f", "fnMap");
1088
- ret.statements = this.computeSimpleTotals("s", "statementMap");
1089
- ret.branches = this.computeBranchTotals("b");
1090
- if (this.bT) {
1091
- ret.branchesTrue = this.computeBranchTotals("bT");
1092
- }
1093
- return new CoverageSummary(ret);
778
+ let ret = {};
779
+ return ret.lines = this.computeSimpleTotals("getLineCoverage"), ret.functions = this.computeSimpleTotals("f", "fnMap"), ret.statements = this.computeSimpleTotals("s", "statementMap"), ret.branches = this.computeBranchTotals("b"), this.bT && (ret.branchesTrue = this.computeBranchTotals("bT")), new CoverageSummary(ret);
1094
780
  }
1095
781
  };
1096
782
  dataProperties(FileCoverage, [
@@ -1118,41 +804,24 @@ var require_file_coverage = __commonJS({
1118
804
  var require_coverage_map = __commonJS({
1119
805
  "../../node_modules/istanbul-lib-coverage/lib/coverage-map.js"(exports, module) {
1120
806
  "use strict";
1121
- var { FileCoverage } = require_file_coverage();
1122
- var { CoverageSummary } = require_coverage_summary();
807
+ var { FileCoverage } = require_file_coverage(), { CoverageSummary } = require_coverage_summary();
1123
808
  function maybeConstruct(obj, klass) {
1124
- if (obj instanceof klass) {
1125
- return obj;
1126
- }
1127
- return new klass(obj);
809
+ return obj instanceof klass ? obj : new klass(obj);
1128
810
  }
1129
- __name(maybeConstruct, "maybeConstruct");
1130
811
  function loadMap(source) {
1131
- const data = /* @__PURE__ */ Object.create(null);
1132
- if (!source) {
1133
- return data;
1134
- }
1135
- Object.entries(source).forEach(([k, cov]) => {
812
+ let data = /* @__PURE__ */ Object.create(null);
813
+ return source && Object.entries(source).forEach(([k, cov]) => {
1136
814
  data[k] = maybeConstruct(cov, FileCoverage);
1137
- });
1138
- return data;
815
+ }), data;
1139
816
  }
1140
- __name(loadMap, "loadMap");
1141
817
  var CoverageMap = class _CoverageMap {
1142
- static {
1143
- __name(this, "CoverageMap");
1144
- }
1145
818
  /**
1146
819
  * @constructor
1147
820
  * @param {Object} [obj=undefined] obj A coverage map from which to initialize this
1148
821
  * map's contents. This can be the raw global coverage object.
1149
822
  */
1150
823
  constructor(obj) {
1151
- if (obj instanceof _CoverageMap) {
1152
- this.data = obj.data;
1153
- } else {
1154
- this.data = loadMap(obj);
1155
- }
824
+ obj instanceof _CoverageMap ? this.data = obj.data : this.data = loadMap(obj);
1156
825
  }
1157
826
  /**
1158
827
  * merges a second coverage map into this one
@@ -1161,7 +830,7 @@ var require_coverage_map = __commonJS({
1161
830
  * as needed.
1162
831
  */
1163
832
  merge(obj) {
1164
- const other = maybeConstruct(obj, _CoverageMap);
833
+ let other = maybeConstruct(obj, _CoverageMap);
1165
834
  Object.values(other.data).forEach((fc) => {
1166
835
  this.addFileCoverage(fc);
1167
836
  });
@@ -1174,9 +843,7 @@ var require_coverage_map = __commonJS({
1174
843
  */
1175
844
  filter(callback) {
1176
845
  Object.keys(this.data).forEach((k) => {
1177
- if (!callback(k)) {
1178
- delete this.data[k];
1179
- }
846
+ callback(k) || delete this.data[k];
1180
847
  });
1181
848
  }
1182
849
  /**
@@ -1199,10 +866,9 @@ var require_coverage_map = __commonJS({
1199
866
  * @returns {FileCoverage}
1200
867
  */
1201
868
  fileCoverageFor(file) {
1202
- const fc = this.data[file];
1203
- if (!fc) {
869
+ let fc = this.data[file];
870
+ if (!fc)
1204
871
  throw new Error(`No file coverage available for: ${file}`);
1205
- }
1206
872
  return fc;
1207
873
  }
1208
874
  /**
@@ -1212,24 +878,18 @@ var require_coverage_map = __commonJS({
1212
878
  * @param {FileCoverage} fc the file coverage to add
1213
879
  */
1214
880
  addFileCoverage(fc) {
1215
- const cov = new FileCoverage(fc);
1216
- const { path } = cov;
1217
- if (this.data[path]) {
1218
- this.data[path].merge(cov);
1219
- } else {
1220
- this.data[path] = cov;
1221
- }
881
+ let cov = new FileCoverage(fc), { path } = cov;
882
+ this.data[path] ? this.data[path].merge(cov) : this.data[path] = cov;
1222
883
  }
1223
884
  /**
1224
885
  * returns the coverage summary for all the file coverage objects in this map.
1225
886
  * @returns {CoverageSummary}
1226
887
  */
1227
888
  getCoverageSummary() {
1228
- const ret = new CoverageSummary();
1229
- Object.values(this.data).forEach((fc) => {
889
+ let ret = new CoverageSummary();
890
+ return Object.values(this.data).forEach((fc) => {
1230
891
  ret.merge(fc.toSummary());
1231
- });
1232
- return ret;
892
+ }), ret;
1233
893
  }
1234
894
  };
1235
895
  module.exports = {
@@ -1242,9 +902,7 @@ var require_coverage_map = __commonJS({
1242
902
  var require_istanbul_lib_coverage = __commonJS({
1243
903
  "../../node_modules/istanbul-lib-coverage/index.js"(exports, module) {
1244
904
  "use strict";
1245
- var { FileCoverage } = require_file_coverage();
1246
- var { CoverageMap } = require_coverage_map();
1247
- var { CoverageSummary } = require_coverage_summary();
905
+ var { FileCoverage } = require_file_coverage(), { CoverageMap } = require_coverage_map(), { CoverageSummary } = require_coverage_summary();
1248
906
  module.exports = {
1249
907
  /**
1250
908
  * creates a coverage summary object
@@ -1253,10 +911,7 @@ var require_istanbul_lib_coverage = __commonJS({
1253
911
  * @returns {CoverageSummary}
1254
912
  */
1255
913
  createCoverageSummary(obj) {
1256
- if (obj && obj instanceof CoverageSummary) {
1257
- return obj;
1258
- }
1259
- return new CoverageSummary(obj);
914
+ return obj && obj instanceof CoverageSummary ? obj : new CoverageSummary(obj);
1260
915
  },
1261
916
  /**
1262
917
  * creates a CoverageMap object
@@ -1265,10 +920,7 @@ var require_istanbul_lib_coverage = __commonJS({
1265
920
  * @returns {CoverageMap}
1266
921
  */
1267
922
  createCoverageMap(obj) {
1268
- if (obj && obj instanceof CoverageMap) {
1269
- return obj;
1270
- }
1271
- return new CoverageMap(obj);
923
+ return obj && obj instanceof CoverageMap ? obj : new CoverageMap(obj);
1272
924
  },
1273
925
  /**
1274
926
  * creates a FileCoverage object
@@ -1277,10 +929,7 @@ var require_istanbul_lib_coverage = __commonJS({
1277
929
  * @returns {FileCoverage}
1278
930
  */
1279
931
  createFileCoverage(obj) {
1280
- if (obj && obj instanceof FileCoverage) {
1281
- return obj;
1282
- }
1283
- return new FileCoverage(obj);
932
+ return obj && obj instanceof FileCoverage ? obj : new FileCoverage(obj);
1284
933
  }
1285
934
  };
1286
935
  module.exports.classes = {
@@ -1296,59 +945,21 @@ var require_istanbul_lib_coverage = __commonJS({
1296
945
  var require_path = __commonJS({
1297
946
  "../../node_modules/istanbul-lib-report/lib/path.js"(exports, module) {
1298
947
  "use strict";
1299
- var path = __require("path");
1300
- var parsePath = path.parse;
1301
- var SEP = path.sep;
1302
- var origParser = parsePath;
1303
- var origSep = SEP;
948
+ var path = __require("path"), parsePath = path.parse, SEP = path.sep, origParser = parsePath, origSep = SEP;
1304
949
  function makeRelativeNormalizedPath(str, sep) {
1305
- const parsed = parsePath(str);
1306
- let root = parsed.root;
1307
- let dir;
1308
- let file = parsed.base;
1309
- let quoted;
1310
- let pos;
1311
- if (sep === "\\") {
1312
- pos = root.indexOf(":\\");
1313
- if (pos >= 0) {
1314
- root = root.substring(0, pos + 2);
1315
- }
1316
- }
1317
- dir = parsed.dir.substring(root.length);
1318
- if (str === "") {
1319
- return [];
1320
- }
1321
- if (sep !== "/") {
1322
- quoted = new RegExp(sep.replace(/\W/g, "\\$&"), "g");
1323
- dir = dir.replace(quoted, "/");
1324
- file = file.replace(quoted, "/");
1325
- }
1326
- if (dir !== "") {
1327
- dir = `${dir}/${file}`;
1328
- } else {
1329
- dir = file;
1330
- }
1331
- if (dir.substring(0, 1) === "/") {
1332
- dir = dir.substring(1);
1333
- }
1334
- dir = dir.split(/\/+/);
1335
- return dir;
950
+ let parsed = parsePath(str), root = parsed.root, dir, file = parsed.base, quoted, pos;
951
+ return sep === "\\" && (pos = root.indexOf(":\\"), pos >= 0 && (root = root.substring(0, pos + 2))), dir = parsed.dir.substring(root.length), str === "" ? [] : (sep !== "/" && (quoted = new RegExp(sep.replace(/\W/g, "\\$&"), "g"), dir = dir.replace(quoted, "/"), file = file.replace(quoted, "/")), dir !== "" ? dir = `${dir}/${file}` : dir = file, dir.substring(0, 1) === "/" && (dir = dir.substring(1)), dir = dir.split(/\/+/), dir);
1336
952
  }
1337
- __name(makeRelativeNormalizedPath, "makeRelativeNormalizedPath");
1338
953
  var Path = class _Path {
1339
- static {
1340
- __name(this, "Path");
1341
- }
1342
954
  constructor(strOrArray) {
1343
- if (Array.isArray(strOrArray)) {
955
+ if (Array.isArray(strOrArray))
1344
956
  this.v = strOrArray;
1345
- } else if (typeof strOrArray === "string") {
957
+ else if (typeof strOrArray == "string")
1346
958
  this.v = makeRelativeNormalizedPath(strOrArray, SEP);
1347
- } else {
959
+ else
1348
960
  throw new Error(
1349
961
  `Invalid Path argument must be string or array:${strOrArray}`
1350
962
  );
1351
- }
1352
963
  }
1353
964
  toString() {
1354
965
  return this.v.join("/");
@@ -1357,12 +968,10 @@ var require_path = __commonJS({
1357
968
  return this.v.length > 0;
1358
969
  }
1359
970
  parent() {
1360
- if (!this.hasParent()) {
971
+ if (!this.hasParent())
1361
972
  throw new Error("Unable to get parent for 0 elem path");
1362
- }
1363
- const p = this.v.slice();
1364
- p.pop();
1365
- return new _Path(p);
973
+ let p = this.v.slice();
974
+ return p.pop(), new _Path(p);
1366
975
  }
1367
976
  elements() {
1368
977
  return this.v.slice();
@@ -1372,15 +981,12 @@ var require_path = __commonJS({
1372
981
  }
1373
982
  contains(other) {
1374
983
  let i;
1375
- if (other.length > this.length) {
1376
- return false;
1377
- }
1378
- for (i = 0; i < other.length; i += 1) {
1379
- if (this.v[i] !== other.v[i]) {
1380
- return false;
1381
- }
1382
- }
1383
- return true;
984
+ if (other.length > this.length)
985
+ return !1;
986
+ for (i = 0; i < other.length; i += 1)
987
+ if (this.v[i] !== other.v[i])
988
+ return !1;
989
+ return !0;
1384
990
  }
1385
991
  ancestorOf(other) {
1386
992
  return other.contains(this) && other.length !== this.length;
@@ -1389,29 +995,18 @@ var require_path = __commonJS({
1389
995
  return this.contains(other) && other.length !== this.length;
1390
996
  }
1391
997
  commonPrefixPath(other) {
1392
- const len = this.length > other.length ? other.length : this.length;
1393
- let i;
1394
- const ret = [];
1395
- for (i = 0; i < len; i += 1) {
1396
- if (this.v[i] === other.v[i]) {
1397
- ret.push(this.v[i]);
1398
- } else {
1399
- break;
1400
- }
1401
- }
998
+ let len = this.length > other.length ? other.length : this.length, i, ret = [];
999
+ for (i = 0; i < len && this.v[i] === other.v[i]; i += 1)
1000
+ ret.push(this.v[i]);
1402
1001
  return new _Path(ret);
1403
1002
  }
1404
1003
  static compare(a, b) {
1405
- const al = a.length;
1406
- const bl = b.length;
1407
- if (al < bl) {
1004
+ let al = a.length, bl = b.length;
1005
+ if (al < bl)
1408
1006
  return -1;
1409
- }
1410
- if (al > bl) {
1007
+ if (al > bl)
1411
1008
  return 1;
1412
- }
1413
- const astr = a.toString();
1414
- const bstr = b.toString();
1009
+ let astr = a.toString(), bstr = b.toString();
1415
1010
  return astr < bstr ? -1 : astr > bstr ? 1 : 0;
1416
1011
  }
1417
1012
  };
@@ -1423,7 +1018,7 @@ var require_path = __commonJS({
1423
1018
  });
1424
1019
  });
1425
1020
  Object.defineProperty(Path.prototype, "length", {
1426
- enumerable: true,
1021
+ enumerable: !0,
1427
1022
  get() {
1428
1023
  return this.v.length;
1429
1024
  }
@@ -1431,12 +1026,10 @@ var require_path = __commonJS({
1431
1026
  module.exports = Path;
1432
1027
  Path.tester = {
1433
1028
  setParserAndSep(p, sep) {
1434
- parsePath = p;
1435
- SEP = sep;
1029
+ parsePath = p, SEP = sep;
1436
1030
  },
1437
1031
  reset() {
1438
- parsePath = origParser;
1439
- SEP = origSep;
1032
+ parsePath = origParser, SEP = origSep;
1440
1033
  }
1441
1034
  };
1442
1035
  }
@@ -1446,51 +1039,30 @@ var require_path = __commonJS({
1446
1039
  var require_summarizer_factory = __commonJS({
1447
1040
  "../../node_modules/istanbul-lib-report/lib/summarizer-factory.js"(exports, module) {
1448
1041
  "use strict";
1449
- var coverage = require_istanbul_lib_coverage();
1450
- var Path = require_path();
1451
- var { BaseNode, BaseTree } = require_tree();
1452
- var ReportNode = class _ReportNode extends BaseNode {
1453
- static {
1454
- __name(this, "ReportNode");
1455
- }
1042
+ var coverage = require_istanbul_lib_coverage(), Path = require_path(), { BaseNode, BaseTree } = require_tree(), ReportNode = class _ReportNode extends BaseNode {
1456
1043
  constructor(path, fileCoverage) {
1457
- super();
1458
- this.path = path;
1459
- this.parent = null;
1460
- this.fileCoverage = fileCoverage;
1461
- this.children = [];
1044
+ super(), this.path = path, this.parent = null, this.fileCoverage = fileCoverage, this.children = [];
1462
1045
  }
1463
1046
  static createRoot(children) {
1464
- const root = new _ReportNode(new Path([]));
1465
- children.forEach((child) => {
1047
+ let root = new _ReportNode(new Path([]));
1048
+ return children.forEach((child) => {
1466
1049
  root.addChild(child);
1467
- });
1468
- return root;
1050
+ }), root;
1469
1051
  }
1470
1052
  addChild(child) {
1471
- child.parent = this;
1472
- this.children.push(child);
1053
+ child.parent = this, this.children.push(child);
1473
1054
  }
1474
1055
  asRelative(p) {
1475
- if (p.substring(0, 1) === "/") {
1476
- return p.substring(1);
1477
- }
1478
- return p;
1056
+ return p.substring(0, 1) === "/" ? p.substring(1) : p;
1479
1057
  }
1480
1058
  getQualifiedName() {
1481
1059
  return this.asRelative(this.path.toString());
1482
1060
  }
1483
1061
  getRelativeName() {
1484
- const parent = this.getParent();
1485
- const myPath = this.path;
1486
- let relPath;
1487
- let i;
1488
- const parentPath = parent ? parent.path : new Path([]);
1062
+ let parent = this.getParent(), myPath = this.path, relPath, i, parentPath = parent ? parent.path : new Path([]);
1489
1063
  if (parentPath.ancestorOf(myPath)) {
1490
- relPath = new Path(myPath.elements());
1491
- for (i = 0; i < parentPath.length; i += 1) {
1064
+ for (relPath = new Path(myPath.elements()), i = 0; i < parentPath.length; i += 1)
1492
1065
  relPath.shift();
1493
- }
1494
1066
  return this.asRelative(relPath.toString());
1495
1067
  }
1496
1068
  return this.asRelative(this.path.toString());
@@ -1508,49 +1080,30 @@ var require_summarizer_factory = __commonJS({
1508
1080
  return this.fileCoverage;
1509
1081
  }
1510
1082
  getCoverageSummary(filesOnly) {
1511
- const cacheProp = `c_${filesOnly ? "files" : "full"}`;
1512
- let summary;
1513
- if (Object.prototype.hasOwnProperty.call(this, cacheProp)) {
1083
+ let cacheProp = `c_${filesOnly ? "files" : "full"}`, summary;
1084
+ if (Object.prototype.hasOwnProperty.call(this, cacheProp))
1514
1085
  return this[cacheProp];
1515
- }
1516
- if (!this.isSummary()) {
1086
+ if (!this.isSummary())
1517
1087
  summary = this.getFileCoverage().toSummary();
1518
- } else {
1088
+ else {
1519
1089
  let count = 0;
1520
- summary = coverage.createCoverageSummary();
1521
- this.getChildren().forEach((child) => {
1522
- if (filesOnly && child.isSummary()) {
1523
- return;
1524
- }
1525
- count += 1;
1526
- summary.merge(child.getCoverageSummary(filesOnly));
1527
- });
1528
- if (count === 0 && filesOnly) {
1529
- summary = null;
1530
- }
1090
+ summary = coverage.createCoverageSummary(), this.getChildren().forEach((child) => {
1091
+ filesOnly && child.isSummary() || (count += 1, summary.merge(child.getCoverageSummary(filesOnly)));
1092
+ }), count === 0 && filesOnly && (summary = null);
1531
1093
  }
1532
- this[cacheProp] = summary;
1533
- return summary;
1534
- }
1535
- };
1536
- var ReportTree = class extends BaseTree {
1537
- static {
1538
- __name(this, "ReportTree");
1094
+ return this[cacheProp] = summary, summary;
1539
1095
  }
1096
+ }, ReportTree = class extends BaseTree {
1540
1097
  constructor(root, childPrefix) {
1541
1098
  super(root);
1542
- const maybePrefix = /* @__PURE__ */ __name((node) => {
1543
- if (childPrefix && !node.isRoot()) {
1544
- node.path.unshift(childPrefix);
1545
- }
1546
- }, "maybePrefix");
1099
+ let maybePrefix = (node) => {
1100
+ childPrefix && !node.isRoot() && node.path.unshift(childPrefix);
1101
+ };
1547
1102
  this.visit({
1548
1103
  onDetail: maybePrefix,
1549
1104
  onSummary(node) {
1550
- maybePrefix(node);
1551
- node.children.sort((a, b) => {
1552
- const astr = a.path.toString();
1553
- const bstr = b.path.toString();
1105
+ maybePrefix(node), node.children.sort((a, b) => {
1106
+ let astr = a.path.toString(), bstr = b.path.toString();
1554
1107
  return astr < bstr ? -1 : astr > bstr ? 1 : (
1555
1108
  /* istanbul ignore next */
1556
1109
  0
@@ -1566,132 +1119,79 @@ var require_summarizer_factory = __commonJS({
1566
1119
  paths[0] || new Path([])
1567
1120
  );
1568
1121
  }
1569
- __name(findCommonParent, "findCommonParent");
1570
1122
  function findOrCreateParent(parentPath, nodeMap, created = () => {
1571
1123
  }) {
1572
1124
  let parent = nodeMap[parentPath.toString()];
1573
- if (!parent) {
1574
- parent = new ReportNode(parentPath);
1575
- nodeMap[parentPath.toString()] = parent;
1576
- created(parentPath, parent);
1577
- }
1578
- return parent;
1125
+ return parent || (parent = new ReportNode(parentPath), nodeMap[parentPath.toString()] = parent, created(parentPath, parent)), parent;
1579
1126
  }
1580
- __name(findOrCreateParent, "findOrCreateParent");
1581
1127
  function toDirParents(list) {
1582
- const nodeMap = /* @__PURE__ */ Object.create(null);
1583
- list.forEach((o) => {
1584
- const parent = findOrCreateParent(o.path.parent(), nodeMap);
1585
- parent.addChild(new ReportNode(o.path, o.fileCoverage));
1586
- });
1587
- return Object.values(nodeMap);
1128
+ let nodeMap = /* @__PURE__ */ Object.create(null);
1129
+ return list.forEach((o) => {
1130
+ findOrCreateParent(o.path.parent(), nodeMap).addChild(new ReportNode(o.path, o.fileCoverage));
1131
+ }), Object.values(nodeMap);
1588
1132
  }
1589
- __name(toDirParents, "toDirParents");
1590
1133
  function addAllPaths(topPaths, nodeMap, path, node) {
1591
- const parent = findOrCreateParent(
1134
+ findOrCreateParent(
1592
1135
  path.parent(),
1593
1136
  nodeMap,
1594
1137
  (parentPath, parent2) => {
1595
- if (parentPath.hasParent()) {
1596
- addAllPaths(topPaths, nodeMap, parentPath, parent2);
1597
- } else {
1598
- topPaths.push(parent2);
1599
- }
1138
+ parentPath.hasParent() ? addAllPaths(topPaths, nodeMap, parentPath, parent2) : topPaths.push(parent2);
1600
1139
  }
1601
- );
1602
- parent.addChild(node);
1140
+ ).addChild(node);
1603
1141
  }
1604
- __name(addAllPaths, "addAllPaths");
1605
1142
  function foldIntoOneDir(node, parent) {
1606
- const { children } = node;
1607
- if (children.length === 1 && !children[0].fileCoverage) {
1608
- children[0].parent = parent;
1609
- return foldIntoOneDir(children[0], parent);
1610
- }
1611
- node.children = children.map((child) => foldIntoOneDir(child, node));
1612
- return node;
1143
+ let { children } = node;
1144
+ return children.length === 1 && !children[0].fileCoverage ? (children[0].parent = parent, foldIntoOneDir(children[0], parent)) : (node.children = children.map((child) => foldIntoOneDir(child, node)), node);
1613
1145
  }
1614
- __name(foldIntoOneDir, "foldIntoOneDir");
1615
1146
  function pkgSummaryPrefix(dirParents, commonParent) {
1616
- if (!dirParents.some((dp) => dp.path.length === 0)) {
1617
- return;
1618
- }
1619
- if (commonParent.length === 0) {
1620
- return "root";
1621
- }
1622
- return commonParent.name();
1147
+ if (dirParents.some((dp) => dp.path.length === 0))
1148
+ return commonParent.length === 0 ? "root" : commonParent.name();
1623
1149
  }
1624
- __name(pkgSummaryPrefix, "pkgSummaryPrefix");
1625
1150
  var SummarizerFactory = class {
1626
- static {
1627
- __name(this, "SummarizerFactory");
1628
- }
1629
1151
  constructor(coverageMap, defaultSummarizer = "pkg") {
1630
- this._coverageMap = coverageMap;
1631
- this._defaultSummarizer = defaultSummarizer;
1632
- this._initialList = coverageMap.files().map((filePath) => ({
1152
+ this._coverageMap = coverageMap, this._defaultSummarizer = defaultSummarizer, this._initialList = coverageMap.files().map((filePath) => ({
1633
1153
  filePath,
1634
1154
  path: new Path(filePath),
1635
1155
  fileCoverage: coverageMap.fileCoverageFor(filePath)
1636
- }));
1637
- this._commonParent = findCommonParent(
1156
+ })), this._commonParent = findCommonParent(
1638
1157
  this._initialList.map((o) => o.path.parent())
1639
- );
1640
- if (this._commonParent.length > 0) {
1641
- this._initialList.forEach((o) => {
1642
- o.path.splice(0, this._commonParent.length);
1643
- });
1644
- }
1158
+ ), this._commonParent.length > 0 && this._initialList.forEach((o) => {
1159
+ o.path.splice(0, this._commonParent.length);
1160
+ });
1645
1161
  }
1646
1162
  get defaultSummarizer() {
1647
1163
  return this[this._defaultSummarizer];
1648
1164
  }
1649
1165
  get flat() {
1650
- if (!this._flat) {
1651
- this._flat = new ReportTree(
1652
- ReportNode.createRoot(
1653
- this._initialList.map(
1654
- (node) => new ReportNode(node.path, node.fileCoverage)
1655
- )
1166
+ return this._flat || (this._flat = new ReportTree(
1167
+ ReportNode.createRoot(
1168
+ this._initialList.map(
1169
+ (node) => new ReportNode(node.path, node.fileCoverage)
1656
1170
  )
1657
- );
1658
- }
1659
- return this._flat;
1171
+ )
1172
+ )), this._flat;
1660
1173
  }
1661
1174
  _createPkg() {
1662
- const dirParents = toDirParents(this._initialList);
1663
- if (dirParents.length === 1) {
1664
- return new ReportTree(dirParents[0]);
1665
- }
1666
- return new ReportTree(
1175
+ let dirParents = toDirParents(this._initialList);
1176
+ return dirParents.length === 1 ? new ReportTree(dirParents[0]) : new ReportTree(
1667
1177
  ReportNode.createRoot(dirParents),
1668
1178
  pkgSummaryPrefix(dirParents, this._commonParent)
1669
1179
  );
1670
1180
  }
1671
1181
  get pkg() {
1672
- if (!this._pkg) {
1673
- this._pkg = this._createPkg();
1674
- }
1675
- return this._pkg;
1182
+ return this._pkg || (this._pkg = this._createPkg()), this._pkg;
1676
1183
  }
1677
1184
  _createNested() {
1678
- const nodeMap = /* @__PURE__ */ Object.create(null);
1679
- const topPaths = [];
1185
+ let nodeMap = /* @__PURE__ */ Object.create(null), topPaths = [];
1680
1186
  this._initialList.forEach((o) => {
1681
- const node = new ReportNode(o.path, o.fileCoverage);
1187
+ let node = new ReportNode(o.path, o.fileCoverage);
1682
1188
  addAllPaths(topPaths, nodeMap, o.path, node);
1683
1189
  });
1684
- const topNodes = topPaths.map((node) => foldIntoOneDir(node));
1685
- if (topNodes.length === 1) {
1686
- return new ReportTree(topNodes[0]);
1687
- }
1688
- return new ReportTree(ReportNode.createRoot(topNodes));
1190
+ let topNodes = topPaths.map((node) => foldIntoOneDir(node));
1191
+ return topNodes.length === 1 ? new ReportTree(topNodes[0]) : new ReportTree(ReportNode.createRoot(topNodes));
1689
1192
  }
1690
1193
  get nested() {
1691
- if (!this._nested) {
1692
- this._nested = this._createNested();
1693
- }
1694
- return this._nested;
1194
+ return this._nested || (this._nested = this._createNested()), this._nested;
1695
1195
  }
1696
1196
  };
1697
1197
  module.exports = SummarizerFactory;
@@ -1702,12 +1202,7 @@ var require_summarizer_factory = __commonJS({
1702
1202
  var require_context = __commonJS({
1703
1203
  "../../node_modules/istanbul-lib-report/lib/context.js"(exports, module) {
1704
1204
  "use strict";
1705
- var fs = __require("fs");
1706
- var FileWriter = require_file_writer();
1707
- var XMLWriter = require_xml_writer();
1708
- var tree = require_tree();
1709
- var watermarks = require_watermarks();
1710
- var SummarizerFactory = require_summarizer_factory();
1205
+ var fs = __require("fs"), FileWriter = require_file_writer(), XMLWriter = require_xml_writer(), tree = require_tree(), watermarks = require_watermarks(), SummarizerFactory = require_summarizer_factory();
1711
1206
  function defaultSourceLookup(path) {
1712
1207
  try {
1713
1208
  return fs.readFileSync(path, "utf8");
@@ -1715,30 +1210,18 @@ var require_context = __commonJS({
1715
1210
  throw new Error(`Unable to lookup source: ${path} (${ex.message})`);
1716
1211
  }
1717
1212
  }
1718
- __name(defaultSourceLookup, "defaultSourceLookup");
1719
1213
  function normalizeWatermarks(specified = {}) {
1720
- Object.entries(watermarks.getDefault()).forEach(([k, value]) => {
1721
- const specValue = specified[k];
1722
- if (!Array.isArray(specValue) || specValue.length !== 2) {
1723
- specified[k] = value;
1724
- }
1725
- });
1726
- return specified;
1214
+ return Object.entries(watermarks.getDefault()).forEach(([k, value]) => {
1215
+ let specValue = specified[k];
1216
+ (!Array.isArray(specValue) || specValue.length !== 2) && (specified[k] = value);
1217
+ }), specified;
1727
1218
  }
1728
- __name(normalizeWatermarks, "normalizeWatermarks");
1729
1219
  var Context = class {
1730
- static {
1731
- __name(this, "Context");
1732
- }
1733
1220
  constructor(opts) {
1734
- this.dir = opts.dir || "coverage";
1735
- this.watermarks = normalizeWatermarks(opts.watermarks);
1736
- this.sourceFinder = opts.sourceFinder || defaultSourceLookup;
1737
- this._summarizerFactory = new SummarizerFactory(
1221
+ this.dir = opts.dir || "coverage", this.watermarks = normalizeWatermarks(opts.watermarks), this.sourceFinder = opts.sourceFinder || defaultSourceLookup, this._summarizerFactory = new SummarizerFactory(
1738
1222
  opts.coverageMap,
1739
1223
  opts.defaultSummarizer
1740
- );
1741
- this.data = {};
1224
+ ), this.data = {};
1742
1225
  }
1743
1226
  /**
1744
1227
  * returns a FileWriter implementation for reporting use. Also available
@@ -1766,17 +1249,8 @@ var require_context = __commonJS({
1766
1249
  * @returns {String} one of `high`, `medium` or `low`
1767
1250
  */
1768
1251
  classForPercent(type, value) {
1769
- const watermarks2 = this.watermarks[type];
1770
- if (!watermarks2) {
1771
- return "unknown";
1772
- }
1773
- if (value < watermarks2[0]) {
1774
- return "low";
1775
- }
1776
- if (value >= watermarks2[1]) {
1777
- return "high";
1778
- }
1779
- return "medium";
1252
+ let watermarks2 = this.watermarks[type];
1253
+ return watermarks2 ? value < watermarks2[0] ? "low" : value >= watermarks2[1] ? "high" : "medium" : "unknown";
1780
1254
  }
1781
1255
  /**
1782
1256
  * returns an XML writer for the supplied content writer
@@ -1802,12 +1276,9 @@ var require_context = __commonJS({
1802
1276
  }
1803
1277
  };
1804
1278
  Object.defineProperty(Context.prototype, "writer", {
1805
- enumerable: true,
1279
+ enumerable: !0,
1806
1280
  get() {
1807
- if (!this.data.writer) {
1808
- this.data.writer = new FileWriter(this.dir);
1809
- }
1810
- return this.data.writer;
1281
+ return this.data.writer || (this.data.writer = new FileWriter(this.dir)), this.data.writer;
1811
1282
  }
1812
1283
  });
1813
1284
  module.exports = Context;
@@ -1818,11 +1289,7 @@ var require_context = __commonJS({
1818
1289
  var require_report_base = __commonJS({
1819
1290
  "../../node_modules/istanbul-lib-report/lib/report-base.js"(exports, module) {
1820
1291
  "use strict";
1821
- var _summarizer = Symbol("ReportBase.#summarizer");
1822
- var ReportBase2 = class {
1823
- static {
1824
- __name(this, "ReportBase");
1825
- }
1292
+ var _summarizer = Symbol("ReportBase.#summarizer"), ReportBase2 = class {
1826
1293
  constructor(opts = {}) {
1827
1294
  this[_summarizer] = opts.summarizer;
1828
1295
  }
@@ -1838,9 +1305,7 @@ var require_report_base = __commonJS({
1838
1305
  var require_istanbul_lib_report = __commonJS({
1839
1306
  "../../node_modules/istanbul-lib-report/index.js"(exports, module) {
1840
1307
  "use strict";
1841
- var Context = require_context();
1842
- var watermarks = require_watermarks();
1843
- var ReportBase2 = require_report_base();
1308
+ var Context = require_context(), watermarks = require_watermarks(), ReportBase2 = require_report_base();
1844
1309
  module.exports = {
1845
1310
  /**
1846
1311
  * returns a reporting context for the supplied options
@@ -1869,26 +1334,16 @@ var require_istanbul_lib_report = __commonJS({
1869
1334
  });
1870
1335
 
1871
1336
  // src/node/coverage-reporter.ts
1872
- var import_istanbul_lib_report = __toESM(require_istanbul_lib_report(), 1);
1873
- var StorybookCoverageReporter = class extends import_istanbul_lib_report.ReportBase {
1874
- static {
1875
- __name(this, "StorybookCoverageReporter");
1876
- }
1337
+ var import_istanbul_lib_report = __toESM(require_istanbul_lib_report(), 1), StorybookCoverageReporter = class extends import_istanbul_lib_report.ReportBase {
1877
1338
  #testManager;
1878
1339
  #coverageOptions;
1879
1340
  constructor(opts) {
1880
- super();
1881
- this.#testManager = opts.testManager;
1882
- this.#coverageOptions = opts.coverageOptions;
1341
+ super(), this.#testManager = opts.testManager, this.#coverageOptions = opts.coverageOptions;
1883
1342
  }
1884
1343
  onSummary(node) {
1885
- if (!node.isRoot()) {
1344
+ if (!node.isRoot())
1886
1345
  return;
1887
- }
1888
- const rawCoverageSummary = node.getCoverageSummary(false);
1889
- const percentage = Math.round(rawCoverageSummary.data.statements.pct);
1890
- const [lowWatermark = 50, highWatermark = 80] = this.#coverageOptions?.watermarks?.statements ?? [];
1891
- const coverageSummary = {
1346
+ let rawCoverageSummary = node.getCoverageSummary(!1), percentage = Math.round(rawCoverageSummary.data.statements.pct), [lowWatermark = 50, highWatermark = 80] = this.#coverageOptions?.watermarks?.statements ?? [], coverageSummary = {
1892
1347
  percentage,
1893
1348
  status: percentage < lowWatermark ? "negative" : percentage < highWatermark ? "warning" : "positive"
1894
1349
  };