@noma.to/qwik-testing-library 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +12 -2
  2. package/lib/index.qwik.cjs +0 -4
  3. package/lib/index.qwik.mjs +0 -4
  4. package/lib/lib/qwik-testing-library.qwik.cjs +1 -5
  5. package/lib/lib/qwik-testing-library.qwik.mjs +2 -6
  6. package/lib/lib/qwikloader.qwik.cjs +1 -1
  7. package/lib/lib/qwikloader.qwik.mjs +1 -1
  8. package/lib-types/lib/qwik-testing-library.d.ts +1 -2
  9. package/package.json +9 -9
  10. package/lib/lib/mock.qwik.cjs +0 -14
  11. package/lib/lib/mock.qwik.mjs +0 -14
  12. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.cjs +0 -89
  13. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.mjs +0 -89
  14. package/lib/node_modules/.pnpm/@vitest_expect@2.1.8/node_modules/@vitest/expect/dist/index.qwik.cjs +0 -2051
  15. package/lib/node_modules/.pnpm/@vitest_expect@2.1.8/node_modules/@vitest/expect/dist/index.qwik.mjs +0 -2051
  16. package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.8/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +0 -1208
  17. package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.8/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +0 -1208
  18. package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +0 -44
  19. package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +0 -44
  20. package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/index.qwik.cjs +0 -671
  21. package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/index.qwik.mjs +0 -671
  22. package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.8/node_modules/@vitest/snapshot/dist/index.qwik.cjs +0 -2044
  23. package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.8/node_modules/@vitest/snapshot/dist/index.qwik.mjs +0 -2044
  24. package/lib/node_modules/.pnpm/@vitest_spy@2.1.8/node_modules/@vitest/spy/dist/index.qwik.cjs +0 -148
  25. package/lib/node_modules/.pnpm/@vitest_spy@2.1.8/node_modules/@vitest/spy/dist/index.qwik.mjs +0 -148
  26. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs +0 -162
  27. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs +0 -162
  28. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/diff.qwik.cjs +0 -1739
  29. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/diff.qwik.mjs +0 -1739
  30. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/error.qwik.cjs +0 -137
  31. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/error.qwik.mjs +0 -137
  32. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/helpers.qwik.cjs +0 -150
  33. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/helpers.qwik.mjs +0 -150
  34. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.cjs +0 -472
  35. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.mjs +0 -472
  36. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/source-map.qwik.cjs +0 -216
  37. package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/source-map.qwik.mjs +0 -216
  38. package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.cjs +0 -3937
  39. package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.mjs +0 -3937
  40. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/arguments.qwik.cjs +0 -9
  41. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/arguments.qwik.mjs +0 -10
  42. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/array.qwik.cjs +0 -16
  43. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/array.qwik.mjs +0 -17
  44. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/bigint.qwik.cjs +0 -9
  45. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/bigint.qwik.mjs +0 -10
  46. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/class.qwik.cjs +0 -16
  47. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/class.qwik.mjs +0 -17
  48. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/date.qwik.cjs +0 -12
  49. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/date.qwik.mjs +0 -13
  50. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/error.qwik.cjs +0 -36
  51. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/error.qwik.mjs +0 -37
  52. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/function.qwik.cjs +0 -11
  53. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/function.qwik.mjs +0 -12
  54. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/helpers.qwik.cjs +0 -160
  55. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/helpers.qwik.mjs +0 -160
  56. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/html.qwik.cjs +0 -36
  57. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/html.qwik.mjs +0 -36
  58. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/index.qwik.cjs +0 -130
  59. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/index.qwik.mjs +0 -130
  60. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/map.qwik.cjs +0 -25
  61. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/map.qwik.mjs +0 -26
  62. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/number.qwik.cjs +0 -19
  63. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/number.qwik.mjs +0 -20
  64. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/object.qwik.cjs +0 -24
  65. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/object.qwik.mjs +0 -25
  66. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/promise.qwik.cjs +0 -17
  67. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/promise.qwik.mjs +0 -18
  68. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/regexp.qwik.cjs +0 -9
  69. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/regexp.qwik.mjs +0 -10
  70. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/set.qwik.cjs +0 -16
  71. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/set.qwik.mjs +0 -17
  72. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/string.qwik.cjs +0 -23
  73. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/string.qwik.mjs +0 -24
  74. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/symbol.qwik.cjs +0 -8
  75. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/symbol.qwik.mjs +0 -9
  76. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/typedarray.qwik.cjs +0 -34
  77. package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/typedarray.qwik.mjs +0 -35
  78. package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.cjs +0 -979
  79. package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.mjs +0 -979
  80. package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs +0 -101
  81. package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs +0 -101
  82. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +0 -7
  83. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +0 -8
  84. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +0 -80
  85. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +0 -80
  86. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +0 -104
  87. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +0 -104
  88. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +0 -8
  89. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +0 -8
  90. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +0 -56
  91. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +0 -56
  92. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.cjs +0 -66
  93. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.mjs +0 -66
  94. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.cjs +0 -2749
  95. package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.mjs +0 -2749
  96. package/lib-types/lib/mock.d.ts +0 -34
@@ -1,9 +0,0 @@
1
- "use strict";
2
- const helpers = require("./helpers.qwik.cjs");
3
- function inspectArguments(args, options) {
4
- if (args.length === 0)
5
- return "Arguments[]";
6
- options.truncate -= 13;
7
- return `Arguments[ ${helpers.inspectList(args, options)} ]`;
8
- }
9
- module.exports = inspectArguments;
@@ -1,10 +0,0 @@
1
- import { inspectList } from "./helpers.qwik.mjs";
2
- function inspectArguments(args, options) {
3
- if (args.length === 0)
4
- return "Arguments[]";
5
- options.truncate -= 13;
6
- return `Arguments[ ${inspectList(args, options)} ]`;
7
- }
8
- export {
9
- inspectArguments as default
10
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- const helpers = require("./helpers.qwik.cjs");
3
- function inspectArray(array, options) {
4
- const nonIndexProperties = Object.keys(array).slice(array.length);
5
- if (!array.length && !nonIndexProperties.length)
6
- return "[]";
7
- options.truncate -= 4;
8
- const listContents = helpers.inspectList(array, options);
9
- options.truncate -= listContents.length;
10
- let propertyContents = "";
11
- if (nonIndexProperties.length) {
12
- propertyContents = helpers.inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, helpers.inspectProperty);
13
- }
14
- return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
15
- }
16
- module.exports = inspectArray;
@@ -1,17 +0,0 @@
1
- import { inspectList, inspectProperty } from "./helpers.qwik.mjs";
2
- function inspectArray(array, options) {
3
- const nonIndexProperties = Object.keys(array).slice(array.length);
4
- if (!array.length && !nonIndexProperties.length)
5
- return "[]";
6
- options.truncate -= 4;
7
- const listContents = inspectList(array, options);
8
- options.truncate -= listContents.length;
9
- let propertyContents = "";
10
- if (nonIndexProperties.length) {
11
- propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
12
- }
13
- return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
14
- }
15
- export {
16
- inspectArray as default
17
- };
@@ -1,9 +0,0 @@
1
- "use strict";
2
- const helpers = require("./helpers.qwik.cjs");
3
- function inspectBigInt(number, options) {
4
- let nums = helpers.truncate(number.toString(), options.truncate - 1);
5
- if (nums !== helpers.truncator)
6
- nums += "n";
7
- return options.stylize(nums, "bigint");
8
- }
9
- module.exports = inspectBigInt;
@@ -1,10 +0,0 @@
1
- import { truncate, truncator } from "./helpers.qwik.mjs";
2
- function inspectBigInt(number, options) {
3
- let nums = truncate(number.toString(), options.truncate - 1);
4
- if (nums !== truncator)
5
- nums += "n";
6
- return options.stylize(nums, "bigint");
7
- }
8
- export {
9
- inspectBigInt as default
10
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- const object = require("./object.qwik.cjs");
3
- const toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
4
- function inspectClass(value, options) {
5
- let name = "";
6
- if (toStringTag && toStringTag in value) {
7
- name = value[toStringTag];
8
- }
9
- name = name || value.constructor.name;
10
- if (!name || name === "_class") {
11
- name = "<Anonymous Class>";
12
- }
13
- options.truncate -= name.length;
14
- return `${name}${object(value, options)}`;
15
- }
16
- module.exports = inspectClass;
@@ -1,17 +0,0 @@
1
- import inspectObject from "./object.qwik.mjs";
2
- const toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
3
- function inspectClass(value, options) {
4
- let name = "";
5
- if (toStringTag && toStringTag in value) {
6
- name = value[toStringTag];
7
- }
8
- name = name || value.constructor.name;
9
- if (!name || name === "_class") {
10
- name = "<Anonymous Class>";
11
- }
12
- options.truncate -= name.length;
13
- return `${name}${inspectObject(value, options)}`;
14
- }
15
- export {
16
- inspectClass as default
17
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- const helpers = require("./helpers.qwik.cjs");
3
- function inspectDate(dateObject, options) {
4
- const stringRepresentation = dateObject.toJSON();
5
- if (stringRepresentation === null) {
6
- return "Invalid Date";
7
- }
8
- const split = stringRepresentation.split("T");
9
- const date = split[0];
10
- return options.stylize(`${date}T${helpers.truncate(split[1], options.truncate - date.length - 1)}`, "date");
11
- }
12
- module.exports = inspectDate;
@@ -1,13 +0,0 @@
1
- import { truncate } from "./helpers.qwik.mjs";
2
- function inspectDate(dateObject, options) {
3
- const stringRepresentation = dateObject.toJSON();
4
- if (stringRepresentation === null) {
5
- return "Invalid Date";
6
- }
7
- const split = stringRepresentation.split("T");
8
- const date = split[0];
9
- return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date");
10
- }
11
- export {
12
- inspectDate as default
13
- };
@@ -1,36 +0,0 @@
1
- "use strict";
2
- const helpers = require("./helpers.qwik.cjs");
3
- const errorKeys = [
4
- "stack",
5
- "line",
6
- "column",
7
- "name",
8
- "message",
9
- "fileName",
10
- "lineNumber",
11
- "columnNumber",
12
- "number",
13
- "description",
14
- "cause"
15
- ];
16
- function inspectObject(error, options) {
17
- const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1);
18
- const name = error.name;
19
- options.truncate -= name.length;
20
- let message = "";
21
- if (typeof error.message === "string") {
22
- message = helpers.truncate(error.message, options.truncate);
23
- } else {
24
- properties.unshift("message");
25
- }
26
- message = message ? `: ${message}` : "";
27
- options.truncate -= message.length + 5;
28
- options.seen = options.seen || [];
29
- if (options.seen.includes(error)) {
30
- return "[Circular]";
31
- }
32
- options.seen.push(error);
33
- const propertyContents = helpers.inspectList(properties.map((key) => [key, error[key]]), options, helpers.inspectProperty);
34
- return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
35
- }
36
- module.exports = inspectObject;
@@ -1,37 +0,0 @@
1
- import { truncate, inspectList, inspectProperty } from "./helpers.qwik.mjs";
2
- const errorKeys = [
3
- "stack",
4
- "line",
5
- "column",
6
- "name",
7
- "message",
8
- "fileName",
9
- "lineNumber",
10
- "columnNumber",
11
- "number",
12
- "description",
13
- "cause"
14
- ];
15
- function inspectObject(error, options) {
16
- const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1);
17
- const name = error.name;
18
- options.truncate -= name.length;
19
- let message = "";
20
- if (typeof error.message === "string") {
21
- message = truncate(error.message, options.truncate);
22
- } else {
23
- properties.unshift("message");
24
- }
25
- message = message ? `: ${message}` : "";
26
- options.truncate -= message.length + 5;
27
- options.seen = options.seen || [];
28
- if (options.seen.includes(error)) {
29
- return "[Circular]";
30
- }
31
- options.seen.push(error);
32
- const propertyContents = inspectList(properties.map((key) => [key, error[key]]), options, inspectProperty);
33
- return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
34
- }
35
- export {
36
- inspectObject as default
37
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- const helpers = require("./helpers.qwik.cjs");
3
- function inspectFunction(func, options) {
4
- const functionType = func[Symbol.toStringTag] || "Function";
5
- const name = func.name;
6
- if (!name) {
7
- return options.stylize(`[${functionType}]`, "special");
8
- }
9
- return options.stylize(`[${functionType} ${helpers.truncate(name, options.truncate - 11)}]`, "special");
10
- }
11
- module.exports = inspectFunction;
@@ -1,12 +0,0 @@
1
- import { truncate } from "./helpers.qwik.mjs";
2
- function inspectFunction(func, options) {
3
- const functionType = func[Symbol.toStringTag] || "Function";
4
- const name = func.name;
5
- if (!name) {
6
- return options.stylize(`[${functionType}]`, "special");
7
- }
8
- return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special");
9
- }
10
- export {
11
- inspectFunction as default
12
- };
@@ -1,160 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const ansiColors = {
4
- bold: ["1", "22"],
5
- dim: ["2", "22"],
6
- italic: ["3", "23"],
7
- underline: ["4", "24"],
8
- // 5 & 6 are blinking
9
- inverse: ["7", "27"],
10
- hidden: ["8", "28"],
11
- strike: ["9", "29"],
12
- // 10-20 are fonts
13
- // 21-29 are resets for 1-9
14
- black: ["30", "39"],
15
- red: ["31", "39"],
16
- green: ["32", "39"],
17
- yellow: ["33", "39"],
18
- blue: ["34", "39"],
19
- magenta: ["35", "39"],
20
- cyan: ["36", "39"],
21
- white: ["37", "39"],
22
- brightblack: ["30;1", "39"],
23
- brightred: ["31;1", "39"],
24
- brightgreen: ["32;1", "39"],
25
- brightyellow: ["33;1", "39"],
26
- brightblue: ["34;1", "39"],
27
- brightmagenta: ["35;1", "39"],
28
- brightcyan: ["36;1", "39"],
29
- brightwhite: ["37;1", "39"],
30
- grey: ["90", "39"]
31
- };
32
- const styles = {
33
- special: "cyan",
34
- number: "yellow",
35
- bigint: "yellow",
36
- boolean: "yellow",
37
- undefined: "grey",
38
- null: "bold",
39
- string: "green",
40
- symbol: "green",
41
- date: "magenta",
42
- regexp: "red"
43
- };
44
- const truncator = "…";
45
- function colorise(value, styleType) {
46
- const color = ansiColors[styles[styleType]] || ansiColors[styleType] || "";
47
- if (!color) {
48
- return String(value);
49
- }
50
- return `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`;
51
- }
52
- function normaliseOptions({
53
- showHidden = false,
54
- depth = 2,
55
- colors = false,
56
- customInspect = true,
57
- showProxy = false,
58
- maxArrayLength = Infinity,
59
- breakLength = Infinity,
60
- seen = [],
61
- // eslint-disable-next-line no-shadow
62
- truncate: truncate2 = Infinity,
63
- stylize = String
64
- } = {}, inspect) {
65
- const options = {
66
- showHidden: Boolean(showHidden),
67
- depth: Number(depth),
68
- colors: Boolean(colors),
69
- customInspect: Boolean(customInspect),
70
- showProxy: Boolean(showProxy),
71
- maxArrayLength: Number(maxArrayLength),
72
- breakLength: Number(breakLength),
73
- truncate: Number(truncate2),
74
- seen,
75
- inspect,
76
- stylize
77
- };
78
- if (options.colors) {
79
- options.stylize = colorise;
80
- }
81
- return options;
82
- }
83
- function isHighSurrogate(char) {
84
- return char >= "\uD800" && char <= "\uDBFF";
85
- }
86
- function truncate(string, length, tail = truncator) {
87
- string = String(string);
88
- const tailLength = tail.length;
89
- const stringLength = string.length;
90
- if (tailLength > length && stringLength > tailLength) {
91
- return tail;
92
- }
93
- if (stringLength > length && stringLength > tailLength) {
94
- let end = length - tailLength;
95
- if (end > 0 && isHighSurrogate(string[end - 1])) {
96
- end = end - 1;
97
- }
98
- return `${string.slice(0, end)}${tail}`;
99
- }
100
- return string;
101
- }
102
- function inspectList(list, options, inspectItem, separator = ", ") {
103
- inspectItem = inspectItem || options.inspect;
104
- const size = list.length;
105
- if (size === 0)
106
- return "";
107
- const originalLength = options.truncate;
108
- let output = "";
109
- let peek = "";
110
- let truncated = "";
111
- for (let i = 0; i < size; i += 1) {
112
- const last = i + 1 === list.length;
113
- const secondToLast = i + 2 === list.length;
114
- truncated = `${truncator}(${list.length - i})`;
115
- const value = list[i];
116
- options.truncate = originalLength - output.length - (last ? 0 : separator.length);
117
- const string = peek || inspectItem(value, options) + (last ? "" : separator);
118
- const nextLength = output.length + string.length;
119
- const truncatedLength = nextLength + truncated.length;
120
- if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) {
121
- break;
122
- }
123
- if (!last && !secondToLast && truncatedLength > originalLength) {
124
- break;
125
- }
126
- peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
127
- if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) {
128
- break;
129
- }
130
- output += string;
131
- if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
132
- truncated = `${truncator}(${list.length - i - 1})`;
133
- break;
134
- }
135
- truncated = "";
136
- }
137
- return `${output}${truncated}`;
138
- }
139
- function quoteComplexKey(key) {
140
- if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
141
- return key;
142
- }
143
- return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
144
- }
145
- function inspectProperty([key, value], options) {
146
- options.truncate -= 2;
147
- if (typeof key === "string") {
148
- key = quoteComplexKey(key);
149
- } else if (typeof key !== "number") {
150
- key = `[${options.inspect(key, options)}]`;
151
- }
152
- options.truncate -= key.length;
153
- value = options.inspect(value, options);
154
- return `${key}: ${value}`;
155
- }
156
- exports.inspectList = inspectList;
157
- exports.inspectProperty = inspectProperty;
158
- exports.normaliseOptions = normaliseOptions;
159
- exports.truncate = truncate;
160
- exports.truncator = truncator;
@@ -1,160 +0,0 @@
1
- const ansiColors = {
2
- bold: ["1", "22"],
3
- dim: ["2", "22"],
4
- italic: ["3", "23"],
5
- underline: ["4", "24"],
6
- // 5 & 6 are blinking
7
- inverse: ["7", "27"],
8
- hidden: ["8", "28"],
9
- strike: ["9", "29"],
10
- // 10-20 are fonts
11
- // 21-29 are resets for 1-9
12
- black: ["30", "39"],
13
- red: ["31", "39"],
14
- green: ["32", "39"],
15
- yellow: ["33", "39"],
16
- blue: ["34", "39"],
17
- magenta: ["35", "39"],
18
- cyan: ["36", "39"],
19
- white: ["37", "39"],
20
- brightblack: ["30;1", "39"],
21
- brightred: ["31;1", "39"],
22
- brightgreen: ["32;1", "39"],
23
- brightyellow: ["33;1", "39"],
24
- brightblue: ["34;1", "39"],
25
- brightmagenta: ["35;1", "39"],
26
- brightcyan: ["36;1", "39"],
27
- brightwhite: ["37;1", "39"],
28
- grey: ["90", "39"]
29
- };
30
- const styles = {
31
- special: "cyan",
32
- number: "yellow",
33
- bigint: "yellow",
34
- boolean: "yellow",
35
- undefined: "grey",
36
- null: "bold",
37
- string: "green",
38
- symbol: "green",
39
- date: "magenta",
40
- regexp: "red"
41
- };
42
- const truncator = "…";
43
- function colorise(value, styleType) {
44
- const color = ansiColors[styles[styleType]] || ansiColors[styleType] || "";
45
- if (!color) {
46
- return String(value);
47
- }
48
- return `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`;
49
- }
50
- function normaliseOptions({
51
- showHidden = false,
52
- depth = 2,
53
- colors = false,
54
- customInspect = true,
55
- showProxy = false,
56
- maxArrayLength = Infinity,
57
- breakLength = Infinity,
58
- seen = [],
59
- // eslint-disable-next-line no-shadow
60
- truncate: truncate2 = Infinity,
61
- stylize = String
62
- } = {}, inspect) {
63
- const options = {
64
- showHidden: Boolean(showHidden),
65
- depth: Number(depth),
66
- colors: Boolean(colors),
67
- customInspect: Boolean(customInspect),
68
- showProxy: Boolean(showProxy),
69
- maxArrayLength: Number(maxArrayLength),
70
- breakLength: Number(breakLength),
71
- truncate: Number(truncate2),
72
- seen,
73
- inspect,
74
- stylize
75
- };
76
- if (options.colors) {
77
- options.stylize = colorise;
78
- }
79
- return options;
80
- }
81
- function isHighSurrogate(char) {
82
- return char >= "\uD800" && char <= "\uDBFF";
83
- }
84
- function truncate(string, length, tail = truncator) {
85
- string = String(string);
86
- const tailLength = tail.length;
87
- const stringLength = string.length;
88
- if (tailLength > length && stringLength > tailLength) {
89
- return tail;
90
- }
91
- if (stringLength > length && stringLength > tailLength) {
92
- let end = length - tailLength;
93
- if (end > 0 && isHighSurrogate(string[end - 1])) {
94
- end = end - 1;
95
- }
96
- return `${string.slice(0, end)}${tail}`;
97
- }
98
- return string;
99
- }
100
- function inspectList(list, options, inspectItem, separator = ", ") {
101
- inspectItem = inspectItem || options.inspect;
102
- const size = list.length;
103
- if (size === 0)
104
- return "";
105
- const originalLength = options.truncate;
106
- let output = "";
107
- let peek = "";
108
- let truncated = "";
109
- for (let i = 0; i < size; i += 1) {
110
- const last = i + 1 === list.length;
111
- const secondToLast = i + 2 === list.length;
112
- truncated = `${truncator}(${list.length - i})`;
113
- const value = list[i];
114
- options.truncate = originalLength - output.length - (last ? 0 : separator.length);
115
- const string = peek || inspectItem(value, options) + (last ? "" : separator);
116
- const nextLength = output.length + string.length;
117
- const truncatedLength = nextLength + truncated.length;
118
- if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) {
119
- break;
120
- }
121
- if (!last && !secondToLast && truncatedLength > originalLength) {
122
- break;
123
- }
124
- peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
125
- if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) {
126
- break;
127
- }
128
- output += string;
129
- if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
130
- truncated = `${truncator}(${list.length - i - 1})`;
131
- break;
132
- }
133
- truncated = "";
134
- }
135
- return `${output}${truncated}`;
136
- }
137
- function quoteComplexKey(key) {
138
- if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
139
- return key;
140
- }
141
- return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
142
- }
143
- function inspectProperty([key, value], options) {
144
- options.truncate -= 2;
145
- if (typeof key === "string") {
146
- key = quoteComplexKey(key);
147
- } else if (typeof key !== "number") {
148
- key = `[${options.inspect(key, options)}]`;
149
- }
150
- options.truncate -= key.length;
151
- value = options.inspect(value, options);
152
- return `${key}: ${value}`;
153
- }
154
- export {
155
- inspectList,
156
- inspectProperty,
157
- normaliseOptions,
158
- truncate,
159
- truncator
160
- };
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const helpers = require("./helpers.qwik.cjs");
4
- function inspectAttribute([key, value], options) {
5
- options.truncate -= 3;
6
- if (!value) {
7
- return `${options.stylize(String(key), "yellow")}`;
8
- }
9
- return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
10
- }
11
- function inspectHTMLCollection(collection, options) {
12
- return helpers.inspectList(collection, options, inspectHTML, "\n");
13
- }
14
- function inspectHTML(element, options) {
15
- const properties = element.getAttributeNames();
16
- const name = element.tagName.toLowerCase();
17
- const head = options.stylize(`<${name}`, "special");
18
- const headClose = options.stylize(`>`, "special");
19
- const tail = options.stylize(`</${name}>`, "special");
20
- options.truncate -= name.length * 2 + 5;
21
- let propertyContents = "";
22
- if (properties.length > 0) {
23
- propertyContents += " ";
24
- propertyContents += helpers.inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " ");
25
- }
26
- options.truncate -= propertyContents.length;
27
- const truncate = options.truncate;
28
- let children = inspectHTMLCollection(element.children, options);
29
- if (children && children.length > truncate) {
30
- children = `${helpers.truncator}(${element.children.length})`;
31
- }
32
- return `${head}${propertyContents}${headClose}${children}${tail}`;
33
- }
34
- exports.default = inspectHTML;
35
- exports.inspectAttribute = inspectAttribute;
36
- exports.inspectHTMLCollection = inspectHTMLCollection;
@@ -1,36 +0,0 @@
1
- import { inspectList, truncator } from "./helpers.qwik.mjs";
2
- function inspectAttribute([key, value], options) {
3
- options.truncate -= 3;
4
- if (!value) {
5
- return `${options.stylize(String(key), "yellow")}`;
6
- }
7
- return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
8
- }
9
- function inspectHTMLCollection(collection, options) {
10
- return inspectList(collection, options, inspectHTML, "\n");
11
- }
12
- function inspectHTML(element, options) {
13
- const properties = element.getAttributeNames();
14
- const name = element.tagName.toLowerCase();
15
- const head = options.stylize(`<${name}`, "special");
16
- const headClose = options.stylize(`>`, "special");
17
- const tail = options.stylize(`</${name}>`, "special");
18
- options.truncate -= name.length * 2 + 5;
19
- let propertyContents = "";
20
- if (properties.length > 0) {
21
- propertyContents += " ";
22
- propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " ");
23
- }
24
- options.truncate -= propertyContents.length;
25
- const truncate = options.truncate;
26
- let children = inspectHTMLCollection(element.children, options);
27
- if (children && children.length > truncate) {
28
- children = `${truncator}(${element.children.length})`;
29
- }
30
- return `${head}${propertyContents}${headClose}${children}${tail}`;
31
- }
32
- export {
33
- inspectHTML as default,
34
- inspectAttribute,
35
- inspectHTMLCollection
36
- };