@noma.to/qwik-testing-library 1.0.4 → 1.1.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.
Files changed (100) hide show
  1. package/README.md +61 -0
  2. package/lib/_virtual/_commonjsHelpers.qwik.cjs +2 -0
  3. package/lib/_virtual/_commonjsHelpers.qwik.mjs +2 -0
  4. package/lib/_virtual/sourcemap-codec.umd.qwik.cjs +4 -0
  5. package/lib/_virtual/sourcemap-codec.umd.qwik.mjs +4 -0
  6. package/lib/index.qwik.cjs +4 -0
  7. package/lib/index.qwik.mjs +4 -0
  8. package/lib/lib/mock.qwik.cjs +14 -0
  9. package/lib/lib/mock.qwik.mjs +14 -0
  10. package/lib/lib/qwik-testing-library.qwik.cjs +4 -0
  11. package/lib/lib/qwik-testing-library.qwik.mjs +4 -0
  12. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.cjs +425 -0
  13. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.mjs +425 -0
  14. package/lib/node_modules/.pnpm/@vitest_expect@2.1.1/node_modules/@vitest/expect/dist/index.qwik.cjs +1967 -0
  15. package/lib/node_modules/.pnpm/@vitest_expect@2.1.1/node_modules/@vitest/expect/dist/index.qwik.mjs +1967 -0
  16. package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.1/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +1202 -0
  17. package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.1/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +1202 -0
  18. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +44 -0
  19. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +44 -0
  20. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/index.qwik.cjs +665 -0
  21. package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/index.qwik.mjs +665 -0
  22. package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.1/node_modules/@vitest/snapshot/dist/index.qwik.cjs +1641 -0
  23. package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.1/node_modules/@vitest/snapshot/dist/index.qwik.mjs +1641 -0
  24. package/lib/node_modules/.pnpm/@vitest_spy@2.1.1/node_modules/@vitest/spy/dist/index.qwik.cjs +148 -0
  25. package/lib/node_modules/.pnpm/@vitest_spy@2.1.1/node_modules/@vitest/spy/dist/index.qwik.mjs +148 -0
  26. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.cjs +158 -0
  27. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.mjs +158 -0
  28. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/diff.qwik.cjs +1731 -0
  29. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/diff.qwik.mjs +1731 -0
  30. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/error.qwik.cjs +137 -0
  31. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/error.qwik.mjs +137 -0
  32. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/helpers.qwik.cjs +150 -0
  33. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/helpers.qwik.mjs +150 -0
  34. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.cjs +81 -0
  35. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.mjs +81 -0
  36. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/source-map.qwik.cjs +216 -0
  37. package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/source-map.qwik.mjs +216 -0
  38. package/lib/node_modules/.pnpm/chai@5.1.1/node_modules/chai/chai.qwik.cjs +3905 -0
  39. package/lib/node_modules/.pnpm/chai@5.1.1/node_modules/chai/chai.qwik.mjs +3905 -0
  40. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/arguments.qwik.cjs +9 -0
  41. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/arguments.qwik.mjs +10 -0
  42. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/array.qwik.cjs +16 -0
  43. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/array.qwik.mjs +17 -0
  44. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/bigint.qwik.cjs +9 -0
  45. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/bigint.qwik.mjs +10 -0
  46. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/class.qwik.cjs +16 -0
  47. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/class.qwik.mjs +17 -0
  48. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/date.qwik.cjs +12 -0
  49. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/date.qwik.mjs +13 -0
  50. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/error.qwik.cjs +30 -0
  51. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/error.qwik.mjs +31 -0
  52. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/function.qwik.cjs +11 -0
  53. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/function.qwik.mjs +12 -0
  54. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/helpers.qwik.cjs +160 -0
  55. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/helpers.qwik.mjs +160 -0
  56. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/html.qwik.cjs +36 -0
  57. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/html.qwik.mjs +36 -0
  58. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/index.qwik.cjs +130 -0
  59. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/index.qwik.mjs +130 -0
  60. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/map.qwik.cjs +25 -0
  61. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/map.qwik.mjs +26 -0
  62. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/number.qwik.cjs +19 -0
  63. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/number.qwik.mjs +20 -0
  64. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/object.qwik.cjs +24 -0
  65. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/object.qwik.mjs +25 -0
  66. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/promise.qwik.cjs +17 -0
  67. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/promise.qwik.mjs +18 -0
  68. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/regexp.qwik.cjs +9 -0
  69. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/regexp.qwik.mjs +10 -0
  70. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/set.qwik.cjs +16 -0
  71. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/set.qwik.mjs +17 -0
  72. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/string.qwik.cjs +24 -0
  73. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/string.qwik.mjs +25 -0
  74. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/symbol.qwik.cjs +8 -0
  75. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/symbol.qwik.mjs +9 -0
  76. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/typedarray.qwik.cjs +34 -0
  77. package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/typedarray.qwik.mjs +35 -0
  78. package/lib/node_modules/.pnpm/magic-string@0.30.11/node_modules/magic-string/dist/magic-string.es.qwik.cjs +968 -0
  79. package/lib/node_modules/.pnpm/magic-string@0.30.11/node_modules/magic-string/dist/magic-string.es.qwik.mjs +968 -0
  80. package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs +101 -0
  81. package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs +101 -0
  82. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +7 -0
  83. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +8 -0
  84. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +80 -0
  85. package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +80 -0
  86. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +104 -0
  87. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +104 -0
  88. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +8 -0
  89. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +8 -0
  90. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/base.BlXpj3e_.qwik.cjs +6 -0
  91. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/base.BlXpj3e_.qwik.mjs +6 -0
  92. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +56 -0
  93. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +56 -0
  94. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/utils.Ck2hJTRs.qwik.cjs +16 -0
  95. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/utils.Ck2hJTRs.qwik.mjs +16 -0
  96. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/vi.D6IHiKAI.qwik.cjs +2556 -0
  97. package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/vi.D6IHiKAI.qwik.mjs +2556 -0
  98. package/lib-types/lib/mock.d.ts +34 -0
  99. package/lib-types/lib/qwik-testing-library.d.ts +2 -1
  100. package/package.json +5 -4
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const array = require("./array.qwik.cjs");
4
+ const typedarray = require("./typedarray.qwik.cjs");
5
+ const date = require("./date.qwik.cjs");
6
+ const _function = require("./function.qwik.cjs");
7
+ const map = require("./map.qwik.cjs");
8
+ const number = require("./number.qwik.cjs");
9
+ const bigint = require("./bigint.qwik.cjs");
10
+ const regexp = require("./regexp.qwik.cjs");
11
+ const set = require("./set.qwik.cjs");
12
+ const string = require("./string.qwik.cjs");
13
+ const symbol = require("./symbol.qwik.cjs");
14
+ const promise = require("./promise.qwik.cjs");
15
+ const _class = require("./class.qwik.cjs");
16
+ const object = require("./object.qwik.cjs");
17
+ const _arguments = require("./arguments.qwik.cjs");
18
+ const error = require("./error.qwik.cjs");
19
+ const html = require("./html.qwik.cjs");
20
+ const helpers = require("./helpers.qwik.cjs");
21
+ const symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function";
22
+ const chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect";
23
+ let nodeInspect = false;
24
+ try {
25
+ const nodeUtil = require("util");
26
+ nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
27
+ } catch (noNodeInspect) {
28
+ nodeInspect = false;
29
+ }
30
+ const constructorMap = /* @__PURE__ */ new WeakMap();
31
+ const stringTagMap = {};
32
+ const baseTypesMap = {
33
+ undefined: (value, options) => options.stylize("undefined", "undefined"),
34
+ null: (value, options) => options.stylize("null", "null"),
35
+ boolean: (value, options) => options.stylize(String(value), "boolean"),
36
+ Boolean: (value, options) => options.stylize(String(value), "boolean"),
37
+ number,
38
+ Number: number,
39
+ bigint,
40
+ BigInt: bigint,
41
+ string,
42
+ String: string,
43
+ function: _function,
44
+ Function: _function,
45
+ symbol,
46
+ // A Symbol polyfill will return `Symbol` not `symbol` from typedetect
47
+ Symbol: symbol,
48
+ Array: array,
49
+ Date: date,
50
+ Map: map,
51
+ Set: set,
52
+ RegExp: regexp,
53
+ Promise: promise,
54
+ // WeakSet, WeakMap are totally opaque to us
55
+ WeakSet: (value, options) => options.stylize("WeakSet{…}", "special"),
56
+ WeakMap: (value, options) => options.stylize("WeakMap{…}", "special"),
57
+ Arguments: _arguments,
58
+ Int8Array: typedarray,
59
+ Uint8Array: typedarray,
60
+ Uint8ClampedArray: typedarray,
61
+ Int16Array: typedarray,
62
+ Uint16Array: typedarray,
63
+ Int32Array: typedarray,
64
+ Uint32Array: typedarray,
65
+ Float32Array: typedarray,
66
+ Float64Array: typedarray,
67
+ Generator: () => "",
68
+ DataView: () => "",
69
+ ArrayBuffer: () => "",
70
+ Error: error,
71
+ HTMLCollection: html.inspectHTMLCollection,
72
+ NodeList: html.inspectHTMLCollection
73
+ };
74
+ const inspectCustom = (value, options, type) => {
75
+ if (chaiInspect in value && typeof value[chaiInspect] === "function") {
76
+ return value[chaiInspect](options);
77
+ }
78
+ if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === "function") {
79
+ return value[nodeInspect](options.depth, options);
80
+ }
81
+ if ("inspect" in value && typeof value.inspect === "function") {
82
+ return value.inspect(options.depth, options);
83
+ }
84
+ if ("constructor" in value && constructorMap.has(value.constructor)) {
85
+ return constructorMap.get(value.constructor)(value, options);
86
+ }
87
+ if (stringTagMap[type]) {
88
+ return stringTagMap[type](value, options);
89
+ }
90
+ return "";
91
+ };
92
+ const toString = Object.prototype.toString;
93
+ function inspect(value, opts = {}) {
94
+ const options = helpers.normaliseOptions(opts, inspect);
95
+ const { customInspect } = options;
96
+ let type = value === null ? "null" : typeof value;
97
+ if (type === "object") {
98
+ type = toString.call(value).slice(8, -1);
99
+ }
100
+ if (type in baseTypesMap) {
101
+ return baseTypesMap[type](value, options);
102
+ }
103
+ if (customInspect && value) {
104
+ const output = inspectCustom(value, options, type);
105
+ if (output) {
106
+ if (typeof output === "string")
107
+ return output;
108
+ return inspect(output, options);
109
+ }
110
+ }
111
+ const proto = value ? Object.getPrototypeOf(value) : false;
112
+ if (proto === Object.prototype || proto === null) {
113
+ return object(value, options);
114
+ }
115
+ if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) {
116
+ return html.default(value, options);
117
+ }
118
+ if ("constructor" in value) {
119
+ if (value.constructor !== Object) {
120
+ return _class(value, options);
121
+ }
122
+ return object(value, options);
123
+ }
124
+ if (value === Object(value)) {
125
+ return object(value, options);
126
+ }
127
+ return options.stylize(String(value), type);
128
+ }
129
+ exports.default = inspect;
130
+ exports.inspect = inspect;
@@ -0,0 +1,130 @@
1
+ import inspectArray from "./array.qwik.mjs";
2
+ import inspectTypedArray from "./typedarray.qwik.mjs";
3
+ import inspectDate from "./date.qwik.mjs";
4
+ import inspectFunction from "./function.qwik.mjs";
5
+ import inspectMap from "./map.qwik.mjs";
6
+ import inspectNumber from "./number.qwik.mjs";
7
+ import inspectBigInt from "./bigint.qwik.mjs";
8
+ import inspectRegExp from "./regexp.qwik.mjs";
9
+ import inspectSet from "./set.qwik.mjs";
10
+ import inspectString from "./string.qwik.mjs";
11
+ import inspectSymbol from "./symbol.qwik.mjs";
12
+ import inspectPromise from "./promise.qwik.mjs";
13
+ import inspectClass from "./class.qwik.mjs";
14
+ import inspectObject from "./object.qwik.mjs";
15
+ import inspectArguments from "./arguments.qwik.mjs";
16
+ import inspectObject$1 from "./error.qwik.mjs";
17
+ import inspectHTML, { inspectHTMLCollection } from "./html.qwik.mjs";
18
+ import { normaliseOptions } from "./helpers.qwik.mjs";
19
+ const symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function";
20
+ const chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect";
21
+ let nodeInspect = false;
22
+ try {
23
+ const nodeUtil = require("util");
24
+ nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
25
+ } catch (noNodeInspect) {
26
+ nodeInspect = false;
27
+ }
28
+ const constructorMap = /* @__PURE__ */ new WeakMap();
29
+ const stringTagMap = {};
30
+ const baseTypesMap = {
31
+ undefined: (value, options) => options.stylize("undefined", "undefined"),
32
+ null: (value, options) => options.stylize("null", "null"),
33
+ boolean: (value, options) => options.stylize(String(value), "boolean"),
34
+ Boolean: (value, options) => options.stylize(String(value), "boolean"),
35
+ number: inspectNumber,
36
+ Number: inspectNumber,
37
+ bigint: inspectBigInt,
38
+ BigInt: inspectBigInt,
39
+ string: inspectString,
40
+ String: inspectString,
41
+ function: inspectFunction,
42
+ Function: inspectFunction,
43
+ symbol: inspectSymbol,
44
+ // A Symbol polyfill will return `Symbol` not `symbol` from typedetect
45
+ Symbol: inspectSymbol,
46
+ Array: inspectArray,
47
+ Date: inspectDate,
48
+ Map: inspectMap,
49
+ Set: inspectSet,
50
+ RegExp: inspectRegExp,
51
+ Promise: inspectPromise,
52
+ // WeakSet, WeakMap are totally opaque to us
53
+ WeakSet: (value, options) => options.stylize("WeakSet{…}", "special"),
54
+ WeakMap: (value, options) => options.stylize("WeakMap{…}", "special"),
55
+ Arguments: inspectArguments,
56
+ Int8Array: inspectTypedArray,
57
+ Uint8Array: inspectTypedArray,
58
+ Uint8ClampedArray: inspectTypedArray,
59
+ Int16Array: inspectTypedArray,
60
+ Uint16Array: inspectTypedArray,
61
+ Int32Array: inspectTypedArray,
62
+ Uint32Array: inspectTypedArray,
63
+ Float32Array: inspectTypedArray,
64
+ Float64Array: inspectTypedArray,
65
+ Generator: () => "",
66
+ DataView: () => "",
67
+ ArrayBuffer: () => "",
68
+ Error: inspectObject$1,
69
+ HTMLCollection: inspectHTMLCollection,
70
+ NodeList: inspectHTMLCollection
71
+ };
72
+ const inspectCustom = (value, options, type) => {
73
+ if (chaiInspect in value && typeof value[chaiInspect] === "function") {
74
+ return value[chaiInspect](options);
75
+ }
76
+ if (nodeInspect && nodeInspect in value && typeof value[nodeInspect] === "function") {
77
+ return value[nodeInspect](options.depth, options);
78
+ }
79
+ if ("inspect" in value && typeof value.inspect === "function") {
80
+ return value.inspect(options.depth, options);
81
+ }
82
+ if ("constructor" in value && constructorMap.has(value.constructor)) {
83
+ return constructorMap.get(value.constructor)(value, options);
84
+ }
85
+ if (stringTagMap[type]) {
86
+ return stringTagMap[type](value, options);
87
+ }
88
+ return "";
89
+ };
90
+ const toString = Object.prototype.toString;
91
+ function inspect(value, opts = {}) {
92
+ const options = normaliseOptions(opts, inspect);
93
+ const { customInspect } = options;
94
+ let type = value === null ? "null" : typeof value;
95
+ if (type === "object") {
96
+ type = toString.call(value).slice(8, -1);
97
+ }
98
+ if (type in baseTypesMap) {
99
+ return baseTypesMap[type](value, options);
100
+ }
101
+ if (customInspect && value) {
102
+ const output = inspectCustom(value, options, type);
103
+ if (output) {
104
+ if (typeof output === "string")
105
+ return output;
106
+ return inspect(output, options);
107
+ }
108
+ }
109
+ const proto = value ? Object.getPrototypeOf(value) : false;
110
+ if (proto === Object.prototype || proto === null) {
111
+ return inspectObject(value, options);
112
+ }
113
+ if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) {
114
+ return inspectHTML(value, options);
115
+ }
116
+ if ("constructor" in value) {
117
+ if (value.constructor !== Object) {
118
+ return inspectClass(value, options);
119
+ }
120
+ return inspectObject(value, options);
121
+ }
122
+ if (value === Object(value)) {
123
+ return inspectObject(value, options);
124
+ }
125
+ return options.stylize(String(value), type);
126
+ }
127
+ export {
128
+ inspect as default,
129
+ inspect
130
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ const helpers = require("./helpers.qwik.cjs");
3
+ function inspectMapEntry([key, value], options) {
4
+ options.truncate -= 4;
5
+ key = options.inspect(key, options);
6
+ options.truncate -= key.length;
7
+ value = options.inspect(value, options);
8
+ return `${key} => ${value}`;
9
+ }
10
+ function mapToEntries(map) {
11
+ const entries = [];
12
+ map.forEach((value, key) => {
13
+ entries.push([key, value]);
14
+ });
15
+ return entries;
16
+ }
17
+ function inspectMap(map, options) {
18
+ const size = map.size - 1;
19
+ if (size <= 0) {
20
+ return "Map{}";
21
+ }
22
+ options.truncate -= 7;
23
+ return `Map{ ${helpers.inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
24
+ }
25
+ module.exports = inspectMap;
@@ -0,0 +1,26 @@
1
+ import { inspectList } from "./helpers.qwik.mjs";
2
+ function inspectMapEntry([key, value], options) {
3
+ options.truncate -= 4;
4
+ key = options.inspect(key, options);
5
+ options.truncate -= key.length;
6
+ value = options.inspect(value, options);
7
+ return `${key} => ${value}`;
8
+ }
9
+ function mapToEntries(map) {
10
+ const entries = [];
11
+ map.forEach((value, key) => {
12
+ entries.push([key, value]);
13
+ });
14
+ return entries;
15
+ }
16
+ function inspectMap(map, options) {
17
+ const size = map.size - 1;
18
+ if (size <= 0) {
19
+ return "Map{}";
20
+ }
21
+ options.truncate -= 7;
22
+ return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
23
+ }
24
+ export {
25
+ inspectMap as default
26
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ const helpers = require("./helpers.qwik.cjs");
3
+ const isNaN = Number.isNaN || ((i) => i !== i);
4
+ function inspectNumber(number, options) {
5
+ if (isNaN(number)) {
6
+ return options.stylize("NaN", "number");
7
+ }
8
+ if (number === Infinity) {
9
+ return options.stylize("Infinity", "number");
10
+ }
11
+ if (number === -Infinity) {
12
+ return options.stylize("-Infinity", "number");
13
+ }
14
+ if (number === 0) {
15
+ return options.stylize(1 / number === Infinity ? "+0" : "-0", "number");
16
+ }
17
+ return options.stylize(helpers.truncate(String(number), options.truncate), "number");
18
+ }
19
+ module.exports = inspectNumber;
@@ -0,0 +1,20 @@
1
+ import { truncate } from "./helpers.qwik.mjs";
2
+ const isNaN = Number.isNaN || ((i) => i !== i);
3
+ function inspectNumber(number, options) {
4
+ if (isNaN(number)) {
5
+ return options.stylize("NaN", "number");
6
+ }
7
+ if (number === Infinity) {
8
+ return options.stylize("Infinity", "number");
9
+ }
10
+ if (number === -Infinity) {
11
+ return options.stylize("-Infinity", "number");
12
+ }
13
+ if (number === 0) {
14
+ return options.stylize(1 / number === Infinity ? "+0" : "-0", "number");
15
+ }
16
+ return options.stylize(truncate(String(number), options.truncate), "number");
17
+ }
18
+ export {
19
+ inspectNumber as default
20
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ const helpers = require("./helpers.qwik.cjs");
3
+ function inspectObject(object, options) {
4
+ const properties = Object.getOwnPropertyNames(object);
5
+ const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
6
+ if (properties.length === 0 && symbols.length === 0) {
7
+ return "{}";
8
+ }
9
+ options.truncate -= 4;
10
+ options.seen = options.seen || [];
11
+ if (options.seen.indexOf(object) >= 0) {
12
+ return "[Circular]";
13
+ }
14
+ options.seen.push(object);
15
+ const propertyContents = helpers.inspectList(properties.map((key) => [key, object[key]]), options, helpers.inspectProperty);
16
+ const symbolContents = helpers.inspectList(symbols.map((key) => [key, object[key]]), options, helpers.inspectProperty);
17
+ options.seen.pop();
18
+ let sep = "";
19
+ if (propertyContents && symbolContents) {
20
+ sep = ", ";
21
+ }
22
+ return `{ ${propertyContents}${sep}${symbolContents} }`;
23
+ }
24
+ module.exports = inspectObject;
@@ -0,0 +1,25 @@
1
+ import { inspectList, inspectProperty } from "./helpers.qwik.mjs";
2
+ function inspectObject(object, options) {
3
+ const properties = Object.getOwnPropertyNames(object);
4
+ const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
5
+ if (properties.length === 0 && symbols.length === 0) {
6
+ return "{}";
7
+ }
8
+ options.truncate -= 4;
9
+ options.seen = options.seen || [];
10
+ if (options.seen.indexOf(object) >= 0) {
11
+ return "[Circular]";
12
+ }
13
+ options.seen.push(object);
14
+ const propertyContents = inspectList(properties.map((key) => [key, object[key]]), options, inspectProperty);
15
+ const symbolContents = inspectList(symbols.map((key) => [key, object[key]]), options, inspectProperty);
16
+ options.seen.pop();
17
+ let sep = "";
18
+ if (propertyContents && symbolContents) {
19
+ sep = ", ";
20
+ }
21
+ return `{ ${propertyContents}${sep}${symbolContents} }`;
22
+ }
23
+ export {
24
+ inspectObject as default
25
+ };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ let getPromiseValue = () => "Promise{…}";
3
+ try {
4
+ const { getPromiseDetails, kPending, kRejected } = process.binding("util");
5
+ if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
6
+ getPromiseValue = (value, options) => {
7
+ const [state, innerValue] = getPromiseDetails(value);
8
+ if (state === kPending) {
9
+ return "Promise{<pending>}";
10
+ }
11
+ return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
12
+ };
13
+ }
14
+ } catch (notNode) {
15
+ }
16
+ const inspectPromise = getPromiseValue;
17
+ module.exports = inspectPromise;
@@ -0,0 +1,18 @@
1
+ let getPromiseValue = () => "Promise{…}";
2
+ try {
3
+ const { getPromiseDetails, kPending, kRejected } = process.binding("util");
4
+ if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
5
+ getPromiseValue = (value, options) => {
6
+ const [state, innerValue] = getPromiseDetails(value);
7
+ if (state === kPending) {
8
+ return "Promise{<pending>}";
9
+ }
10
+ return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
11
+ };
12
+ }
13
+ } catch (notNode) {
14
+ }
15
+ const inspectPromise = getPromiseValue;
16
+ export {
17
+ inspectPromise as default
18
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ const helpers = require("./helpers.qwik.cjs");
3
+ function inspectRegExp(value, options) {
4
+ const flags = value.toString().split("/")[2];
5
+ const sourceLength = options.truncate - (2 + flags.length);
6
+ const source = value.source;
7
+ return options.stylize(`/${helpers.truncate(source, sourceLength)}/${flags}`, "regexp");
8
+ }
9
+ module.exports = inspectRegExp;
@@ -0,0 +1,10 @@
1
+ import { truncate } from "./helpers.qwik.mjs";
2
+ function inspectRegExp(value, options) {
3
+ const flags = value.toString().split("/")[2];
4
+ const sourceLength = options.truncate - (2 + flags.length);
5
+ const source = value.source;
6
+ return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp");
7
+ }
8
+ export {
9
+ inspectRegExp as default
10
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ const helpers = require("./helpers.qwik.cjs");
3
+ function arrayFromSet(set) {
4
+ const values = [];
5
+ set.forEach((value) => {
6
+ values.push(value);
7
+ });
8
+ return values;
9
+ }
10
+ function inspectSet(set, options) {
11
+ if (set.size === 0)
12
+ return "Set{}";
13
+ options.truncate -= 7;
14
+ return `Set{ ${helpers.inspectList(arrayFromSet(set), options)} }`;
15
+ }
16
+ module.exports = inspectSet;
@@ -0,0 +1,17 @@
1
+ import { inspectList } from "./helpers.qwik.mjs";
2
+ function arrayFromSet(set) {
3
+ const values = [];
4
+ set.forEach((value) => {
5
+ values.push(value);
6
+ });
7
+ return values;
8
+ }
9
+ function inspectSet(set, options) {
10
+ if (set.size === 0)
11
+ return "Set{}";
12
+ options.truncate -= 7;
13
+ return `Set{ ${inspectList(arrayFromSet(set), options)} }`;
14
+ }
15
+ export {
16
+ inspectSet as default
17
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ const helpers = require("./helpers.qwik.cjs");
3
+ const stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
4
+ const escapeCharacters = {
5
+ "\b": "\\b",
6
+ " ": "\\t",
7
+ "\n": "\\n",
8
+ "\f": "\\f",
9
+ "\r": "\\r",
10
+ "'": "\\'",
11
+ "\\": "\\\\"
12
+ };
13
+ const hex = 16;
14
+ const unicodeLength = 4;
15
+ function escape(char) {
16
+ return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`;
17
+ }
18
+ function inspectString(string, options) {
19
+ if (stringEscapeChars.test(string)) {
20
+ string = string.replace(stringEscapeChars, escape);
21
+ }
22
+ return options.stylize(`'${helpers.truncate(string, options.truncate - 2)}'`, "string");
23
+ }
24
+ module.exports = inspectString;
@@ -0,0 +1,25 @@
1
+ import { truncate } from "./helpers.qwik.mjs";
2
+ const stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
3
+ const escapeCharacters = {
4
+ "\b": "\\b",
5
+ " ": "\\t",
6
+ "\n": "\\n",
7
+ "\f": "\\f",
8
+ "\r": "\\r",
9
+ "'": "\\'",
10
+ "\\": "\\\\"
11
+ };
12
+ const hex = 16;
13
+ const unicodeLength = 4;
14
+ function escape(char) {
15
+ return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`;
16
+ }
17
+ function inspectString(string, options) {
18
+ if (stringEscapeChars.test(string)) {
19
+ string = string.replace(stringEscapeChars, escape);
20
+ }
21
+ return options.stylize(`'${truncate(string, options.truncate - 2)}'`, "string");
22
+ }
23
+ export {
24
+ inspectString as default
25
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ function inspectSymbol(value) {
3
+ if ("description" in Symbol.prototype) {
4
+ return value.description ? `Symbol(${value.description})` : "Symbol()";
5
+ }
6
+ return value.toString();
7
+ }
8
+ module.exports = inspectSymbol;
@@ -0,0 +1,9 @@
1
+ function inspectSymbol(value) {
2
+ if ("description" in Symbol.prototype) {
3
+ return value.description ? `Symbol(${value.description})` : "Symbol()";
4
+ }
5
+ return value.toString();
6
+ }
7
+ export {
8
+ inspectSymbol as default
9
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ const helpers = require("./helpers.qwik.cjs");
3
+ const getArrayName = (array) => {
4
+ if (typeof Buffer === "function" && array instanceof Buffer) {
5
+ return "Buffer";
6
+ }
7
+ if (array[Symbol.toStringTag]) {
8
+ return array[Symbol.toStringTag];
9
+ }
10
+ return array.constructor.name;
11
+ };
12
+ function inspectTypedArray(array, options) {
13
+ const name = getArrayName(array);
14
+ options.truncate -= name.length + 4;
15
+ const nonIndexProperties = Object.keys(array).slice(array.length);
16
+ if (!array.length && !nonIndexProperties.length)
17
+ return `${name}[]`;
18
+ let output = "";
19
+ for (let i = 0; i < array.length; i++) {
20
+ const string = `${options.stylize(helpers.truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
21
+ options.truncate -= string.length;
22
+ if (array[i] !== array.length && options.truncate <= 3) {
23
+ output += `${helpers.truncator}(${array.length - array[i] + 1})`;
24
+ break;
25
+ }
26
+ output += string;
27
+ }
28
+ let propertyContents = "";
29
+ if (nonIndexProperties.length) {
30
+ propertyContents = helpers.inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, helpers.inspectProperty);
31
+ }
32
+ return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
33
+ }
34
+ module.exports = inspectTypedArray;
@@ -0,0 +1,35 @@
1
+ import { truncate, truncator, inspectList, inspectProperty } from "./helpers.qwik.mjs";
2
+ const getArrayName = (array) => {
3
+ if (typeof Buffer === "function" && array instanceof Buffer) {
4
+ return "Buffer";
5
+ }
6
+ if (array[Symbol.toStringTag]) {
7
+ return array[Symbol.toStringTag];
8
+ }
9
+ return array.constructor.name;
10
+ };
11
+ function inspectTypedArray(array, options) {
12
+ const name = getArrayName(array);
13
+ options.truncate -= name.length + 4;
14
+ const nonIndexProperties = Object.keys(array).slice(array.length);
15
+ if (!array.length && !nonIndexProperties.length)
16
+ return `${name}[]`;
17
+ let output = "";
18
+ for (let i = 0; i < array.length; i++) {
19
+ const string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
20
+ options.truncate -= string.length;
21
+ if (array[i] !== array.length && options.truncate <= 3) {
22
+ output += `${truncator}(${array.length - array[i] + 1})`;
23
+ break;
24
+ }
25
+ output += string;
26
+ }
27
+ let propertyContents = "";
28
+ if (nonIndexProperties.length) {
29
+ propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
30
+ }
31
+ return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
32
+ }
33
+ export {
34
+ inspectTypedArray as default
35
+ };