@fluixi/devtools 1.0.0-alpha.108 → 1.0.0-alpha.109

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 (65) hide show
  1. package/dist/callsite.mjs +4 -63
  2. package/dist/change-view.mjs +6 -106
  3. package/dist/chunk-2VDMQ3VF.mjs +520 -0
  4. package/dist/chunk-33U2S43X.mjs +121 -0
  5. package/dist/chunk-4P45Y5EB.mjs +214 -0
  6. package/dist/chunk-B3SAJ7QG.mjs +72 -0
  7. package/dist/chunk-CPZWLBCQ.mjs +35 -0
  8. package/dist/chunk-D25KZZBZ.mjs +212 -0
  9. package/dist/chunk-EBSROPWJ.mjs +314 -0
  10. package/dist/chunk-F664XLZL.mjs +743 -0
  11. package/dist/chunk-FY5K3QVT.mjs +35 -0
  12. package/dist/chunk-G7Z7CVP5.mjs +184 -0
  13. package/dist/chunk-GDQXCOQB.mjs +43 -0
  14. package/dist/chunk-L6XQGNMW.mjs +106 -0
  15. package/dist/chunk-MN6O673L.mjs +90 -0
  16. package/dist/chunk-NDUBBBNL.mjs +70 -0
  17. package/dist/chunk-NT7YMK77.mjs +157 -0
  18. package/dist/chunk-NVULLJDH.mjs +120 -0
  19. package/dist/chunk-NWLSDERQ.mjs +68 -0
  20. package/dist/chunk-OPIGF5XB.mjs +184 -0
  21. package/dist/chunk-P5I7DWFX.mjs +292 -0
  22. package/dist/chunk-PKARAAIS.mjs +75 -0
  23. package/dist/chunk-PSSBFXBD.mjs +155 -0
  24. package/dist/chunk-PTQ5VCYE.mjs +103 -0
  25. package/dist/chunk-PU4MJ5RU.mjs +107 -0
  26. package/dist/chunk-UAEJ3N7F.mjs +76 -0
  27. package/dist/chunk-V6DKWEYD.mjs +67 -0
  28. package/dist/chunk-VO2V7AC5.mjs +80 -0
  29. package/dist/chunk-WGQH7RUW.mjs +25 -0
  30. package/dist/chunk-Y5OQWBAM.mjs +777 -0
  31. package/dist/chunk-Z6KYHEKY.mjs +64 -0
  32. package/dist/copy.mjs +3 -39
  33. package/dist/describe.mjs +3 -31
  34. package/dist/detail-panel.mjs +6 -280
  35. package/dist/diff.mjs +4 -201
  36. package/dist/dom.mjs +7 -176
  37. package/dist/export.mjs +6 -207
  38. package/dist/float.mjs +5 -206
  39. package/dist/format.mjs +5 -151
  40. package/dist/graph-view.mjs +9 -875
  41. package/dist/highlight.mjs +6 -113
  42. package/dist/history.mjs +4 -70
  43. package/dist/hook.mjs +16 -1719
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.mjs +106 -4673
  46. package/dist/inspector.mjs +11 -677
  47. package/dist/instrument.mjs +9 -486
  48. package/dist/kind-filter.mjs +6 -148
  49. package/dist/menu.mjs +4 -116
  50. package/dist/observe.mjs +14 -1510
  51. package/dist/palette.mjs +6 -28
  52. package/dist/path.mjs +3 -21
  53. package/dist/plugin.mjs +9 -57
  54. package/dist/plugins/context.mjs +6 -71
  55. package/dist/plugins/directives.mjs +8 -68
  56. package/dist/plugins/index.cjs +1 -1
  57. package/dist/plugins/index.mjs +13 -136
  58. package/dist/source.mjs +12 -93
  59. package/dist/timeline.mjs +7 -323
  60. package/dist/tree.mjs +11 -558
  61. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  62. package/dist/value-pane.mjs +6 -196
  63. package/dist/wire.cjs +1 -1
  64. package/dist/wire.mjs +6 -86
  65. package/package.json +3 -3
package/dist/format.mjs CHANGED
@@ -1,154 +1,8 @@
1
- // src/format.ts
2
- var MAX_DEPTH = 3;
3
- var MAX_ENTRIES = 8;
4
- function domName(v) {
5
- if (typeof v?.nodeType !== "number" || typeof v.nodeName !== "string") return null;
6
- return v.tagName ? `<${v.tagName.toLowerCase()}>` : `#${v.nodeName.toLowerCase()}`;
7
- }
8
- function fnName(v) {
9
- return v.name ? `ƒ ${v.name}()` : "ƒ";
10
- }
11
- function className(v) {
12
- const name = v.constructor?.name;
13
- return name && name !== "Object" ? `${name} ` : "";
14
- }
15
- function primitive(v) {
16
- if (v === null) return "null";
17
- switch (typeof v) {
18
- case "undefined":
19
- return "undefined";
20
- case "string":
21
- return JSON.stringify(v);
22
- case "number":
23
- case "boolean":
24
- return String(v);
25
- case "bigint":
26
- return `${v}n`;
27
- case "symbol":
28
- return v.toString();
29
- case "function":
30
- return fnName(v);
31
- default:
32
- return null;
33
- }
34
- }
35
- function walk(value, depth, seen) {
36
- const simple = primitive(value);
37
- if (simple !== null) return simple;
38
- const object = value;
39
- if (seen.has(object)) return "[circular]";
40
- const dom = domName(object);
41
- if (dom) return dom;
42
- if (object instanceof Date) return Number.isNaN(object.getTime()) ? "Invalid Date" : object.toISOString();
43
- if (object instanceof RegExp) return String(object);
44
- if (object instanceof Error) return `${object.name}: ${object.message}`;
45
- if (object instanceof Promise) return "Promise";
46
- if (ArrayBuffer.isView(object)) {
47
- return `${className(object).trim()}(${object.length ?? ""})`;
48
- }
49
- if (depth >= MAX_DEPTH) return Array.isArray(object) ? "[…]" : "{…}";
50
- seen.add(object);
51
- try {
52
- if (Array.isArray(object)) {
53
- const shown2 = object.slice(0, MAX_ENTRIES).map((item) => walk(item, depth + 1, seen));
54
- if (object.length > MAX_ENTRIES) shown2.push("…");
55
- return `[${shown2.join(", ")}]`;
56
- }
57
- if (object instanceof Map) {
58
- const shown2 = [];
59
- for (const [k, v] of object) {
60
- if (shown2.length === MAX_ENTRIES) {
61
- shown2.push("…");
62
- break;
63
- }
64
- shown2.push(`${walk(k, depth + 1, seen)} => ${walk(v, depth + 1, seen)}`);
65
- }
66
- return `Map(${object.size}) {${shown2.join(", ")}}`;
67
- }
68
- if (object instanceof Set) {
69
- const shown2 = [];
70
- for (const item of object) {
71
- if (shown2.length === MAX_ENTRIES) {
72
- shown2.push("…");
73
- break;
74
- }
75
- shown2.push(walk(item, depth + 1, seen));
76
- }
77
- return `Set(${object.size}) {${shown2.join(", ")}}`;
78
- }
79
- const keys = Object.keys(object);
80
- const shown = keys.slice(0, MAX_ENTRIES).map((key) => {
81
- let read;
82
- try {
83
- const descriptor = Object.getOwnPropertyDescriptor(object, key);
84
- if (descriptor?.get) return `${key}: [getter]`;
85
- read = walk(object[key], depth + 1, seen);
86
- } catch {
87
- read = "[unreadable]";
88
- }
89
- return `${key}: ${read}`;
90
- });
91
- if (keys.length > MAX_ENTRIES) shown.push("…");
92
- return `${className(object)}{${shown.join(", ")}}`;
93
- } finally {
94
- seen.delete(object);
95
- }
96
- }
97
- function formatValue(value, limit = 240) {
98
- let text;
99
- try {
100
- text = walk(value, 0, /* @__PURE__ */ new Set());
101
- } catch {
102
- text = "[unreadable]";
103
- }
104
- return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
105
- }
106
- function shorten(text, limit = 18) {
107
- return text.length > limit ? `${text.slice(0, limit - 1)}…` : text;
108
- }
109
- function indentValue(text, pad = " ") {
110
- const out = [];
111
- let depth = 0;
112
- let quote = null;
113
- let line = "";
114
- const flush = () => {
115
- if (line.trim()) out.push(pad.repeat(depth) + line.trim());
116
- line = "";
117
- };
118
- for (let i = 0; i < text.length; i++) {
119
- const c = text[i];
120
- if (quote) {
121
- line += c;
122
- if (c === quote && text[i - 1] !== "\\") quote = null;
123
- continue;
124
- }
125
- if (c === '"' || c === "'") {
126
- quote = c;
127
- line += c;
128
- continue;
129
- }
130
- if (c === "{" || c === "[") {
131
- line += c;
132
- flush();
133
- depth++;
134
- continue;
135
- }
136
- if (c === "}" || c === "]") {
137
- flush();
138
- depth = Math.max(0, depth - 1);
139
- line = c;
140
- continue;
141
- }
142
- if (c === ",") {
143
- line += c;
144
- flush();
145
- continue;
146
- }
147
- line += c;
148
- }
149
- flush();
150
- return out.join("\n");
151
- }
1
+ import {
2
+ formatValue,
3
+ indentValue,
4
+ shorten
5
+ } from "./chunk-NT7YMK77.mjs";
152
6
  export {
153
7
  formatValue,
154
8
  indentValue,