jsonc-morph 0.3.0 → 0.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 (82) hide show
  1. package/README.md +12 -14
  2. package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts.map +1 -0
  3. package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts.map +1 -0
  4. package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts.map +1 -0
  5. package/{script/deps/jsr.io/@std/assert/1.0.16 → esm/deps/jsr.io/@std/assert/1.0.19}/assertion_error.d.ts.map +1 -1
  6. package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts.map +1 -0
  8. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/exists.d.ts.map +1 -1
  9. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/fail.d.ts.map +1 -1
  10. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/false.d.ts.map +1 -1
  11. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/greater.d.ts.map +1 -1
  12. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/greater_or_equal.d.ts.map +1 -1
  13. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/instance_of.d.ts.map +1 -1
  14. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/is_error.d.ts.map +1 -1
  15. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/less.d.ts.map +1 -1
  16. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/less_or_equal.d.ts.map +1 -1
  17. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/match.d.ts.map +1 -1
  18. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/mod.d.ts.map +1 -1
  19. package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts.map +1 -0
  20. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/not_instance_of.d.ts.map +1 -1
  21. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/not_match.d.ts.map +1 -1
  22. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/not_strict_equals.d.ts.map +1 -1
  23. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/object_match.d.ts.map +1 -1
  24. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/rejects.d.ts.map +1 -1
  25. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/strict_equals.d.ts.map +1 -1
  26. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/string_includes.d.ts.map +1 -1
  27. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/throws.d.ts.map +1 -1
  28. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/unimplemented.d.ts.map +1 -1
  29. package/esm/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/unreachable.d.ts.map +1 -1
  30. package/esm/lib/rs_lib.internal.d.ts +934 -950
  31. package/esm/lib/rs_lib.internal.d.ts.map +1 -1
  32. package/esm/lib/rs_lib.internal.js +1865 -1842
  33. package/esm/lib/rs_lib.js +3889 -3583
  34. package/esm/mod.d.ts +9 -21
  35. package/esm/mod.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/script/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts.map +1 -0
  38. package/script/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts.map +1 -0
  39. package/script/deps/jsr.io/@std/assert/1.0.19/assert.d.ts.map +1 -0
  40. package/{esm/deps/jsr.io/@std/assert/1.0.16 → script/deps/jsr.io/@std/assert/1.0.19}/assertion_error.d.ts.map +1 -1
  41. package/script/deps/jsr.io/@std/assert/1.0.19/equal.d.ts.map +1 -0
  42. package/script/deps/jsr.io/@std/assert/1.0.19/equals.d.ts.map +1 -0
  43. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/exists.d.ts.map +1 -1
  44. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/fail.d.ts.map +1 -1
  45. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/false.d.ts.map +1 -1
  46. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/greater.d.ts.map +1 -1
  47. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/greater_or_equal.d.ts.map +1 -1
  48. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/instance_of.d.ts.map +1 -1
  49. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/is_error.d.ts.map +1 -1
  50. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/less.d.ts.map +1 -1
  51. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/less_or_equal.d.ts.map +1 -1
  52. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/match.d.ts.map +1 -1
  53. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/mod.d.ts.map +1 -1
  54. package/script/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts.map +1 -0
  55. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/not_instance_of.d.ts.map +1 -1
  56. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/not_match.d.ts.map +1 -1
  57. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/not_strict_equals.d.ts.map +1 -1
  58. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/object_match.d.ts.map +1 -1
  59. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/rejects.d.ts.map +1 -1
  60. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/strict_equals.d.ts.map +1 -1
  61. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/string_includes.d.ts.map +1 -1
  62. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/throws.d.ts.map +1 -1
  63. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/unimplemented.d.ts.map +1 -1
  64. package/script/deps/jsr.io/@std/assert/{1.0.16 → 1.0.19}/unreachable.d.ts.map +1 -1
  65. package/script/lib/rs_lib.internal.d.ts +934 -950
  66. package/script/lib/rs_lib.internal.d.ts.map +1 -1
  67. package/script/lib/rs_lib.internal.js +1904 -1881
  68. package/script/lib/rs_lib.js +3889 -3583
  69. package/script/mod.d.ts +9 -21
  70. package/script/mod.d.ts.map +1 -1
  71. package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +0 -1
  72. package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +0 -1
  73. package/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +0 -1
  75. package/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +0 -1
  76. package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +0 -1
  77. package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +0 -1
  78. package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +0 -1
  79. package/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +0 -1
  80. package/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +0 -1
  81. package/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +0 -1
  82. package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +0 -1
@@ -6,118 +6,11 @@ let wasm;
6
6
  export function __wbg_set_wasm(val) {
7
7
  wasm = val;
8
8
  }
9
- let cachedUint8ArrayMemory0 = null;
10
- function getUint8ArrayMemory0() {
11
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
12
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
13
- }
14
- return cachedUint8ArrayMemory0;
15
- }
16
- const lTextDecoder = typeof TextDecoder === "undefined"
17
- ? (0, module.require)("util").TextDecoder
18
- : TextDecoder;
19
- let cachedTextDecoder = new lTextDecoder("utf-8", {
20
- ignoreBOM: true,
21
- fatal: true,
22
- });
23
- cachedTextDecoder.decode();
24
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
25
- let numBytesDecoded = 0;
26
- function decodeText(ptr, len) {
27
- numBytesDecoded += len;
28
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
29
- cachedTextDecoder = new lTextDecoder("utf-8", {
30
- ignoreBOM: true,
31
- fatal: true,
32
- });
33
- cachedTextDecoder.decode();
34
- numBytesDecoded = len;
35
- }
36
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
37
- }
38
- function getStringFromWasm0(ptr, len) {
39
- ptr = ptr >>> 0;
40
- return decodeText(ptr, len);
41
- }
42
- let WASM_VECTOR_LEN = 0;
43
- const lTextEncoder = typeof TextEncoder === "undefined"
44
- ? (0, module.require)("util").TextEncoder
45
- : TextEncoder;
46
- const cachedTextEncoder = new lTextEncoder("utf-8");
47
- const encodeString = typeof cachedTextEncoder.encodeInto === "function"
48
- ? function (arg, view) {
49
- return cachedTextEncoder.encodeInto(arg, view);
50
- }
51
- : function (arg, view) {
52
- const buf = cachedTextEncoder.encode(arg);
53
- view.set(buf);
54
- return {
55
- read: arg.length,
56
- written: buf.length,
57
- };
58
- };
59
- function passStringToWasm0(arg, malloc, realloc) {
60
- if (realloc === undefined) {
61
- const buf = cachedTextEncoder.encode(arg);
62
- const ptr = malloc(buf.length, 1) >>> 0;
63
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
64
- WASM_VECTOR_LEN = buf.length;
65
- return ptr;
66
- }
67
- let len = arg.length;
68
- let ptr = malloc(len, 1) >>> 0;
69
- const mem = getUint8ArrayMemory0();
70
- let offset = 0;
71
- for (; offset < len; offset++) {
72
- const code = arg.charCodeAt(offset);
73
- if (code > 0x7F)
74
- break;
75
- mem[ptr + offset] = code;
76
- }
77
- if (offset !== len) {
78
- if (offset !== 0) {
79
- arg = arg.slice(offset);
80
- }
81
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
82
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
83
- const ret = encodeString(arg, view);
84
- offset += ret.written;
85
- ptr = realloc(ptr, len, offset, 1) >>> 0;
86
- }
87
- WASM_VECTOR_LEN = offset;
88
- return ptr;
89
- }
90
- let cachedDataViewMemory0 = null;
91
- function getDataViewMemory0() {
92
- if (cachedDataViewMemory0 === null ||
93
- cachedDataViewMemory0.buffer.detached === true ||
94
- (cachedDataViewMemory0.buffer.detached === undefined &&
95
- cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
96
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
97
- }
98
- return cachedDataViewMemory0;
99
- }
100
9
  function addToExternrefTable0(obj) {
101
10
  const idx = wasm.__externref_table_alloc();
102
- wasm.__wbindgen_export_4.set(idx, obj);
11
+ wasm.__wbindgen_externrefs.set(idx, obj);
103
12
  return idx;
104
13
  }
105
- function handleError(f, args) {
106
- try {
107
- return f.apply(this, args);
108
- }
109
- catch (e) {
110
- const idx = addToExternrefTable0(e);
111
- wasm.__wbindgen_exn_store(idx);
112
- }
113
- }
114
- function getArrayU8FromWasm0(ptr, len) {
115
- ptr = ptr >>> 0;
116
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
117
- }
118
- function isLikeNone(x) {
119
- return x === undefined || x === null;
120
- }
121
14
  function debugString(val) {
122
15
  // primitive types
123
16
  const type = typeof val;
@@ -186,141 +79,174 @@ function debugString(val) {
186
79
  // TODO we could test for more things here, like `Set`s and `Map`s.
187
80
  return className;
188
81
  }
189
- function takeFromExternrefTable0(idx) {
190
- const value = wasm.__wbindgen_export_4.get(idx);
191
- wasm.__externref_table_dealloc(idx);
192
- return value;
193
- }
194
- /**
195
- * Parses a JSONC (JSON with Comments) string into a concrete syntax tree.
196
- * @param text - The JSONC text to parse
197
- * @param options - Optional parsing options
198
- * @returns The root node of the parsed CST
199
- * @param {string} text
200
- * @param {{ allowComments?: boolean; allowTrailingCommas?: boolean; allowLooseObjectPropertyNames?: boolean; allowMissingCommas?: boolean; allowSingleQuotedStrings?: boolean; allowHexadecimalNumbers?: boolean; allowUnaryPlusNumbers?: boolean; } | null} [options]
201
- * @returns {RootNode}
202
- */
203
- export function parse(text, options) {
204
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
205
- const len0 = WASM_VECTOR_LEN;
206
- const ret = wasm.parse(ptr0, len0, isLikeNone(options) ? 0 : addToExternrefTable0(options));
207
- if (ret[2]) {
208
- throw takeFromExternrefTable0(ret[1]);
209
- }
210
- return RootNode.__wrap(ret[0]);
211
- }
212
- /**
213
- * Parses a JSONC (JSON with Comments) string directly to a JavaScript object.
214
- * @param text - The JSONC text to parse
215
- * @param options - Optional parsing options
216
- * @returns The plain JavaScript value (object, array, string, number, boolean, or null)
217
- * @throws If the text cannot be parsed or converted
218
- * @param {string} text
219
- * @param {{ allowComments?: boolean; allowTrailingCommas?: boolean; allowLooseObjectPropertyNames?: boolean; allowMissingCommas?: boolean; allowSingleQuotedStrings?: boolean; allowHexadecimalNumbers?: boolean; allowUnaryPlusNumbers?: boolean; } | null} [options]
220
- * @returns {any}
221
- */
222
- export function parseToValue(text, options) {
223
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
224
- const len0 = WASM_VECTOR_LEN;
225
- const ret = wasm.parseToValue(ptr0, len0, isLikeNone(options) ? 0 : addToExternrefTable0(options));
226
- if (ret[2]) {
227
- throw takeFromExternrefTable0(ret[1]);
228
- }
229
- return takeFromExternrefTable0(ret[0]);
230
- }
231
82
  function getArrayJsValueFromWasm0(ptr, len) {
232
83
  ptr = ptr >>> 0;
233
84
  const mem = getDataViewMemory0();
234
85
  const result = [];
235
86
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
236
- result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
87
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
237
88
  }
238
89
  wasm.__externref_drop_slice(ptr, len);
239
90
  return result;
240
91
  }
241
- const BooleanLitFinalization = (typeof FinalizationRegistry === "undefined")
242
- ? { register: () => { }, unregister: () => { } }
243
- : new FinalizationRegistry((ptr) => wasm.__wbg_booleanlit_free(ptr >>> 0, 1));
244
- /**
245
- * Represents a boolean literal node in the CST.
246
- * Provides methods for manipulating boolean values.
247
- */
248
- export class BooleanLit {
249
- static __wrap(ptr) {
250
- ptr = ptr >>> 0;
251
- const obj = Object.create(BooleanLit.prototype);
252
- obj.__wbg_ptr = ptr;
253
- BooleanLitFinalization.register(obj, obj.__wbg_ptr, obj);
254
- return obj;
255
- }
256
- __destroy_into_raw() {
257
- const ptr = this.__wbg_ptr;
258
- this.__wbg_ptr = 0;
259
- BooleanLitFinalization.unregister(this);
260
- return ptr;
92
+ function getArrayU8FromWasm0(ptr, len) {
93
+ ptr = ptr >>> 0;
94
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
95
+ }
96
+ let cachedDataViewMemory0 = null;
97
+ function getDataViewMemory0() {
98
+ if (cachedDataViewMemory0 === null ||
99
+ cachedDataViewMemory0.buffer.detached === true ||
100
+ (cachedDataViewMemory0.buffer.detached === undefined &&
101
+ cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
102
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
261
103
  }
262
- free() {
263
- const ptr = this.__destroy_into_raw();
264
- wasm.__wbg_booleanlit_free(ptr, 0);
104
+ return cachedDataViewMemory0;
105
+ }
106
+ function getStringFromWasm0(ptr, len) {
107
+ ptr = ptr >>> 0;
108
+ return decodeText(ptr, len);
109
+ }
110
+ let cachedUint8ArrayMemory0 = null;
111
+ function getUint8ArrayMemory0() {
112
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
113
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
265
114
  }
266
- /**
267
- * Returns the boolean value (true or false).
268
- * @returns The boolean value
269
- * @returns {boolean}
270
- */
271
- value() {
272
- const ret = wasm.booleanlit_value(this.__wbg_ptr);
273
- return ret !== 0;
115
+ return cachedUint8ArrayMemory0;
116
+ }
117
+ function handleError(f, args) {
118
+ try {
119
+ return f.apply(this, args);
274
120
  }
275
- /**
276
- * Sets the boolean value.
277
- * @param value - The new boolean value (true or false)
278
- * @param {boolean} value
279
- */
280
- setValue(value) {
281
- wasm.booleanlit_setValue(this.__wbg_ptr, value);
121
+ catch (e) {
122
+ const idx = addToExternrefTable0(e);
123
+ wasm.__wbindgen_exn_store(idx);
282
124
  }
283
- /**
284
- * Replaces this boolean literal with a new value.
285
- * @param replacement - The new value to replace this boolean with
286
- * @returns The new node that replaced this one, or undefined if this was the root value
287
- * @param {any} replacement
288
- * @returns {Node | undefined}
289
- */
290
- replaceWith(replacement) {
291
- const ret = wasm.booleanlit_replaceWith(this.__wbg_ptr, replacement);
292
- if (ret[2]) {
293
- throw takeFromExternrefTable0(ret[1]);
294
- }
295
- return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
125
+ }
126
+ function isLikeNone(x) {
127
+ return x === undefined || x === null;
128
+ }
129
+ function passStringToWasm0(arg, malloc, realloc) {
130
+ if (realloc === undefined) {
131
+ const buf = cachedTextEncoder.encode(arg);
132
+ const ptr = malloc(buf.length, 1) >>> 0;
133
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
134
+ WASM_VECTOR_LEN = buf.length;
135
+ return ptr;
296
136
  }
297
- /**
298
- * Removes this node from its parent.
299
- * After calling this method, the node is detached from the CST and can no longer be used.
300
- */
301
- remove() {
302
- const ptr = this.__destroy_into_raw();
303
- wasm.booleanlit_remove(ptr);
137
+ let len = arg.length;
138
+ let ptr = malloc(len, 1) >>> 0;
139
+ const mem = getUint8ArrayMemory0();
140
+ let offset = 0;
141
+ for (; offset < len; offset++) {
142
+ const code = arg.charCodeAt(offset);
143
+ if (code > 0x7F)
144
+ break;
145
+ mem[ptr + offset] = code;
304
146
  }
305
- /**
306
- * Returns the parent node in the CST.
307
- * @returns The parent node, or undefined if this is the root
308
- * @returns {Node | undefined}
309
- */
310
- parent() {
311
- const ret = wasm.booleanlit_parent(this.__wbg_ptr);
312
- return ret === 0 ? undefined : Node.__wrap(ret);
147
+ if (offset !== len) {
148
+ if (offset !== 0) {
149
+ arg = arg.slice(offset);
150
+ }
151
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
152
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
153
+ const ret = cachedTextEncoder.encodeInto(arg, view);
154
+ offset += ret.written;
155
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
313
156
  }
314
- /**
315
- * Returns all ancestor nodes from parent to root.
316
- * @returns Array of ancestor nodes
317
- * @returns {Node[]}
318
- */
319
- ancestors() {
320
- const ret = wasm.booleanlit_ancestors(this.__wbg_ptr);
321
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
322
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
323
- return v1;
157
+ WASM_VECTOR_LEN = offset;
158
+ return ptr;
159
+ }
160
+ function takeFromExternrefTable0(idx) {
161
+ const value = wasm.__wbindgen_externrefs.get(idx);
162
+ wasm.__externref_table_dealloc(idx);
163
+ return value;
164
+ }
165
+ let cachedTextDecoder = new TextDecoder("utf-8", {
166
+ ignoreBOM: true,
167
+ fatal: true,
168
+ });
169
+ cachedTextDecoder.decode();
170
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
171
+ let numBytesDecoded = 0;
172
+ function decodeText(ptr, len) {
173
+ numBytesDecoded += len;
174
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
175
+ cachedTextDecoder = new TextDecoder("utf-8", {
176
+ ignoreBOM: true,
177
+ fatal: true,
178
+ });
179
+ cachedTextDecoder.decode();
180
+ numBytesDecoded = len;
181
+ }
182
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
183
+ }
184
+ const cachedTextEncoder = new TextEncoder();
185
+ if (!("encodeInto" in cachedTextEncoder)) {
186
+ cachedTextEncoder.encodeInto = function (arg, view) {
187
+ const buf = cachedTextEncoder.encode(arg);
188
+ view.set(buf);
189
+ return {
190
+ read: arg.length,
191
+ written: buf.length,
192
+ };
193
+ };
194
+ }
195
+ let WASM_VECTOR_LEN = 0;
196
+ const BooleanLitFinalization = (typeof FinalizationRegistry === "undefined")
197
+ ? { register: () => { }, unregister: () => { } }
198
+ : new FinalizationRegistry((ptr) => wasm.__wbg_booleanlit_free(ptr >>> 0, 1));
199
+ const JsonArrayFinalization = (typeof FinalizationRegistry === "undefined")
200
+ ? { register: () => { }, unregister: () => { } }
201
+ : new FinalizationRegistry((ptr) => wasm.__wbg_jsonarray_free(ptr >>> 0, 1));
202
+ const JsonObjectFinalization = (typeof FinalizationRegistry === "undefined")
203
+ ? { register: () => { }, unregister: () => { } }
204
+ : new FinalizationRegistry((ptr) => wasm.__wbg_jsonobject_free(ptr >>> 0, 1));
205
+ const NodeFinalization = (typeof FinalizationRegistry === "undefined")
206
+ ? { register: () => { }, unregister: () => { } }
207
+ : new FinalizationRegistry((ptr) => wasm.__wbg_node_free(ptr >>> 0, 1));
208
+ const NullKeywordFinalization = (typeof FinalizationRegistry === "undefined")
209
+ ? { register: () => { }, unregister: () => { } }
210
+ : new FinalizationRegistry((ptr) => wasm.__wbg_nullkeyword_free(ptr >>> 0, 1));
211
+ const NumberLitFinalization = (typeof FinalizationRegistry === "undefined")
212
+ ? { register: () => { }, unregister: () => { } }
213
+ : new FinalizationRegistry((ptr) => wasm.__wbg_numberlit_free(ptr >>> 0, 1));
214
+ const ObjectPropFinalization = (typeof FinalizationRegistry === "undefined")
215
+ ? { register: () => { }, unregister: () => { } }
216
+ : new FinalizationRegistry((ptr) => wasm.__wbg_objectprop_free(ptr >>> 0, 1));
217
+ const ObjectPropNameFinalization = (typeof FinalizationRegistry === "undefined")
218
+ ? { register: () => { }, unregister: () => { } }
219
+ : new FinalizationRegistry((ptr) => wasm.__wbg_objectpropname_free(ptr >>> 0, 1));
220
+ const RootNodeFinalization = (typeof FinalizationRegistry === "undefined")
221
+ ? { register: () => { }, unregister: () => { } }
222
+ : new FinalizationRegistry((ptr) => wasm.__wbg_rootnode_free(ptr >>> 0, 1));
223
+ const StringLitFinalization = (typeof FinalizationRegistry === "undefined")
224
+ ? { register: () => { }, unregister: () => { } }
225
+ : new FinalizationRegistry((ptr) => wasm.__wbg_stringlit_free(ptr >>> 0, 1));
226
+ const WordLitFinalization = (typeof FinalizationRegistry === "undefined")
227
+ ? { register: () => { }, unregister: () => { } }
228
+ : new FinalizationRegistry((ptr) => wasm.__wbg_wordlit_free(ptr >>> 0, 1));
229
+ /**
230
+ * Represents a boolean literal node in the CST.
231
+ * Provides methods for manipulating boolean values.
232
+ */
233
+ export class BooleanLit {
234
+ static __wrap(ptr) {
235
+ ptr = ptr >>> 0;
236
+ const obj = Object.create(BooleanLit.prototype);
237
+ obj.__wbg_ptr = ptr;
238
+ BooleanLitFinalization.register(obj, obj.__wbg_ptr, obj);
239
+ return obj;
240
+ }
241
+ __destroy_into_raw() {
242
+ const ptr = this.__wbg_ptr;
243
+ this.__wbg_ptr = 0;
244
+ BooleanLitFinalization.unregister(this);
245
+ return ptr;
246
+ }
247
+ free() {
248
+ const ptr = this.__destroy_into_raw();
249
+ wasm.__wbg_booleanlit_free(ptr, 0);
324
250
  }
325
251
  /**
326
252
  * Returns the index of this node within its parent's children.
@@ -331,6 +257,54 @@ export class BooleanLit {
331
257
  const ret = wasm.booleanlit_childIndex(this.__wbg_ptr);
332
258
  return ret >>> 0;
333
259
  }
260
+ /**
261
+ * Returns the indentation string used at this node's depth.
262
+ * @returns The indentation string, or undefined if not applicable
263
+ * @returns {string | undefined}
264
+ */
265
+ indentText() {
266
+ const ret = wasm.booleanlit_indentText(this.__wbg_ptr);
267
+ let v1;
268
+ if (ret[0] !== 0) {
269
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
270
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
271
+ }
272
+ return v1;
273
+ }
274
+ /**
275
+ * Returns the next sibling node.
276
+ * @returns The next sibling, or undefined if this is the last child
277
+ * @returns {Node | undefined}
278
+ */
279
+ nextSibling() {
280
+ const ret = wasm.booleanlit_nextSibling(this.__wbg_ptr);
281
+ return ret === 0 ? undefined : Node.__wrap(ret);
282
+ }
283
+ /**
284
+ * Replaces this boolean literal with a new value.
285
+ * @param replacement - The new value to replace this boolean with
286
+ * @returns The new node that replaced this one, or undefined if this was the root value
287
+ * @param {any} replacement
288
+ * @returns {Node | undefined}
289
+ */
290
+ replaceWith(replacement) {
291
+ const ret = wasm.booleanlit_replaceWith(this.__wbg_ptr, replacement);
292
+ if (ret[2]) {
293
+ throw takeFromExternrefTable0(ret[1]);
294
+ }
295
+ return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
296
+ }
297
+ /**
298
+ * Returns all next sibling nodes.
299
+ * @returns Array of next siblings
300
+ * @returns {Node[]}
301
+ */
302
+ nextSiblings() {
303
+ const ret = wasm.booleanlit_nextSiblings(this.__wbg_ptr);
304
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
305
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
306
+ return v1;
307
+ }
334
308
  /**
335
309
  * Returns the previous sibling node.
336
310
  * @returns The previous sibling, or undefined if this is the first child
@@ -352,21 +326,47 @@ export class BooleanLit {
352
326
  return v1;
353
327
  }
354
328
  /**
355
- * Returns the next sibling node.
356
- * @returns The next sibling, or undefined if this is the last child
329
+ * Returns whether this node's container uses trailing commas.
330
+ * @returns true if trailing commas are used
331
+ * @returns {boolean}
332
+ */
333
+ usesTrailingCommas() {
334
+ const ret = wasm.booleanlit_usesTrailingCommas(this.__wbg_ptr);
335
+ return ret !== 0;
336
+ }
337
+ /**
338
+ * Returns the boolean value (true or false).
339
+ * @returns The boolean value
340
+ * @returns {boolean}
341
+ */
342
+ value() {
343
+ const ret = wasm.booleanlit_value(this.__wbg_ptr);
344
+ return ret !== 0;
345
+ }
346
+ /**
347
+ * Returns the parent node in the CST.
348
+ * @returns The parent node, or undefined if this is the root
357
349
  * @returns {Node | undefined}
358
350
  */
359
- nextSibling() {
360
- const ret = wasm.booleanlit_nextSibling(this.__wbg_ptr);
351
+ parent() {
352
+ const ret = wasm.booleanlit_parent(this.__wbg_ptr);
361
353
  return ret === 0 ? undefined : Node.__wrap(ret);
362
354
  }
363
355
  /**
364
- * Returns all next sibling nodes.
365
- * @returns Array of next siblings
356
+ * Removes this node from its parent.
357
+ * After calling this method, the node is detached from the CST and can no longer be used.
358
+ */
359
+ remove() {
360
+ const ptr = this.__destroy_into_raw();
361
+ wasm.booleanlit_remove(ptr);
362
+ }
363
+ /**
364
+ * Returns all ancestor nodes from parent to root.
365
+ * @returns Array of ancestor nodes
366
366
  * @returns {Node[]}
367
367
  */
368
- nextSiblings() {
369
- const ret = wasm.booleanlit_nextSiblings(this.__wbg_ptr);
368
+ ancestors() {
369
+ const ret = wasm.booleanlit_ancestors(this.__wbg_ptr);
370
370
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
371
371
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
372
372
  return v1;
@@ -381,32 +381,17 @@ export class BooleanLit {
381
381
  return ret === 0 ? undefined : RootNode.__wrap(ret);
382
382
  }
383
383
  /**
384
- * Returns the indentation string used at this node's depth.
385
- * @returns The indentation string, or undefined if not applicable
386
- * @returns {string | undefined}
387
- */
388
- indentText() {
389
- const ret = wasm.booleanlit_indentText(this.__wbg_ptr);
390
- let v1;
391
- if (ret[0] !== 0) {
392
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
393
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
394
- }
395
- return v1;
396
- }
397
- /**
398
- * Returns whether this node's container uses trailing commas.
399
- * @returns true if trailing commas are used
400
- * @returns {boolean}
384
+ * Sets the boolean value.
385
+ * @param value - The new boolean value (true or false)
386
+ * @param {boolean} value
401
387
  */
402
- usesTrailingCommas() {
403
- const ret = wasm.booleanlit_usesTrailingCommas(this.__wbg_ptr);
404
- return ret !== 0;
388
+ setValue(value) {
389
+ wasm.booleanlit_setValue(this.__wbg_ptr, value);
405
390
  }
406
391
  }
407
- const JsonArrayFinalization = (typeof FinalizationRegistry === "undefined")
408
- ? { register: () => { }, unregister: () => { } }
409
- : new FinalizationRegistry((ptr) => wasm.__wbg_jsonarray_free(ptr >>> 0, 1));
392
+ if (Symbol.dispose) {
393
+ BooleanLit.prototype[Symbol.dispose] = BooleanLit.prototype.free;
394
+ }
410
395
  /**
411
396
  * Represents a JSON array node in the CST.
412
397
  * Provides methods for manipulating array elements.
@@ -430,37 +415,124 @@ export class JsonArray {
430
415
  wasm.__wbg_jsonarray_free(ptr, 0);
431
416
  }
432
417
  /**
433
- * Returns all element nodes in the array.
434
- * @returns Array of element nodes
435
- * @returns {Node[]}
418
+ * Returns the index of this node within its parent's children.
419
+ * @returns The child index
420
+ * @returns {number}
436
421
  */
437
- elements() {
438
- const ret = wasm.jsonarray_elements(this.__wbg_ptr);
439
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
440
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
441
- return v1;
422
+ childIndex() {
423
+ const ret = wasm.jsonarray_childIndex(this.__wbg_ptr);
424
+ return ret >>> 0;
442
425
  }
443
426
  /**
444
- * Removes this array from its parent.
445
- * After calling this method, the array is detached from the CST and can no longer be used.
427
+ * Returns the indentation string used at this node's depth.
428
+ * @returns The indentation string, or undefined if not applicable
429
+ * @returns {string | undefined}
446
430
  */
447
- remove() {
448
- const ptr = this.__destroy_into_raw();
449
- wasm.jsonarray_remove(ptr);
431
+ indentText() {
432
+ const ret = wasm.jsonarray_indentText(this.__wbg_ptr);
433
+ let v1;
434
+ if (ret[0] !== 0) {
435
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
436
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
437
+ }
438
+ return v1;
450
439
  }
451
440
  /**
452
- * Ensures the array is formatted with each element on its own line.
441
+ * Returns the next sibling node.
442
+ * @returns The next sibling, or undefined if this is the last child
443
+ * @returns {Node | undefined}
453
444
  */
454
- ensureMultiline() {
455
- wasm.jsonarray_ensureMultiline(this.__wbg_ptr);
445
+ nextSibling() {
446
+ const ret = wasm.jsonarray_nextSibling(this.__wbg_ptr);
447
+ return ret === 0 ? undefined : Node.__wrap(ret);
456
448
  }
457
449
  /**
458
- * Returns all child nodes including whitespace and punctuation.
459
- * @returns Array of all child nodes
460
- * @returns {Node[]}
450
+ * Replaces this array with a new value.
451
+ * @param value - The new value to replace this array with
452
+ * @returns The new node that replaced this one, or undefined if this was the root value
453
+ * @param {any} value
454
+ * @returns {Node | undefined}
461
455
  */
462
- children() {
463
- const ret = wasm.jsonarray_children(this.__wbg_ptr);
456
+ replaceWith(value) {
457
+ const ret = wasm.jsonarray_replaceWith(this.__wbg_ptr, value);
458
+ if (ret[2]) {
459
+ throw takeFromExternrefTable0(ret[1]);
460
+ }
461
+ return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
462
+ }
463
+ /**
464
+ * Returns all next sibling nodes.
465
+ * @returns Array of next siblings
466
+ * @returns {Node[]}
467
+ */
468
+ nextSiblings() {
469
+ const ret = wasm.jsonarray_nextSiblings(this.__wbg_ptr);
470
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
471
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
472
+ return v1;
473
+ }
474
+ /**
475
+ * Returns the child node at the specified index.
476
+ * @param index - The child index
477
+ * @returns The child node, or undefined if index is out of bounds
478
+ * @param {number} index
479
+ * @returns {Node | undefined}
480
+ */
481
+ childAtIndex(index) {
482
+ const ret = wasm.jsonarray_childAtIndex(this.__wbg_ptr, index);
483
+ return ret === 0 ? undefined : Node.__wrap(ret);
484
+ }
485
+ /**
486
+ * Ensures the array is formatted with each element on its own line.
487
+ */
488
+ ensureMultiline() {
489
+ wasm.jsonarray_ensureMultiline(this.__wbg_ptr);
490
+ }
491
+ /**
492
+ * Returns the previous sibling node.
493
+ * @returns The previous sibling, or undefined if this is the first child
494
+ * @returns {Node | undefined}
495
+ */
496
+ previousSibling() {
497
+ const ret = wasm.jsonarray_previousSibling(this.__wbg_ptr);
498
+ return ret === 0 ? undefined : Node.__wrap(ret);
499
+ }
500
+ /**
501
+ * Returns all previous sibling nodes.
502
+ * @returns Array of previous siblings
503
+ * @returns {Node[]}
504
+ */
505
+ previousSiblings() {
506
+ const ret = wasm.jsonarray_previousSiblings(this.__wbg_ptr);
507
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
508
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
509
+ return v1;
510
+ }
511
+ /**
512
+ * Configures whether trailing commas should be used in this array.
513
+ * When enabled, trailing commas are added for multiline formatting.
514
+ * @param enabled - Whether to enable trailing commas
515
+ * @param {boolean} enabled
516
+ */
517
+ setTrailingCommas(enabled) {
518
+ wasm.jsonarray_setTrailingCommas(this.__wbg_ptr, enabled);
519
+ }
520
+ /**
521
+ * Returns whether this node's container uses trailing commas.
522
+ * @returns true if trailing commas are used
523
+ * @returns {boolean}
524
+ */
525
+ usesTrailingCommas() {
526
+ const ret = wasm.jsonarray_usesTrailingCommas(this.__wbg_ptr);
527
+ return ret !== 0;
528
+ }
529
+ /**
530
+ * Returns child nodes excluding whitespace, comments, and punctuation.
531
+ * @returns Array of significant child nodes
532
+ * @returns {Node[]}
533
+ */
534
+ childrenExcludeTriviaAndTokens() {
535
+ const ret = wasm.jsonarray_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
464
536
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
465
537
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
466
538
  return v1;
@@ -495,29 +567,6 @@ export class JsonArray {
495
567
  }
496
568
  return Node.__wrap(ret[0]);
497
569
  }
498
- /**
499
- * Configures whether trailing commas should be used in this array.
500
- * When enabled, trailing commas are added for multiline formatting.
501
- * @param enabled - Whether to enable trailing commas
502
- * @param {boolean} enabled
503
- */
504
- setTrailingCommas(enabled) {
505
- wasm.jsonarray_setTrailingCommas(this.__wbg_ptr, enabled);
506
- }
507
- /**
508
- * Replaces this array with a new value.
509
- * @param value - The new value to replace this array with
510
- * @returns The new node that replaced this one, or undefined if this was the root value
511
- * @param {any} value
512
- * @returns {Node | undefined}
513
- */
514
- replaceWith(value) {
515
- const ret = wasm.jsonarray_replaceWith(this.__wbg_ptr, value);
516
- if (ret[2]) {
517
- throw takeFromExternrefTable0(ret[1]);
518
- }
519
- return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
520
- }
521
570
  /**
522
571
  * Returns the parent node in the CST.
523
572
  * @returns The parent node, or undefined if this is the root
@@ -528,61 +577,42 @@ export class JsonArray {
528
577
  return ret === 0 ? undefined : Node.__wrap(ret);
529
578
  }
530
579
  /**
531
- * Returns the index of this node within its parent's children.
532
- * @returns The child index
533
- * @returns {number}
580
+ * Removes this array from its parent.
581
+ * After calling this method, the array is detached from the CST and can no longer be used.
534
582
  */
535
- childIndex() {
536
- const ret = wasm.jsonarray_childIndex(this.__wbg_ptr);
537
- return ret >>> 0;
583
+ remove() {
584
+ const ptr = this.__destroy_into_raw();
585
+ wasm.jsonarray_remove(ptr);
538
586
  }
539
587
  /**
540
- * Returns all ancestor nodes from parent to root.
541
- * @returns Array of ancestor nodes
588
+ * Returns all child nodes including whitespace and punctuation.
589
+ * @returns Array of all child nodes
542
590
  * @returns {Node[]}
543
591
  */
544
- ancestors() {
545
- const ret = wasm.jsonarray_ancestors(this.__wbg_ptr);
592
+ children() {
593
+ const ret = wasm.jsonarray_children(this.__wbg_ptr);
546
594
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
547
595
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
548
596
  return v1;
549
597
  }
550
598
  /**
551
- * Returns the previous sibling node.
552
- * @returns The previous sibling, or undefined if this is the first child
553
- * @returns {Node | undefined}
554
- */
555
- previousSibling() {
556
- const ret = wasm.jsonarray_previousSibling(this.__wbg_ptr);
557
- return ret === 0 ? undefined : Node.__wrap(ret);
558
- }
559
- /**
560
- * Returns all previous sibling nodes.
561
- * @returns Array of previous siblings
599
+ * Returns all element nodes in the array.
600
+ * @returns Array of element nodes
562
601
  * @returns {Node[]}
563
602
  */
564
- previousSiblings() {
565
- const ret = wasm.jsonarray_previousSiblings(this.__wbg_ptr);
603
+ elements() {
604
+ const ret = wasm.jsonarray_elements(this.__wbg_ptr);
566
605
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
567
606
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
568
607
  return v1;
569
608
  }
570
609
  /**
571
- * Returns the next sibling node.
572
- * @returns The next sibling, or undefined if this is the last child
573
- * @returns {Node | undefined}
574
- */
575
- nextSibling() {
576
- const ret = wasm.jsonarray_nextSibling(this.__wbg_ptr);
577
- return ret === 0 ? undefined : Node.__wrap(ret);
578
- }
579
- /**
580
- * Returns all next sibling nodes.
581
- * @returns Array of next siblings
610
+ * Returns all ancestor nodes from parent to root.
611
+ * @returns Array of ancestor nodes
582
612
  * @returns {Node[]}
583
613
  */
584
- nextSiblings() {
585
- const ret = wasm.jsonarray_nextSiblings(this.__wbg_ptr);
614
+ ancestors() {
615
+ const ret = wasm.jsonarray_ancestors(this.__wbg_ptr);
586
616
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
587
617
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
588
618
  return v1;
@@ -596,55 +626,10 @@ export class JsonArray {
596
626
  const ret = wasm.jsonarray_rootNode(this.__wbg_ptr);
597
627
  return ret === 0 ? undefined : RootNode.__wrap(ret);
598
628
  }
599
- /**
600
- * Returns the indentation string used at this node's depth.
601
- * @returns The indentation string, or undefined if not applicable
602
- * @returns {string | undefined}
603
- */
604
- indentText() {
605
- const ret = wasm.jsonarray_indentText(this.__wbg_ptr);
606
- let v1;
607
- if (ret[0] !== 0) {
608
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
609
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
610
- }
611
- return v1;
612
- }
613
- /**
614
- * Returns whether this node's container uses trailing commas.
615
- * @returns true if trailing commas are used
616
- * @returns {boolean}
617
- */
618
- usesTrailingCommas() {
619
- const ret = wasm.jsonarray_usesTrailingCommas(this.__wbg_ptr);
620
- return ret !== 0;
621
- }
622
- /**
623
- * Returns child nodes excluding whitespace, comments, and punctuation.
624
- * @returns Array of significant child nodes
625
- * @returns {Node[]}
626
- */
627
- childrenExcludeTriviaAndTokens() {
628
- const ret = wasm.jsonarray_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
629
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
630
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
631
- return v1;
632
- }
633
- /**
634
- * Returns the child node at the specified index.
635
- * @param index - The child index
636
- * @returns The child node, or undefined if index is out of bounds
637
- * @param {number} index
638
- * @returns {Node | undefined}
639
- */
640
- childAtIndex(index) {
641
- const ret = wasm.jsonarray_childAtIndex(this.__wbg_ptr, index);
642
- return ret === 0 ? undefined : Node.__wrap(ret);
643
- }
644
629
  }
645
- const JsonObjectFinalization = (typeof FinalizationRegistry === "undefined")
646
- ? { register: () => { }, unregister: () => { } }
647
- : new FinalizationRegistry((ptr) => wasm.__wbg_jsonobject_free(ptr >>> 0, 1));
630
+ if (Symbol.dispose) {
631
+ JsonArray.prototype[Symbol.dispose] = JsonArray.prototype.free;
632
+ }
648
633
  /**
649
634
  * Represents a JSON object node in the CST.
650
635
  * Provides methods for manipulating object properties.
@@ -679,17 +664,40 @@ export class JsonObject {
679
664
  return v1;
680
665
  }
681
666
  /**
682
- * Gets a property by name.
683
- * @param key - The property name to look up
684
- * @returns The property, or undefined if not found
685
- * @param {string} key
686
- * @returns {ObjectProp | undefined}
667
+ * Returns the index of this node within its parent's children.
668
+ * @returns The child index
669
+ * @returns {number}
687
670
  */
688
- get(key) {
689
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
671
+ childIndex() {
672
+ const ret = wasm.jsonobject_childIndex(this.__wbg_ptr);
673
+ return ret >>> 0;
674
+ }
675
+ /**
676
+ * Returns the indentation string used at this node's depth.
677
+ * @returns The indentation string, or undefined if not applicable
678
+ * @returns {string | undefined}
679
+ */
680
+ indentText() {
681
+ const ret = wasm.jsonobject_indentText(this.__wbg_ptr);
682
+ let v1;
683
+ if (ret[0] !== 0) {
684
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
685
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
686
+ }
687
+ return v1;
688
+ }
689
+ /**
690
+ * Gets a property value if it's an array.
691
+ * @param name - The property name to look up
692
+ * @returns The array value, or undefined if property doesn't exist or is not an array
693
+ * @param {string} name
694
+ * @returns {JsonArray | undefined}
695
+ */
696
+ getIfArray(name) {
697
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
690
698
  const len0 = WASM_VECTOR_LEN;
691
- const ret = wasm.jsonobject_get(this.__wbg_ptr, ptr0, len0);
692
- return ret === 0 ? undefined : ObjectProp.__wrap(ret);
699
+ const ret = wasm.jsonobject_getIfArray(this.__wbg_ptr, ptr0, len0);
700
+ return ret === 0 ? undefined : JsonArray.__wrap(ret);
693
701
  }
694
702
  /**
695
703
  * Gets a property by name, throwing if not found.
@@ -709,75 +717,120 @@ export class JsonObject {
709
717
  return ObjectProp.__wrap(ret[0]);
710
718
  }
711
719
  /**
712
- * Gets a property value if it's an object.
713
- * @param name - The property name to look up
714
- * @returns The object value, or undefined if property doesn't exist or is not an object
715
- * @param {string} name
716
- * @returns {JsonObject | undefined}
720
+ * Returns the next sibling node.
721
+ * @returns The next sibling, or undefined if this is the last child
722
+ * @returns {Node | undefined}
717
723
  */
718
- getIfObject(name) {
719
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
720
- const len0 = WASM_VECTOR_LEN;
721
- const ret = wasm.jsonobject_getIfObject(this.__wbg_ptr, ptr0, len0);
722
- return ret === 0 ? undefined : JsonObject.__wrap(ret);
724
+ nextSibling() {
725
+ const ret = wasm.jsonobject_nextSibling(this.__wbg_ptr);
726
+ return ret === 0 ? undefined : Node.__wrap(ret);
723
727
  }
724
728
  /**
725
- * Gets a property value as an object, throwing if not found or wrong type.
726
- * @param name - The property name to look up
727
- * @returns The object value
728
- * @throws If the property doesn't exist or is not an object
729
- * @param {string} name
730
- * @returns {JsonObject}
729
+ * Replaces this object with a new value.
730
+ * @param replacement - The new value to replace this object with
731
+ * @returns The new node that replaced this one, or undefined if this was the root value
732
+ * @param {any} replacement
733
+ * @returns {Node | undefined}
731
734
  */
732
- getIfObjectOrThrow(name) {
733
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
734
- const len0 = WASM_VECTOR_LEN;
735
- const ret = wasm.jsonobject_getIfObjectOrThrow(this.__wbg_ptr, ptr0, len0);
735
+ replaceWith(replacement) {
736
+ const ret = wasm.jsonobject_replaceWith(this.__wbg_ptr, replacement);
736
737
  if (ret[2]) {
737
738
  throw takeFromExternrefTable0(ret[1]);
738
739
  }
739
- return JsonObject.__wrap(ret[0]);
740
+ return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
740
741
  }
741
742
  /**
742
- * Gets a property value as an object, creating an empty object if the property doesn't exist.
743
- * Returns undefined if the property exists but has a non-object value.
744
- * @param name - The property name to get
745
- * @returns The object value, or undefined if property has a non-object value
743
+ * Gets a property value if it's an object.
744
+ * @param name - The property name to look up
745
+ * @returns The object value, or undefined if property doesn't exist or is not an object
746
746
  * @param {string} name
747
747
  * @returns {JsonObject | undefined}
748
748
  */
749
- getIfObjectOrCreate(name) {
749
+ getIfObject(name) {
750
750
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
751
751
  const len0 = WASM_VECTOR_LEN;
752
- const ret = wasm.jsonobject_getIfObjectOrCreate(this.__wbg_ptr, ptr0, len0);
752
+ const ret = wasm.jsonobject_getIfObject(this.__wbg_ptr, ptr0, len0);
753
753
  return ret === 0 ? undefined : JsonObject.__wrap(ret);
754
754
  }
755
755
  /**
756
- * Gets a property value as an object, creating or replacing the value with an empty object if needed.
757
- * Unlike getIfObjectOrCreate, this always returns an object by replacing non-object values.
758
- * @param name - The property name to get
759
- * @returns The object value (always succeeds)
760
- * @param {string} name
761
- * @returns {JsonObject}
756
+ * Returns all next sibling nodes.
757
+ * @returns Array of next siblings
758
+ * @returns {Node[]}
762
759
  */
763
- getIfObjectOrForce(name) {
764
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
765
- const len0 = WASM_VECTOR_LEN;
766
- const ret = wasm.jsonobject_getIfObjectOrForce(this.__wbg_ptr, ptr0, len0);
767
- return JsonObject.__wrap(ret);
760
+ nextSiblings() {
761
+ const ret = wasm.jsonobject_nextSiblings(this.__wbg_ptr);
762
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
763
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
764
+ return v1;
768
765
  }
769
766
  /**
770
- * Gets a property value if it's an array.
771
- * @param name - The property name to look up
772
- * @returns The array value, or undefined if property doesn't exist or is not an array
767
+ * Returns the child node at the specified index.
768
+ * @param index - The child index
769
+ * @returns The child node, or undefined if index is out of bounds
770
+ * @param {number} index
771
+ * @returns {Node | undefined}
772
+ */
773
+ childAtIndex(index) {
774
+ const ret = wasm.jsonobject_childAtIndex(this.__wbg_ptr, index);
775
+ return ret === 0 ? undefined : Node.__wrap(ret);
776
+ }
777
+ /**
778
+ * Ensures the object is formatted with each property on its own line.
779
+ */
780
+ ensureMultiline() {
781
+ wasm.jsonobject_ensureMultiline(this.__wbg_ptr);
782
+ }
783
+ /**
784
+ * Returns the previous sibling node.
785
+ * @returns The previous sibling, or undefined if this is the first child
786
+ * @returns {Node | undefined}
787
+ */
788
+ previousSibling() {
789
+ const ret = wasm.jsonobject_previousSibling(this.__wbg_ptr);
790
+ return ret === 0 ? undefined : Node.__wrap(ret);
791
+ }
792
+ /**
793
+ * Returns all previous sibling nodes.
794
+ * @returns Array of previous siblings
795
+ * @returns {Node[]}
796
+ */
797
+ previousSiblings() {
798
+ const ret = wasm.jsonobject_previousSiblings(this.__wbg_ptr);
799
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
800
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
801
+ return v1;
802
+ }
803
+ /**
804
+ * Configures whether trailing commas should be used in this object.
805
+ * When enabled, trailing commas are added for multiline formatting.
806
+ * @param enabled - Whether to enable trailing commas
807
+ * @param {boolean} enabled
808
+ */
809
+ setTrailingCommas(enabled) {
810
+ wasm.jsonobject_setTrailingCommas(this.__wbg_ptr, enabled);
811
+ }
812
+ /**
813
+ * Returns whether this node's container uses trailing commas.
814
+ * @returns true if trailing commas are used
815
+ * @returns {boolean}
816
+ */
817
+ usesTrailingCommas() {
818
+ const ret = wasm.jsonobject_usesTrailingCommas(this.__wbg_ptr);
819
+ return ret !== 0;
820
+ }
821
+ /**
822
+ * Gets a property value as an array, creating or replacing the value with an empty array if needed.
823
+ * Unlike getIfArrayOrCreate, this always returns an array by replacing non-array values.
824
+ * @param name - The property name to get
825
+ * @returns The array value (always succeeds)
773
826
  * @param {string} name
774
- * @returns {JsonArray | undefined}
827
+ * @returns {JsonArray}
775
828
  */
776
- getIfArray(name) {
829
+ getIfArrayOrForce(name) {
777
830
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
778
831
  const len0 = WASM_VECTOR_LEN;
779
- const ret = wasm.jsonobject_getIfArray(this.__wbg_ptr, ptr0, len0);
780
- return ret === 0 ? undefined : JsonArray.__wrap(ret);
832
+ const ret = wasm.jsonobject_getIfArrayOrForce(this.__wbg_ptr, ptr0, len0);
833
+ return JsonArray.__wrap(ret);
781
834
  }
782
835
  /**
783
836
  * Gets a property value as an array, throwing if not found or wrong type.
@@ -811,38 +864,74 @@ export class JsonObject {
811
864
  return ret === 0 ? undefined : JsonArray.__wrap(ret);
812
865
  }
813
866
  /**
814
- * Gets a property value as an array, creating or replacing the value with an empty array if needed.
815
- * Unlike getIfArrayOrCreate, this always returns an array by replacing non-array values.
867
+ * Gets a property value as an object, creating or replacing the value with an empty object if needed.
868
+ * Unlike getIfObjectOrCreate, this always returns an object by replacing non-object values.
816
869
  * @param name - The property name to get
817
- * @returns The array value (always succeeds)
870
+ * @returns The object value (always succeeds)
818
871
  * @param {string} name
819
- * @returns {JsonArray}
872
+ * @returns {JsonObject}
820
873
  */
821
- getIfArrayOrForce(name) {
874
+ getIfObjectOrForce(name) {
822
875
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
823
876
  const len0 = WASM_VECTOR_LEN;
824
- const ret = wasm.jsonobject_getIfArrayOrForce(this.__wbg_ptr, ptr0, len0);
825
- return JsonArray.__wrap(ret);
877
+ const ret = wasm.jsonobject_getIfObjectOrForce(this.__wbg_ptr, ptr0, len0);
878
+ return JsonObject.__wrap(ret);
826
879
  }
827
880
  /**
828
- * Removes this object from its parent.
829
- * After calling this method, the object is detached from the CST and can no longer be used.
881
+ * Gets a property value as an object, throwing if not found or wrong type.
882
+ * @param name - The property name to look up
883
+ * @returns The object value
884
+ * @throws If the property doesn't exist or is not an object
885
+ * @param {string} name
886
+ * @returns {JsonObject}
830
887
  */
831
- remove() {
832
- const ptr = this.__destroy_into_raw();
833
- wasm.jsonobject_remove(ptr);
888
+ getIfObjectOrThrow(name) {
889
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
890
+ const len0 = WASM_VECTOR_LEN;
891
+ const ret = wasm.jsonobject_getIfObjectOrThrow(this.__wbg_ptr, ptr0, len0);
892
+ if (ret[2]) {
893
+ throw takeFromExternrefTable0(ret[1]);
894
+ }
895
+ return JsonObject.__wrap(ret[0]);
834
896
  }
835
897
  /**
836
- * Returns all child nodes including whitespace and punctuation.
837
- * @returns Array of all child nodes
898
+ * Gets a property value as an object, creating an empty object if the property doesn't exist.
899
+ * Returns undefined if the property exists but has a non-object value.
900
+ * @param name - The property name to get
901
+ * @returns The object value, or undefined if property has a non-object value
902
+ * @param {string} name
903
+ * @returns {JsonObject | undefined}
904
+ */
905
+ getIfObjectOrCreate(name) {
906
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
907
+ const len0 = WASM_VECTOR_LEN;
908
+ const ret = wasm.jsonobject_getIfObjectOrCreate(this.__wbg_ptr, ptr0, len0);
909
+ return ret === 0 ? undefined : JsonObject.__wrap(ret);
910
+ }
911
+ /**
912
+ * Returns child nodes excluding whitespace, comments, and punctuation.
913
+ * @returns Array of significant child nodes
838
914
  * @returns {Node[]}
839
915
  */
840
- children() {
841
- const ret = wasm.jsonobject_children(this.__wbg_ptr);
916
+ childrenExcludeTriviaAndTokens() {
917
+ const ret = wasm.jsonobject_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
842
918
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
843
919
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
844
920
  return v1;
845
921
  }
922
+ /**
923
+ * Gets a property by name.
924
+ * @param key - The property name to look up
925
+ * @returns The property, or undefined if not found
926
+ * @param {string} key
927
+ * @returns {ObjectProp | undefined}
928
+ */
929
+ get(key) {
930
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
931
+ const len0 = WASM_VECTOR_LEN;
932
+ const ret = wasm.jsonobject_get(this.__wbg_ptr, ptr0, len0);
933
+ return ret === 0 ? undefined : ObjectProp.__wrap(ret);
934
+ }
846
935
  /**
847
936
  * Appends a new property to the object.
848
937
  * @param key - The name of the property to add
@@ -881,35 +970,6 @@ export class JsonObject {
881
970
  }
882
971
  return ObjectProp.__wrap(ret[0]);
883
972
  }
884
- /**
885
- * Configures whether trailing commas should be used in this object.
886
- * When enabled, trailing commas are added for multiline formatting.
887
- * @param enabled - Whether to enable trailing commas
888
- * @param {boolean} enabled
889
- */
890
- setTrailingCommas(enabled) {
891
- wasm.jsonobject_setTrailingCommas(this.__wbg_ptr, enabled);
892
- }
893
- /**
894
- * Ensures the object is formatted with each property on its own line.
895
- */
896
- ensureMultiline() {
897
- wasm.jsonobject_ensureMultiline(this.__wbg_ptr);
898
- }
899
- /**
900
- * Replaces this object with a new value.
901
- * @param replacement - The new value to replace this object with
902
- * @returns The new node that replaced this one, or undefined if this was the root value
903
- * @param {any} replacement
904
- * @returns {Node | undefined}
905
- */
906
- replaceWith(replacement) {
907
- const ret = wasm.jsonobject_replaceWith(this.__wbg_ptr, replacement);
908
- if (ret[2]) {
909
- throw takeFromExternrefTable0(ret[1]);
910
- }
911
- return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
912
- }
913
973
  /**
914
974
  * Returns the parent node in the CST.
915
975
  * @returns The parent node, or undefined if this is the root
@@ -919,6 +979,25 @@ export class JsonObject {
919
979
  const ret = wasm.jsonobject_parent(this.__wbg_ptr);
920
980
  return ret === 0 ? undefined : Node.__wrap(ret);
921
981
  }
982
+ /**
983
+ * Removes this object from its parent.
984
+ * After calling this method, the object is detached from the CST and can no longer be used.
985
+ */
986
+ remove() {
987
+ const ptr = this.__destroy_into_raw();
988
+ wasm.jsonobject_remove(ptr);
989
+ }
990
+ /**
991
+ * Returns all child nodes including whitespace and punctuation.
992
+ * @returns Array of all child nodes
993
+ * @returns {Node[]}
994
+ */
995
+ children() {
996
+ const ret = wasm.jsonobject_children(this.__wbg_ptr);
997
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
998
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
999
+ return v1;
1000
+ }
922
1001
  /**
923
1002
  * Returns all ancestor nodes from parent to root.
924
1003
  * @returns Array of ancestor nodes
@@ -931,62 +1010,107 @@ export class JsonObject {
931
1010
  return v1;
932
1011
  }
933
1012
  /**
934
- * Returns the index of this node within its parent's children.
935
- * @returns The child index
936
- * @returns {number}
1013
+ * Returns the root node of the document.
1014
+ * @returns The root node, or undefined if detached
1015
+ * @returns {RootNode | undefined}
937
1016
  */
938
- childIndex() {
939
- const ret = wasm.jsonobject_childIndex(this.__wbg_ptr);
940
- return ret >>> 0;
1017
+ rootNode() {
1018
+ const ret = wasm.jsonobject_rootNode(this.__wbg_ptr);
1019
+ return ret === 0 ? undefined : RootNode.__wrap(ret);
1020
+ }
1021
+ }
1022
+ if (Symbol.dispose) {
1023
+ JsonObject.prototype[Symbol.dispose] = JsonObject.prototype.free;
1024
+ }
1025
+ /**
1026
+ * Represents a generic node in the CST.
1027
+ * Can be a container node (object, array, property) or a leaf node (string, number, boolean, null).
1028
+ */
1029
+ export class Node {
1030
+ static __wrap(ptr) {
1031
+ ptr = ptr >>> 0;
1032
+ const obj = Object.create(Node.prototype);
1033
+ obj.__wbg_ptr = ptr;
1034
+ NodeFinalization.register(obj, obj.__wbg_ptr, obj);
1035
+ return obj;
1036
+ }
1037
+ __destroy_into_raw() {
1038
+ const ptr = this.__wbg_ptr;
1039
+ this.__wbg_ptr = 0;
1040
+ NodeFinalization.unregister(this);
1041
+ return ptr;
1042
+ }
1043
+ free() {
1044
+ const ptr = this.__destroy_into_raw();
1045
+ wasm.__wbg_node_free(ptr, 0);
941
1046
  }
942
1047
  /**
943
- * Returns the previous sibling node.
944
- * @returns The previous sibling, or undefined if this is the first child
945
- * @returns {Node | undefined}
1048
+ * Returns the boolean value if this node is a boolean literal.
1049
+ * @returns The boolean value, or undefined if this node is not a boolean
1050
+ * @returns {boolean | undefined}
946
1051
  */
947
- previousSibling() {
948
- const ret = wasm.jsonobject_previousSibling(this.__wbg_ptr);
949
- return ret === 0 ? undefined : Node.__wrap(ret);
1052
+ asBoolean() {
1053
+ const ret = wasm.node_asBoolean(this.__wbg_ptr);
1054
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
950
1055
  }
951
1056
  /**
952
- * Returns all previous sibling nodes.
953
- * @returns Array of previous siblings
954
- * @returns {Node[]}
1057
+ * Returns true if this node is a boolean literal.
1058
+ * @returns true if this node is a boolean
1059
+ * @returns {boolean}
955
1060
  */
956
- previousSiblings() {
957
- const ret = wasm.jsonobject_previousSiblings(this.__wbg_ptr);
958
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
959
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
960
- return v1;
1061
+ isBoolean() {
1062
+ const ret = wasm.node_isBoolean(this.__wbg_ptr);
1063
+ return ret !== 0;
961
1064
  }
962
1065
  /**
963
- * Returns the next sibling node.
964
- * @returns The next sibling, or undefined if this is the last child
965
- * @returns {Node | undefined}
1066
+ * Returns true if this node is a comment.
1067
+ * @returns true if this node is a comment
1068
+ * @returns {boolean}
966
1069
  */
967
- nextSibling() {
968
- const ret = wasm.jsonobject_nextSibling(this.__wbg_ptr);
969
- return ret === 0 ? undefined : Node.__wrap(ret);
1070
+ isComment() {
1071
+ const ret = wasm.node_isComment(this.__wbg_ptr);
1072
+ return ret !== 0;
970
1073
  }
971
1074
  /**
972
- * Returns all next sibling nodes.
973
- * @returns Array of next siblings
974
- * @returns {Node[]}
1075
+ * Returns true if this node is a newline character.
1076
+ * @returns true if this node is a newline
1077
+ * @returns {boolean}
975
1078
  */
976
- nextSiblings() {
977
- const ret = wasm.jsonobject_nextSiblings(this.__wbg_ptr);
978
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
979
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1079
+ isNewline() {
1080
+ const ret = wasm.node_isNewline(this.__wbg_ptr);
1081
+ return ret !== 0;
1082
+ }
1083
+ /**
1084
+ * Returns the character if this node is a single-character token.
1085
+ * @returns The token character, or undefined if not a token
1086
+ * @returns {string | undefined}
1087
+ */
1088
+ tokenChar() {
1089
+ const ret = wasm.node_tokenChar(this.__wbg_ptr);
1090
+ let v1;
1091
+ if (ret[0] !== 0) {
1092
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1093
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1094
+ }
980
1095
  return v1;
981
1096
  }
982
1097
  /**
983
- * Returns the root node of the document.
984
- * @returns The root node, or undefined if detached
985
- * @returns {RootNode | undefined}
1098
+ * Returns this node as a WordLit if it is one.
1099
+ * @returns The WordLit, or undefined if this node is not a word literal
1100
+ * @returns {WordLit | undefined}
986
1101
  */
987
- rootNode() {
988
- const ret = wasm.jsonobject_rootNode(this.__wbg_ptr);
989
- return ret === 0 ? undefined : RootNode.__wrap(ret);
1102
+ asWordLit() {
1103
+ const ret = wasm.node_asWordLit(this.__wbg_ptr);
1104
+ return ret === 0 ? undefined : WordLit.__wrap(ret);
1105
+ }
1106
+ /**
1107
+ * Returns the index of this node within its parent's children.
1108
+ * @returns The child index
1109
+ * @returns {number}
1110
+ */
1111
+ childIndex() {
1112
+ const ret = wasm.node_childIndex(this.__wbg_ptr);
1113
+ return ret >>> 0;
990
1114
  }
991
1115
  /**
992
1116
  * Returns the indentation string used at this node's depth.
@@ -994,7 +1118,7 @@ export class JsonObject {
994
1118
  * @returns {string | undefined}
995
1119
  */
996
1120
  indentText() {
997
- const ret = wasm.jsonobject_indentText(this.__wbg_ptr);
1121
+ const ret = wasm.node_indentText(this.__wbg_ptr);
998
1122
  let v1;
999
1123
  if (ret[0] !== 0) {
1000
1124
  v1 = getStringFromWasm0(ret[0], ret[1]).slice();
@@ -1003,119 +1127,144 @@ export class JsonObject {
1003
1127
  return v1;
1004
1128
  }
1005
1129
  /**
1006
- * Returns whether this node's container uses trailing commas.
1007
- * @returns true if trailing commas are used
1008
- * @returns {boolean}
1130
+ * Converts this node to the root node if it is one.
1131
+ * @returns The root node, or undefined if this is not a root node
1132
+ * @returns {RootNode | undefined}
1009
1133
  */
1010
- usesTrailingCommas() {
1011
- const ret = wasm.jsonobject_usesTrailingCommas(this.__wbg_ptr);
1012
- return ret !== 0;
1134
+ asRootNode() {
1135
+ const ret = wasm.node_asRootNode(this.__wbg_ptr);
1136
+ return ret === 0 ? undefined : RootNode.__wrap(ret);
1013
1137
  }
1014
1138
  /**
1015
- * Returns child nodes excluding whitespace, comments, and punctuation.
1016
- * @returns Array of significant child nodes
1017
- * @returns {Node[]}
1139
+ * Returns true if this node is a container (object, array, or property).
1140
+ * @returns true if this is a container node
1141
+ * @returns {boolean}
1018
1142
  */
1019
- childrenExcludeTriviaAndTokens() {
1020
- const ret = wasm.jsonobject_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
1021
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1022
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1023
- return v1;
1143
+ isContainer() {
1144
+ const ret = wasm.node_isContainer(this.__wbg_ptr);
1145
+ return ret !== 0;
1024
1146
  }
1025
1147
  /**
1026
- * Returns the child node at the specified index.
1027
- * @param index - The child index
1028
- * @returns The child node, or undefined if index is out of bounds
1029
- * @param {number} index
1148
+ * Returns the next sibling node.
1149
+ * @returns The next sibling, or undefined if this is the last child
1030
1150
  * @returns {Node | undefined}
1031
1151
  */
1032
- childAtIndex(index) {
1033
- const ret = wasm.jsonobject_childAtIndex(this.__wbg_ptr, index);
1152
+ nextSibling() {
1153
+ const ret = wasm.node_nextSibling(this.__wbg_ptr);
1034
1154
  return ret === 0 ? undefined : Node.__wrap(ret);
1035
1155
  }
1036
- }
1037
- const NodeFinalization = (typeof FinalizationRegistry === "undefined")
1038
- ? { register: () => { }, unregister: () => { } }
1039
- : new FinalizationRegistry((ptr) => wasm.__wbg_node_free(ptr >>> 0, 1));
1040
- /**
1041
- * Represents a generic node in the CST.
1042
- * Can be a container node (object, array, property) or a leaf node (string, number, boolean, null).
1043
- */
1044
- export class Node {
1045
- static __wrap(ptr) {
1046
- ptr = ptr >>> 0;
1047
- const obj = Object.create(Node.prototype);
1048
- obj.__wbg_ptr = ptr;
1049
- NodeFinalization.register(obj, obj.__wbg_ptr, obj);
1050
- return obj;
1156
+ /**
1157
+ * Returns the raw string representation of a number literal.
1158
+ * Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
1159
+ * @returns The number as a string, or undefined if this node is not a number
1160
+ * @returns {string | undefined}
1161
+ */
1162
+ numberValue() {
1163
+ const ret = wasm.node_numberValue(this.__wbg_ptr);
1164
+ let v1;
1165
+ if (ret[0] !== 0) {
1166
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1167
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1168
+ }
1169
+ return v1;
1051
1170
  }
1052
- __destroy_into_raw() {
1053
- const ptr = this.__wbg_ptr;
1054
- this.__wbg_ptr = 0;
1055
- NodeFinalization.unregister(this);
1056
- return ptr;
1171
+ /**
1172
+ * Returns this node as a NumberLit if it is one.
1173
+ * @returns The NumberLit, or undefined if this node is not a number literal
1174
+ * @returns {NumberLit | undefined}
1175
+ */
1176
+ asNumberLit() {
1177
+ const ret = wasm.node_asNumberLit(this.__wbg_ptr);
1178
+ return ret === 0 ? undefined : NumberLit.__wrap(ret);
1057
1179
  }
1058
- free() {
1059
- const ptr = this.__destroy_into_raw();
1060
- wasm.__wbg_node_free(ptr, 0);
1180
+ /**
1181
+ * Returns this node as a StringLit if it is one.
1182
+ * @returns The StringLit, or undefined if this node is not a string literal
1183
+ * @returns {StringLit | undefined}
1184
+ */
1185
+ asStringLit() {
1186
+ const ret = wasm.node_asStringLit(this.__wbg_ptr);
1187
+ return ret === 0 ? undefined : StringLit.__wrap(ret);
1061
1188
  }
1062
1189
  /**
1063
- * Removes this node from its parent.
1064
- * Works for any node kind, including whitespace, comments, tokens, containers, and leaf values.
1065
- * After calling this method, the node is detached from the CST and can no longer be used.
1190
+ * Returns the element index if this node is an array element.
1191
+ * @returns The element index, or undefined if not an array element
1192
+ * @returns {number | undefined}
1066
1193
  */
1067
- remove() {
1068
- const ptr = this.__destroy_into_raw();
1069
- wasm.node_remove(ptr);
1194
+ elementIndex() {
1195
+ const ret = wasm.node_elementIndex(this.__wbg_ptr);
1196
+ return ret === 0x100000001 ? undefined : ret;
1070
1197
  }
1071
1198
  /**
1072
- * Returns true if this node is a container (object, array, or property).
1073
- * @returns true if this is a container node
1199
+ * Returns true if this node is whitespace.
1200
+ * @returns true if this node is whitespace
1074
1201
  * @returns {boolean}
1075
1202
  */
1076
- isContainer() {
1077
- const ret = wasm.node_isContainer(this.__wbg_ptr);
1203
+ isWhitespace() {
1204
+ const ret = wasm.node_isWhitespace(this.__wbg_ptr);
1078
1205
  return ret !== 0;
1079
1206
  }
1080
1207
  /**
1081
- * Returns true if this node is a leaf value (string, number, boolean, null).
1082
- * @returns true if this is a leaf node
1083
- * @returns {boolean}
1208
+ * Returns all next sibling nodes.
1209
+ * @returns Array of next siblings
1210
+ * @returns {Node[]}
1211
+ */
1212
+ nextSiblings() {
1213
+ const ret = wasm.node_nextSiblings(this.__wbg_ptr);
1214
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1215
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1216
+ return v1;
1217
+ }
1218
+ /**
1219
+ * Returns this node as a BooleanLit if it is one.
1220
+ * @returns The BooleanLit, or undefined if this node is not a boolean literal
1221
+ * @returns {BooleanLit | undefined}
1222
+ */
1223
+ asBooleanLit() {
1224
+ const ret = wasm.node_asBooleanLit(this.__wbg_ptr);
1225
+ return ret === 0 ? undefined : BooleanLit.__wrap(ret);
1226
+ }
1227
+ /**
1228
+ * Returns the child node at the specified index.
1229
+ * @param index - The child index
1230
+ * @returns The child node, or undefined if index is out of bounds
1231
+ * @param {number} index
1232
+ * @returns {Node | undefined}
1084
1233
  */
1085
- isLeaf() {
1086
- const ret = wasm.node_isLeaf(this.__wbg_ptr);
1087
- return ret !== 0;
1234
+ childAtIndex(index) {
1235
+ const ret = wasm.node_childAtIndex(this.__wbg_ptr, index);
1236
+ return ret === 0 ? undefined : Node.__wrap(ret);
1088
1237
  }
1089
1238
  /**
1090
- * Converts this node to an object if it is one.
1091
- * @returns The object, or undefined if this node is not an object
1092
- * @returns {JsonObject | undefined}
1239
+ * Returns this node as a NullKeyword if it is one.
1240
+ * @returns The NullKeyword, or undefined if this node is not a null keyword
1241
+ * @returns {NullKeyword | undefined}
1093
1242
  */
1094
- asObject() {
1095
- const ret = wasm.node_asObject(this.__wbg_ptr);
1096
- return ret === 0 ? undefined : JsonObject.__wrap(ret);
1243
+ asNullKeyword() {
1244
+ const ret = wasm.node_asNullKeyword(this.__wbg_ptr);
1245
+ return ret === 0 ? undefined : NullKeyword.__wrap(ret);
1097
1246
  }
1098
1247
  /**
1099
- * Converts this node to an object, throwing if it's not an object.
1100
- * @returns The object
1101
- * @throws If this node is not an object
1102
- * @returns {JsonObject}
1248
+ * Returns the parent node, throwing if this is the root.
1249
+ * @returns The parent node
1250
+ * @throws If this node has no parent
1251
+ * @returns {Node}
1103
1252
  */
1104
- asObjectOrThrow() {
1105
- const ret = wasm.node_asObjectOrThrow(this.__wbg_ptr);
1253
+ parentOrThrow() {
1254
+ const ret = wasm.node_parentOrThrow(this.__wbg_ptr);
1106
1255
  if (ret[2]) {
1107
1256
  throw takeFromExternrefTable0(ret[1]);
1108
1257
  }
1109
- return JsonObject.__wrap(ret[0]);
1258
+ return Node.__wrap(ret[0]);
1110
1259
  }
1111
1260
  /**
1112
- * Converts this node to an array if it is one.
1113
- * @returns The array, or undefined if this node is not an array
1114
- * @returns {JsonArray | undefined}
1261
+ * Returns the previous sibling node.
1262
+ * @returns The previous sibling, or undefined if this is the first child
1263
+ * @returns {Node | undefined}
1115
1264
  */
1116
- asArray() {
1117
- const ret = wasm.node_asArray(this.__wbg_ptr);
1118
- return ret === 0 ? undefined : JsonArray.__wrap(ret);
1265
+ previousSibling() {
1266
+ const ret = wasm.node_previousSibling(this.__wbg_ptr);
1267
+ return ret === 0 ? undefined : Node.__wrap(ret);
1119
1268
  }
1120
1269
  /**
1121
1270
  * Converts this node to an array, throwing if it's not an array.
@@ -1131,40 +1280,28 @@ export class Node {
1131
1280
  return JsonArray.__wrap(ret[0]);
1132
1281
  }
1133
1282
  /**
1134
- * Converts this node to the root node if it is one.
1135
- * @returns The root node, or undefined if this is not a root node
1136
- * @returns {RootNode | undefined}
1283
+ * Returns all previous sibling nodes.
1284
+ * @returns Array of previous siblings
1285
+ * @returns {Node[]}
1137
1286
  */
1138
- asRootNode() {
1139
- const ret = wasm.node_asRootNode(this.__wbg_ptr);
1140
- return ret === 0 ? undefined : RootNode.__wrap(ret);
1287
+ previousSiblings() {
1288
+ const ret = wasm.node_previousSiblings(this.__wbg_ptr);
1289
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1290
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1291
+ return v1;
1141
1292
  }
1142
1293
  /**
1143
- * Converts this node to the root node, throwing if it's not a root node.
1144
- * @returns The root node
1145
- * @throws If this node is not a root node
1146
- * @returns {RootNode}
1294
+ * Converts this node to an object, throwing if it's not an object.
1295
+ * @returns The object
1296
+ * @throws If this node is not an object
1297
+ * @returns {JsonObject}
1147
1298
  */
1148
- asRootNodeOrThrow() {
1149
- const ret = wasm.node_asRootNodeOrThrow(this.__wbg_ptr);
1299
+ asObjectOrThrow() {
1300
+ const ret = wasm.node_asObjectOrThrow(this.__wbg_ptr);
1150
1301
  if (ret[2]) {
1151
1302
  throw takeFromExternrefTable0(ret[1]);
1152
1303
  }
1153
- return RootNode.__wrap(ret[0]);
1154
- }
1155
- /**
1156
- * Returns the decoded string value if this node is a string literal.
1157
- * @returns The string value, or undefined if this node is not a string
1158
- * @returns {string | undefined}
1159
- */
1160
- asString() {
1161
- const ret = wasm.node_asString(this.__wbg_ptr);
1162
- let v1;
1163
- if (ret[0] !== 0) {
1164
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1165
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1166
- }
1167
- return v1;
1304
+ return JsonObject.__wrap(ret[0]);
1168
1305
  }
1169
1306
  /**
1170
1307
  * Returns the decoded string value, throwing if not a string.
@@ -1193,55 +1330,17 @@ export class Node {
1193
1330
  }
1194
1331
  }
1195
1332
  /**
1196
- * Returns the raw string representation of a number literal.
1197
- * Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
1198
- * @returns The number as a string, or undefined if this node is not a number
1199
- * @returns {string | undefined}
1200
- */
1201
- numberValue() {
1202
- const ret = wasm.node_numberValue(this.__wbg_ptr);
1203
- let v1;
1204
- if (ret[0] !== 0) {
1205
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1206
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1207
- }
1208
- return v1;
1209
- }
1210
- /**
1211
- * Returns the raw string representation of a number literal, throwing if not a number.
1212
- * Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
1213
- * @returns The number as a string
1214
- * @throws If this node is not a number
1215
- * @returns {string}
1333
+ * Returns the root node, throwing if detached.
1334
+ * @returns The root node
1335
+ * @throws If this node is detached from the CST
1336
+ * @returns {RootNode}
1216
1337
  */
1217
- numberValueOrThrow() {
1218
- let deferred2_0;
1219
- let deferred2_1;
1220
- try {
1221
- const ret = wasm.node_numberValueOrThrow(this.__wbg_ptr);
1222
- var ptr1 = ret[0];
1223
- var len1 = ret[1];
1224
- if (ret[3]) {
1225
- ptr1 = 0;
1226
- len1 = 0;
1227
- throw takeFromExternrefTable0(ret[2]);
1228
- }
1229
- deferred2_0 = ptr1;
1230
- deferred2_1 = len1;
1231
- return getStringFromWasm0(ptr1, len1);
1232
- }
1233
- finally {
1234
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1338
+ rootNodeOrThrow() {
1339
+ const ret = wasm.node_rootNodeOrThrow(this.__wbg_ptr);
1340
+ if (ret[2]) {
1341
+ throw takeFromExternrefTable0(ret[1]);
1235
1342
  }
1236
- }
1237
- /**
1238
- * Returns the boolean value if this node is a boolean literal.
1239
- * @returns The boolean value, or undefined if this node is not a boolean
1240
- * @returns {boolean | undefined}
1241
- */
1242
- asBoolean() {
1243
- const ret = wasm.node_asBoolean(this.__wbg_ptr);
1244
- return ret === 0xFFFFFF ? undefined : ret !== 0;
1343
+ return RootNode.__wrap(ret[0]);
1245
1344
  }
1246
1345
  /**
1247
1346
  * Returns the boolean value, throwing if not a boolean.
@@ -1257,71 +1356,66 @@ export class Node {
1257
1356
  return ret[0] !== 0;
1258
1357
  }
1259
1358
  /**
1260
- * Returns true if this node is a null keyword.
1261
- * @returns true if this node represents null
1262
- * @returns {boolean}
1263
- */
1264
- isNull() {
1265
- const ret = wasm.node_isNull(this.__wbg_ptr);
1266
- return ret !== 0;
1267
- }
1268
- /**
1269
- * Returns true if this node is a string literal.
1270
- * @returns true if this node is a string
1271
- * @returns {boolean}
1272
- */
1273
- isString() {
1274
- const ret = wasm.node_isString(this.__wbg_ptr);
1275
- return ret !== 0;
1276
- }
1277
- /**
1278
- * Returns true if this node is a number literal.
1279
- * @returns true if this node is a number
1280
- * @returns {boolean}
1359
+ * Returns this node as a WordLit, throwing if it's not a word literal.
1360
+ * @returns The WordLit
1361
+ * @throws If this node is not a word literal
1362
+ * @returns {WordLit}
1281
1363
  */
1282
- isNumber() {
1283
- const ret = wasm.node_isNumber(this.__wbg_ptr);
1284
- return ret !== 0;
1364
+ asWordLitOrThrow() {
1365
+ const ret = wasm.node_asWordLitOrThrow(this.__wbg_ptr);
1366
+ if (ret[2]) {
1367
+ throw takeFromExternrefTable0(ret[1]);
1368
+ }
1369
+ return WordLit.__wrap(ret[0]);
1285
1370
  }
1286
1371
  /**
1287
- * Returns true if this node is a boolean literal.
1288
- * @returns true if this node is a boolean
1372
+ * Returns whether this node's container uses trailing commas.
1373
+ * @returns true if trailing commas are used
1289
1374
  * @returns {boolean}
1290
1375
  */
1291
- isBoolean() {
1292
- const ret = wasm.node_isBoolean(this.__wbg_ptr);
1376
+ usesTrailingCommas() {
1377
+ const ret = wasm.node_usesTrailingCommas(this.__wbg_ptr);
1293
1378
  return ret !== 0;
1294
1379
  }
1295
1380
  /**
1296
- * Returns this node as a StringLit if it is one.
1297
- * @returns The StringLit, or undefined if this node is not a string literal
1298
- * @returns {StringLit | undefined}
1299
- */
1300
- asStringLit() {
1301
- const ret = wasm.node_asStringLit(this.__wbg_ptr);
1302
- return ret === 0 ? undefined : StringLit.__wrap(ret);
1303
- }
1304
- /**
1305
- * Returns this node as a StringLit, throwing if it's not a string literal.
1306
- * @returns The StringLit
1307
- * @throws If this node is not a string literal
1308
- * @returns {StringLit}
1381
+ * Converts this node to the root node, throwing if it's not a root node.
1382
+ * @returns The root node
1383
+ * @throws If this node is not a root node
1384
+ * @returns {RootNode}
1309
1385
  */
1310
- asStringLitOrThrow() {
1311
- const ret = wasm.node_asStringLitOrThrow(this.__wbg_ptr);
1386
+ asRootNodeOrThrow() {
1387
+ const ret = wasm.node_asRootNodeOrThrow(this.__wbg_ptr);
1312
1388
  if (ret[2]) {
1313
1389
  throw takeFromExternrefTable0(ret[1]);
1314
1390
  }
1315
- return StringLit.__wrap(ret[0]);
1391
+ return RootNode.__wrap(ret[0]);
1316
1392
  }
1317
1393
  /**
1318
- * Returns this node as a NumberLit if it is one.
1319
- * @returns The NumberLit, or undefined if this node is not a number literal
1320
- * @returns {NumberLit | undefined}
1394
+ * Returns the raw string representation of a number literal, throwing if not a number.
1395
+ * Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
1396
+ * @returns The number as a string
1397
+ * @throws If this node is not a number
1398
+ * @returns {string}
1321
1399
  */
1322
- asNumberLit() {
1323
- const ret = wasm.node_asNumberLit(this.__wbg_ptr);
1324
- return ret === 0 ? undefined : NumberLit.__wrap(ret);
1400
+ numberValueOrThrow() {
1401
+ let deferred2_0;
1402
+ let deferred2_1;
1403
+ try {
1404
+ const ret = wasm.node_numberValueOrThrow(this.__wbg_ptr);
1405
+ var ptr1 = ret[0];
1406
+ var len1 = ret[1];
1407
+ if (ret[3]) {
1408
+ ptr1 = 0;
1409
+ len1 = 0;
1410
+ throw takeFromExternrefTable0(ret[2]);
1411
+ }
1412
+ deferred2_0 = ptr1;
1413
+ deferred2_1 = len1;
1414
+ return getStringFromWasm0(ptr1, len1);
1415
+ }
1416
+ finally {
1417
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1418
+ }
1325
1419
  }
1326
1420
  /**
1327
1421
  * Returns this node as a NumberLit, throwing if it's not a number literal.
@@ -1337,13 +1431,17 @@ export class Node {
1337
1431
  return NumberLit.__wrap(ret[0]);
1338
1432
  }
1339
1433
  /**
1340
- * Returns this node as a BooleanLit if it is one.
1341
- * @returns The BooleanLit, or undefined if this node is not a boolean literal
1342
- * @returns {BooleanLit | undefined}
1434
+ * Returns this node as a StringLit, throwing if it's not a string literal.
1435
+ * @returns The StringLit
1436
+ * @throws If this node is not a string literal
1437
+ * @returns {StringLit}
1343
1438
  */
1344
- asBooleanLit() {
1345
- const ret = wasm.node_asBooleanLit(this.__wbg_ptr);
1346
- return ret === 0 ? undefined : BooleanLit.__wrap(ret);
1439
+ asStringLitOrThrow() {
1440
+ const ret = wasm.node_asStringLitOrThrow(this.__wbg_ptr);
1441
+ if (ret[2]) {
1442
+ throw takeFromExternrefTable0(ret[1]);
1443
+ }
1444
+ return StringLit.__wrap(ret[0]);
1347
1445
  }
1348
1446
  /**
1349
1447
  * Returns this node as a BooleanLit, throwing if it's not a boolean literal.
@@ -1358,15 +1456,6 @@ export class Node {
1358
1456
  }
1359
1457
  return BooleanLit.__wrap(ret[0]);
1360
1458
  }
1361
- /**
1362
- * Returns this node as a NullKeyword if it is one.
1363
- * @returns The NullKeyword, or undefined if this node is not a null keyword
1364
- * @returns {NullKeyword | undefined}
1365
- */
1366
- asNullKeyword() {
1367
- const ret = wasm.node_asNullKeyword(this.__wbg_ptr);
1368
- return ret === 0 ? undefined : NullKeyword.__wrap(ret);
1369
- }
1370
1459
  /**
1371
1460
  * Returns this node as a NullKeyword, throwing if it's not a null keyword.
1372
1461
  * @returns The NullKeyword
@@ -1381,26 +1470,15 @@ export class Node {
1381
1470
  return NullKeyword.__wrap(ret[0]);
1382
1471
  }
1383
1472
  /**
1384
- * Returns this node as a WordLit if it is one.
1385
- * @returns The WordLit, or undefined if this node is not a word literal
1386
- * @returns {WordLit | undefined}
1387
- */
1388
- asWordLit() {
1389
- const ret = wasm.node_asWordLit(this.__wbg_ptr);
1390
- return ret === 0 ? undefined : WordLit.__wrap(ret);
1391
- }
1392
- /**
1393
- * Returns this node as a WordLit, throwing if it's not a word literal.
1394
- * @returns The WordLit
1395
- * @throws If this node is not a word literal
1396
- * @returns {WordLit}
1473
+ * Returns child nodes excluding whitespace, comments, and punctuation.
1474
+ * @returns Array of significant child nodes
1475
+ * @returns {Node[]}
1397
1476
  */
1398
- asWordLitOrThrow() {
1399
- const ret = wasm.node_asWordLitOrThrow(this.__wbg_ptr);
1400
- if (ret[2]) {
1401
- throw takeFromExternrefTable0(ret[1]);
1402
- }
1403
- return WordLit.__wrap(ret[0]);
1477
+ childrenExcludeTriviaAndTokens() {
1478
+ const ret = wasm.node_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
1479
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1480
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1481
+ return v1;
1404
1482
  }
1405
1483
  /**
1406
1484
  * Returns the parent node in the CST.
@@ -1412,141 +1490,52 @@ export class Node {
1412
1490
  return ret === 0 ? undefined : Node.__wrap(ret);
1413
1491
  }
1414
1492
  /**
1415
- * Returns the parent node, throwing if this is the root.
1416
- * @returns The parent node
1417
- * @throws If this node has no parent
1418
- * @returns {Node}
1419
- */
1420
- parentOrThrow() {
1421
- const ret = wasm.node_parentOrThrow(this.__wbg_ptr);
1422
- if (ret[2]) {
1423
- throw takeFromExternrefTable0(ret[1]);
1424
- }
1425
- return Node.__wrap(ret[0]);
1426
- }
1427
- /**
1428
- * Returns the index of this node within its parent's children.
1429
- * @returns The child index
1430
- * @returns {number}
1431
- */
1432
- childIndex() {
1433
- const ret = wasm.node_childIndex(this.__wbg_ptr);
1434
- return ret >>> 0;
1435
- }
1436
- /**
1437
- * Returns all ancestor nodes from parent to root.
1438
- * @returns Array of ancestor nodes
1439
- * @returns {Node[]}
1493
+ * Removes this node from its parent.
1494
+ * Works for any node kind, including whitespace, comments, tokens, containers, and leaf values.
1495
+ * After calling this method, the node is detached from the CST and can no longer be used.
1440
1496
  */
1441
- ancestors() {
1442
- const ret = wasm.node_ancestors(this.__wbg_ptr);
1443
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1444
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1445
- return v1;
1497
+ remove() {
1498
+ const ptr = this.__destroy_into_raw();
1499
+ wasm.node_remove(ptr);
1446
1500
  }
1447
1501
  /**
1448
- * Returns the previous sibling node.
1449
- * @returns The previous sibling, or undefined if this is the first child
1450
- * @returns {Node | undefined}
1502
+ * Returns true if this node is a leaf value (string, number, boolean, null).
1503
+ * @returns true if this is a leaf node
1504
+ * @returns {boolean}
1451
1505
  */
1452
- previousSibling() {
1453
- const ret = wasm.node_previousSibling(this.__wbg_ptr);
1454
- return ret === 0 ? undefined : Node.__wrap(ret);
1506
+ isLeaf() {
1507
+ const ret = wasm.node_isLeaf(this.__wbg_ptr);
1508
+ return ret !== 0;
1455
1509
  }
1456
1510
  /**
1457
- * Returns all previous sibling nodes.
1458
- * @returns Array of previous siblings
1459
- * @returns {Node[]}
1511
+ * Returns true if this node is a null keyword.
1512
+ * @returns true if this node represents null
1513
+ * @returns {boolean}
1460
1514
  */
1461
- previousSiblings() {
1462
- const ret = wasm.node_previousSiblings(this.__wbg_ptr);
1463
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1464
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1465
- return v1;
1515
+ isNull() {
1516
+ const ret = wasm.node_isNull(this.__wbg_ptr);
1517
+ return ret !== 0;
1466
1518
  }
1467
1519
  /**
1468
- * Returns the next sibling node.
1469
- * @returns The next sibling, or undefined if this is the last child
1470
- * @returns {Node | undefined}
1520
+ * Converts this node to an array if it is one.
1521
+ * @returns The array, or undefined if this node is not an array
1522
+ * @returns {JsonArray | undefined}
1471
1523
  */
1472
- nextSibling() {
1473
- const ret = wasm.node_nextSibling(this.__wbg_ptr);
1474
- return ret === 0 ? undefined : Node.__wrap(ret);
1524
+ asArray() {
1525
+ const ret = wasm.node_asArray(this.__wbg_ptr);
1526
+ return ret === 0 ? undefined : JsonArray.__wrap(ret);
1475
1527
  }
1476
1528
  /**
1477
- * Returns all next sibling nodes.
1478
- * @returns Array of next siblings
1529
+ * Returns all child nodes including whitespace and punctuation.
1530
+ * @returns Array of all child nodes
1479
1531
  * @returns {Node[]}
1480
1532
  */
1481
- nextSiblings() {
1482
- const ret = wasm.node_nextSiblings(this.__wbg_ptr);
1533
+ children() {
1534
+ const ret = wasm.node_children(this.__wbg_ptr);
1483
1535
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1484
1536
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1485
1537
  return v1;
1486
1538
  }
1487
- /**
1488
- * Returns the root node of the document.
1489
- * @returns The root node, or undefined if detached
1490
- * @returns {RootNode | undefined}
1491
- */
1492
- rootNode() {
1493
- const ret = wasm.node_rootNode(this.__wbg_ptr);
1494
- return ret === 0 ? undefined : RootNode.__wrap(ret);
1495
- }
1496
- /**
1497
- * Returns the root node, throwing if detached.
1498
- * @returns The root node
1499
- * @throws If this node is detached from the CST
1500
- * @returns {RootNode}
1501
- */
1502
- rootNodeOrThrow() {
1503
- const ret = wasm.node_rootNodeOrThrow(this.__wbg_ptr);
1504
- if (ret[2]) {
1505
- throw takeFromExternrefTable0(ret[1]);
1506
- }
1507
- return RootNode.__wrap(ret[0]);
1508
- }
1509
- /**
1510
- * Returns the indentation string used at this node's depth.
1511
- * @returns The indentation string, or undefined if not applicable
1512
- * @returns {string | undefined}
1513
- */
1514
- indentText() {
1515
- const ret = wasm.node_indentText(this.__wbg_ptr);
1516
- let v1;
1517
- if (ret[0] !== 0) {
1518
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1519
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1520
- }
1521
- return v1;
1522
- }
1523
- /**
1524
- * Returns whether this node's container uses trailing commas.
1525
- * @returns true if trailing commas are used
1526
- * @returns {boolean}
1527
- */
1528
- usesTrailingCommas() {
1529
- const ret = wasm.node_usesTrailingCommas(this.__wbg_ptr);
1530
- return ret !== 0;
1531
- }
1532
- /**
1533
- * Returns true if this node is trivia (whitespace or comments).
1534
- * @returns true if this node is trivia
1535
- * @returns {boolean}
1536
- */
1537
- isTrivia() {
1538
- const ret = wasm.node_isTrivia(this.__wbg_ptr);
1539
- return ret !== 0;
1540
- }
1541
- /**
1542
- * Returns true if this node is a newline character.
1543
- * @returns true if this node is a newline
1544
- * @returns {boolean}
1545
- */
1546
- isNewline() {
1547
- const ret = wasm.node_isNewline(this.__wbg_ptr);
1548
- return ret !== 0;
1549
- }
1550
1539
  /**
1551
1540
  * Returns true if this node is a comma token.
1552
1541
  * @returns true if this node is a comma
@@ -1556,15 +1545,6 @@ export class Node {
1556
1545
  const ret = wasm.node_isComma(this.__wbg_ptr);
1557
1546
  return ret !== 0;
1558
1547
  }
1559
- /**
1560
- * Returns true if this node is a comment.
1561
- * @returns true if this node is a comment
1562
- * @returns {boolean}
1563
- */
1564
- isComment() {
1565
- const ret = wasm.node_isComment(this.__wbg_ptr);
1566
- return ret !== 0;
1567
- }
1568
1548
  /**
1569
1549
  * Returns true if this node is a punctuation token (bracket, brace, colon, comma).
1570
1550
  * @returns true if this node is a token
@@ -1575,21 +1555,44 @@ export class Node {
1575
1555
  return ret !== 0;
1576
1556
  }
1577
1557
  /**
1578
- * Returns true if this node is whitespace.
1579
- * @returns true if this node is whitespace
1580
- * @returns {boolean}
1558
+ * Converts this CST node to a plain JavaScript value.
1559
+ * This recursively converts objects, arrays, and primitives to their JavaScript equivalents.
1560
+ * Comments and formatting information are discarded.
1561
+ * @returns The plain JavaScript value (object, array, string, number, boolean, or null)
1562
+ * @throws If the node contains invalid values that cannot be converted
1563
+ * @returns {any}
1581
1564
  */
1582
- isWhitespace() {
1583
- const ret = wasm.node_isWhitespace(this.__wbg_ptr);
1584
- return ret !== 0;
1565
+ toValue() {
1566
+ const ret = wasm.node_toValue(this.__wbg_ptr);
1567
+ return ret;
1585
1568
  }
1586
1569
  /**
1587
- * Returns the character if this node is a single-character token.
1588
- * @returns The token character, or undefined if not a token
1570
+ * Returns all ancestor nodes from parent to root.
1571
+ * @returns Array of ancestor nodes
1572
+ * @returns {Node[]}
1573
+ */
1574
+ ancestors() {
1575
+ const ret = wasm.node_ancestors(this.__wbg_ptr);
1576
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1577
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1578
+ return v1;
1579
+ }
1580
+ /**
1581
+ * Converts this node to an object if it is one.
1582
+ * @returns The object, or undefined if this node is not an object
1583
+ * @returns {JsonObject | undefined}
1584
+ */
1585
+ asObject() {
1586
+ const ret = wasm.node_asObject(this.__wbg_ptr);
1587
+ return ret === 0 ? undefined : JsonObject.__wrap(ret);
1588
+ }
1589
+ /**
1590
+ * Returns the decoded string value if this node is a string literal.
1591
+ * @returns The string value, or undefined if this node is not a string
1589
1592
  * @returns {string | undefined}
1590
1593
  */
1591
- tokenChar() {
1592
- const ret = wasm.node_tokenChar(this.__wbg_ptr);
1594
+ asString() {
1595
+ const ret = wasm.node_asString(this.__wbg_ptr);
1593
1596
  let v1;
1594
1597
  if (ret[0] !== 0) {
1595
1598
  v1 = getStringFromWasm0(ret[0], ret[1]).slice();
@@ -1598,63 +1601,44 @@ export class Node {
1598
1601
  return v1;
1599
1602
  }
1600
1603
  /**
1601
- * Returns the element index if this node is an array element.
1602
- * @returns The element index, or undefined if not an array element
1603
- * @returns {number | undefined}
1604
- */
1605
- elementIndex() {
1606
- const ret = wasm.node_elementIndex(this.__wbg_ptr);
1607
- return ret === 0x100000001 ? undefined : ret;
1608
- }
1609
- /**
1610
- * Returns all child nodes including whitespace and punctuation.
1611
- * @returns Array of all child nodes
1612
- * @returns {Node[]}
1604
+ * Returns true if this node is a number literal.
1605
+ * @returns true if this node is a number
1606
+ * @returns {boolean}
1613
1607
  */
1614
- children() {
1615
- const ret = wasm.node_children(this.__wbg_ptr);
1616
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1617
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1618
- return v1;
1608
+ isNumber() {
1609
+ const ret = wasm.node_isNumber(this.__wbg_ptr);
1610
+ return ret !== 0;
1619
1611
  }
1620
1612
  /**
1621
- * Returns child nodes excluding whitespace, comments, and punctuation.
1622
- * @returns Array of significant child nodes
1623
- * @returns {Node[]}
1613
+ * Returns true if this node is a string literal.
1614
+ * @returns true if this node is a string
1615
+ * @returns {boolean}
1624
1616
  */
1625
- childrenExcludeTriviaAndTokens() {
1626
- const ret = wasm.node_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
1627
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1628
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1629
- return v1;
1617
+ isString() {
1618
+ const ret = wasm.node_isString(this.__wbg_ptr);
1619
+ return ret !== 0;
1630
1620
  }
1631
1621
  /**
1632
- * Returns the child node at the specified index.
1633
- * @param index - The child index
1634
- * @returns The child node, or undefined if index is out of bounds
1635
- * @param {number} index
1636
- * @returns {Node | undefined}
1622
+ * Returns true if this node is trivia (whitespace or comments).
1623
+ * @returns true if this node is trivia
1624
+ * @returns {boolean}
1637
1625
  */
1638
- childAtIndex(index) {
1639
- const ret = wasm.node_childAtIndex(this.__wbg_ptr, index);
1640
- return ret === 0 ? undefined : Node.__wrap(ret);
1626
+ isTrivia() {
1627
+ const ret = wasm.node_isTrivia(this.__wbg_ptr);
1628
+ return ret !== 0;
1641
1629
  }
1642
1630
  /**
1643
- * Converts this CST node to a plain JavaScript value.
1644
- * This recursively converts objects, arrays, and primitives to their JavaScript equivalents.
1645
- * Comments and formatting information are discarded.
1646
- * @returns The plain JavaScript value (object, array, string, number, boolean, or null)
1647
- * @throws If the node contains invalid values that cannot be converted
1648
- * @returns {any}
1631
+ * Returns the root node of the document.
1632
+ * @returns The root node, or undefined if detached
1633
+ * @returns {RootNode | undefined}
1649
1634
  */
1650
- toValue() {
1651
- const ret = wasm.node_toValue(this.__wbg_ptr);
1652
- return ret;
1635
+ rootNode() {
1636
+ const ret = wasm.node_rootNode(this.__wbg_ptr);
1637
+ return ret === 0 ? undefined : RootNode.__wrap(ret);
1653
1638
  }
1654
1639
  }
1655
- const NullKeywordFinalization = (typeof FinalizationRegistry === "undefined")
1656
- ? { register: () => { }, unregister: () => { } }
1657
- : new FinalizationRegistry((ptr) => wasm.__wbg_nullkeyword_free(ptr >>> 0, 1));
1640
+ if (Symbol.dispose)
1641
+ Node.prototype[Symbol.dispose] = Node.prototype.free;
1658
1642
  /**
1659
1643
  * Represents a null keyword node in the CST.
1660
1644
  */
@@ -1676,6 +1660,38 @@ export class NullKeyword {
1676
1660
  const ptr = this.__destroy_into_raw();
1677
1661
  wasm.__wbg_nullkeyword_free(ptr, 0);
1678
1662
  }
1663
+ /**
1664
+ * Returns the index of this node within its parent's children.
1665
+ * @returns The child index
1666
+ * @returns {number}
1667
+ */
1668
+ childIndex() {
1669
+ const ret = wasm.nullkeyword_childIndex(this.__wbg_ptr);
1670
+ return ret >>> 0;
1671
+ }
1672
+ /**
1673
+ * Returns the indentation string used at this node's depth.
1674
+ * @returns The indentation string, or undefined if not applicable
1675
+ * @returns {string | undefined}
1676
+ */
1677
+ indentText() {
1678
+ const ret = wasm.nullkeyword_indentText(this.__wbg_ptr);
1679
+ let v1;
1680
+ if (ret[0] !== 0) {
1681
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1682
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1683
+ }
1684
+ return v1;
1685
+ }
1686
+ /**
1687
+ * Returns the next sibling node.
1688
+ * @returns The next sibling, or undefined if this is the last child
1689
+ * @returns {Node | undefined}
1690
+ */
1691
+ nextSibling() {
1692
+ const ret = wasm.nullkeyword_nextSibling(this.__wbg_ptr);
1693
+ return ret === 0 ? undefined : Node.__wrap(ret);
1694
+ }
1679
1695
  /**
1680
1696
  * Replaces this null keyword with a new value.
1681
1697
  * @param replacement - The new value to replace this null with
@@ -1691,42 +1707,16 @@ export class NullKeyword {
1691
1707
  return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
1692
1708
  }
1693
1709
  /**
1694
- * Removes this node from its parent.
1695
- * After calling this method, the node is detached from the CST and can no longer be used.
1696
- */
1697
- remove() {
1698
- const ptr = this.__destroy_into_raw();
1699
- wasm.nullkeyword_remove(ptr);
1700
- }
1701
- /**
1702
- * Returns the parent node in the CST.
1703
- * @returns The parent node, or undefined if this is the root
1704
- * @returns {Node | undefined}
1705
- */
1706
- parent() {
1707
- const ret = wasm.nullkeyword_parent(this.__wbg_ptr);
1708
- return ret === 0 ? undefined : Node.__wrap(ret);
1709
- }
1710
- /**
1711
- * Returns all ancestor nodes from parent to root.
1712
- * @returns Array of ancestor nodes
1710
+ * Returns all next sibling nodes.
1711
+ * @returns Array of next siblings
1713
1712
  * @returns {Node[]}
1714
1713
  */
1715
- ancestors() {
1716
- const ret = wasm.nullkeyword_ancestors(this.__wbg_ptr);
1714
+ nextSiblings() {
1715
+ const ret = wasm.nullkeyword_nextSiblings(this.__wbg_ptr);
1717
1716
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1718
1717
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1719
1718
  return v1;
1720
1719
  }
1721
- /**
1722
- * Returns the index of this node within its parent's children.
1723
- * @returns The child index
1724
- * @returns {number}
1725
- */
1726
- childIndex() {
1727
- const ret = wasm.nullkeyword_childIndex(this.__wbg_ptr);
1728
- return ret >>> 0;
1729
- }
1730
1720
  /**
1731
1721
  * Returns the previous sibling node.
1732
1722
  * @returns The previous sibling, or undefined if this is the first child
@@ -1748,21 +1738,38 @@ export class NullKeyword {
1748
1738
  return v1;
1749
1739
  }
1750
1740
  /**
1751
- * Returns the next sibling node.
1752
- * @returns The next sibling, or undefined if this is the last child
1741
+ * Returns whether this node's container uses trailing commas.
1742
+ * @returns true if trailing commas are used
1743
+ * @returns {boolean}
1744
+ */
1745
+ usesTrailingCommas() {
1746
+ const ret = wasm.nullkeyword_usesTrailingCommas(this.__wbg_ptr);
1747
+ return ret !== 0;
1748
+ }
1749
+ /**
1750
+ * Returns the parent node in the CST.
1751
+ * @returns The parent node, or undefined if this is the root
1753
1752
  * @returns {Node | undefined}
1754
1753
  */
1755
- nextSibling() {
1756
- const ret = wasm.nullkeyword_nextSibling(this.__wbg_ptr);
1754
+ parent() {
1755
+ const ret = wasm.nullkeyword_parent(this.__wbg_ptr);
1757
1756
  return ret === 0 ? undefined : Node.__wrap(ret);
1758
1757
  }
1759
1758
  /**
1760
- * Returns all next sibling nodes.
1761
- * @returns Array of next siblings
1759
+ * Removes this node from its parent.
1760
+ * After calling this method, the node is detached from the CST and can no longer be used.
1761
+ */
1762
+ remove() {
1763
+ const ptr = this.__destroy_into_raw();
1764
+ wasm.nullkeyword_remove(ptr);
1765
+ }
1766
+ /**
1767
+ * Returns all ancestor nodes from parent to root.
1768
+ * @returns Array of ancestor nodes
1762
1769
  * @returns {Node[]}
1763
1770
  */
1764
- nextSiblings() {
1765
- const ret = wasm.nullkeyword_nextSiblings(this.__wbg_ptr);
1771
+ ancestors() {
1772
+ const ret = wasm.nullkeyword_ancestors(this.__wbg_ptr);
1766
1773
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1767
1774
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1768
1775
  return v1;
@@ -1776,33 +1783,10 @@ export class NullKeyword {
1776
1783
  const ret = wasm.nullkeyword_rootNode(this.__wbg_ptr);
1777
1784
  return ret === 0 ? undefined : RootNode.__wrap(ret);
1778
1785
  }
1779
- /**
1780
- * Returns the indentation string used at this node's depth.
1781
- * @returns The indentation string, or undefined if not applicable
1782
- * @returns {string | undefined}
1783
- */
1784
- indentText() {
1785
- const ret = wasm.nullkeyword_indentText(this.__wbg_ptr);
1786
- let v1;
1787
- if (ret[0] !== 0) {
1788
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1789
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1790
- }
1791
- return v1;
1792
- }
1793
- /**
1794
- * Returns whether this node's container uses trailing commas.
1795
- * @returns true if trailing commas are used
1796
- * @returns {boolean}
1797
- */
1798
- usesTrailingCommas() {
1799
- const ret = wasm.nullkeyword_usesTrailingCommas(this.__wbg_ptr);
1800
- return ret !== 0;
1801
- }
1802
1786
  }
1803
- const NumberLitFinalization = (typeof FinalizationRegistry === "undefined")
1804
- ? { register: () => { }, unregister: () => { } }
1805
- : new FinalizationRegistry((ptr) => wasm.__wbg_numberlit_free(ptr >>> 0, 1));
1787
+ if (Symbol.dispose) {
1788
+ NullKeyword.prototype[Symbol.dispose] = NullKeyword.prototype.free;
1789
+ }
1806
1790
  /**
1807
1791
  * Represents a number literal node in the CST.
1808
1792
  * Provides methods for manipulating number values.
@@ -1826,34 +1810,36 @@ export class NumberLit {
1826
1810
  wasm.__wbg_numberlit_free(ptr, 0);
1827
1811
  }
1828
1812
  /**
1829
- * Returns the raw string representation of the number.
1830
- * Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
1831
- * @returns The number as a string
1832
- * @returns {string}
1813
+ * Returns the index of this node within its parent's children.
1814
+ * @returns The child index
1815
+ * @returns {number}
1833
1816
  */
1834
- value() {
1835
- let deferred1_0;
1836
- let deferred1_1;
1837
- try {
1838
- const ret = wasm.numberlit_value(this.__wbg_ptr);
1839
- deferred1_0 = ret[0];
1840
- deferred1_1 = ret[1];
1841
- return getStringFromWasm0(ret[0], ret[1]);
1842
- }
1843
- finally {
1844
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1817
+ childIndex() {
1818
+ const ret = wasm.numberlit_childIndex(this.__wbg_ptr);
1819
+ return ret >>> 0;
1820
+ }
1821
+ /**
1822
+ * Returns the indentation string used at this node's depth.
1823
+ * @returns The indentation string, or undefined if not applicable
1824
+ * @returns {string | undefined}
1825
+ */
1826
+ indentText() {
1827
+ const ret = wasm.numberlit_indentText(this.__wbg_ptr);
1828
+ let v1;
1829
+ if (ret[0] !== 0) {
1830
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1831
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1845
1832
  }
1833
+ return v1;
1846
1834
  }
1847
1835
  /**
1848
- * Sets the raw number value.
1849
- * The value should be a valid JSON number string (e.g., "42", "3.14", "1e10").
1850
- * @param value - The raw number string to set
1851
- * @param {string} value
1836
+ * Returns the next sibling node.
1837
+ * @returns The next sibling, or undefined if this is the last child
1838
+ * @returns {Node | undefined}
1852
1839
  */
1853
- setRawValue(value) {
1854
- const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1855
- const len0 = WASM_VECTOR_LEN;
1856
- wasm.numberlit_setRawValue(this.__wbg_ptr, ptr0, len0);
1840
+ nextSibling() {
1841
+ const ret = wasm.numberlit_nextSibling(this.__wbg_ptr);
1842
+ return ret === 0 ? undefined : Node.__wrap(ret);
1857
1843
  }
1858
1844
  /**
1859
1845
  * Replaces this number literal with a new value.
@@ -1870,41 +1856,26 @@ export class NumberLit {
1870
1856
  return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
1871
1857
  }
1872
1858
  /**
1873
- * Removes this node from its parent.
1874
- * After calling this method, the node is detached from the CST and can no longer be used.
1875
- */
1876
- remove() {
1877
- const ptr = this.__destroy_into_raw();
1878
- wasm.numberlit_remove(ptr);
1879
- }
1880
- /**
1881
- * Returns the parent node in the CST.
1882
- * @returns The parent node, or undefined if this is the root
1883
- * @returns {Node | undefined}
1884
- */
1885
- parent() {
1886
- const ret = wasm.numberlit_parent(this.__wbg_ptr);
1887
- return ret === 0 ? undefined : Node.__wrap(ret);
1888
- }
1889
- /**
1890
- * Returns all ancestor nodes from parent to root.
1891
- * @returns Array of ancestor nodes
1859
+ * Returns all next sibling nodes.
1860
+ * @returns Array of next siblings
1892
1861
  * @returns {Node[]}
1893
1862
  */
1894
- ancestors() {
1895
- const ret = wasm.numberlit_ancestors(this.__wbg_ptr);
1863
+ nextSiblings() {
1864
+ const ret = wasm.numberlit_nextSiblings(this.__wbg_ptr);
1896
1865
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1897
1866
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1898
1867
  return v1;
1899
1868
  }
1900
1869
  /**
1901
- * Returns the index of this node within its parent's children.
1902
- * @returns The child index
1903
- * @returns {number}
1870
+ * Sets the raw number value.
1871
+ * The value should be a valid JSON number string (e.g., "42", "3.14", "1e10").
1872
+ * @param value - The raw number string to set
1873
+ * @param {string} value
1904
1874
  */
1905
- childIndex() {
1906
- const ret = wasm.numberlit_childIndex(this.__wbg_ptr);
1907
- return ret >>> 0;
1875
+ setRawValue(value) {
1876
+ const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1877
+ const len0 = WASM_VECTOR_LEN;
1878
+ wasm.numberlit_setRawValue(this.__wbg_ptr, ptr0, len0);
1908
1879
  }
1909
1880
  /**
1910
1881
  * Returns the previous sibling node.
@@ -1927,21 +1898,57 @@ export class NumberLit {
1927
1898
  return v1;
1928
1899
  }
1929
1900
  /**
1930
- * Returns the next sibling node.
1931
- * @returns The next sibling, or undefined if this is the last child
1901
+ * Returns whether this node's container uses trailing commas.
1902
+ * @returns true if trailing commas are used
1903
+ * @returns {boolean}
1904
+ */
1905
+ usesTrailingCommas() {
1906
+ const ret = wasm.numberlit_usesTrailingCommas(this.__wbg_ptr);
1907
+ return ret !== 0;
1908
+ }
1909
+ /**
1910
+ * Returns the raw string representation of the number.
1911
+ * Returns a string to preserve the exact formatting (e.g., "1.0" vs "1", "1e10" vs "10000000000").
1912
+ * @returns The number as a string
1913
+ * @returns {string}
1914
+ */
1915
+ value() {
1916
+ let deferred1_0;
1917
+ let deferred1_1;
1918
+ try {
1919
+ const ret = wasm.numberlit_value(this.__wbg_ptr);
1920
+ deferred1_0 = ret[0];
1921
+ deferred1_1 = ret[1];
1922
+ return getStringFromWasm0(ret[0], ret[1]);
1923
+ }
1924
+ finally {
1925
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1926
+ }
1927
+ }
1928
+ /**
1929
+ * Returns the parent node in the CST.
1930
+ * @returns The parent node, or undefined if this is the root
1932
1931
  * @returns {Node | undefined}
1933
1932
  */
1934
- nextSibling() {
1935
- const ret = wasm.numberlit_nextSibling(this.__wbg_ptr);
1933
+ parent() {
1934
+ const ret = wasm.numberlit_parent(this.__wbg_ptr);
1936
1935
  return ret === 0 ? undefined : Node.__wrap(ret);
1937
1936
  }
1938
1937
  /**
1939
- * Returns all next sibling nodes.
1940
- * @returns Array of next siblings
1938
+ * Removes this node from its parent.
1939
+ * After calling this method, the node is detached from the CST and can no longer be used.
1940
+ */
1941
+ remove() {
1942
+ const ptr = this.__destroy_into_raw();
1943
+ wasm.numberlit_remove(ptr);
1944
+ }
1945
+ /**
1946
+ * Returns all ancestor nodes from parent to root.
1947
+ * @returns Array of ancestor nodes
1941
1948
  * @returns {Node[]}
1942
1949
  */
1943
- nextSiblings() {
1944
- const ret = wasm.numberlit_nextSiblings(this.__wbg_ptr);
1950
+ ancestors() {
1951
+ const ret = wasm.numberlit_ancestors(this.__wbg_ptr);
1945
1952
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1946
1953
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1947
1954
  return v1;
@@ -1955,33 +1962,10 @@ export class NumberLit {
1955
1962
  const ret = wasm.numberlit_rootNode(this.__wbg_ptr);
1956
1963
  return ret === 0 ? undefined : RootNode.__wrap(ret);
1957
1964
  }
1958
- /**
1959
- * Returns the indentation string used at this node's depth.
1960
- * @returns The indentation string, or undefined if not applicable
1961
- * @returns {string | undefined}
1962
- */
1963
- indentText() {
1964
- const ret = wasm.numberlit_indentText(this.__wbg_ptr);
1965
- let v1;
1966
- if (ret[0] !== 0) {
1967
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1968
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1969
- }
1970
- return v1;
1971
- }
1972
- /**
1973
- * Returns whether this node's container uses trailing commas.
1974
- * @returns true if trailing commas are used
1975
- * @returns {boolean}
1976
- */
1977
- usesTrailingCommas() {
1978
- const ret = wasm.numberlit_usesTrailingCommas(this.__wbg_ptr);
1979
- return ret !== 0;
1980
- }
1981
1965
  }
1982
- const ObjectPropFinalization = (typeof FinalizationRegistry === "undefined")
1983
- ? { register: () => { }, unregister: () => { } }
1984
- : new FinalizationRegistry((ptr) => wasm.__wbg_objectprop_free(ptr >>> 0, 1));
1966
+ if (Symbol.dispose) {
1967
+ NumberLit.prototype[Symbol.dispose] = NumberLit.prototype.free;
1968
+ }
1985
1969
  /**
1986
1970
  * Represents an object property (key-value pair) in the CST.
1987
1971
  * Provides methods for accessing and manipulating both the property name and its value.
@@ -2005,141 +1989,37 @@ export class ObjectProp {
2005
1989
  wasm.__wbg_objectprop_free(ptr, 0);
2006
1990
  }
2007
1991
  /**
2008
- * Returns the property name.
2009
- * @returns The property name, or undefined if malformed
2010
- * @returns {ObjectPropName | undefined}
1992
+ * Returns the index of this node within its parent's children.
1993
+ * @returns The child index
1994
+ * @returns {number}
2011
1995
  */
2012
- name() {
2013
- const ret = wasm.objectprop_name(this.__wbg_ptr);
2014
- return ret === 0 ? undefined : ObjectPropName.__wrap(ret);
1996
+ childIndex() {
1997
+ const ret = wasm.objectprop_childIndex(this.__wbg_ptr);
1998
+ return ret >>> 0;
2015
1999
  }
2016
2000
  /**
2017
- * Returns the property name, throwing if malformed.
2018
- * @returns The property name
2019
- * @throws If the property name is malformed
2020
- * @returns {ObjectPropName}
2001
+ * Returns the indentation string used at this node's depth.
2002
+ * @returns The indentation string, or undefined if not applicable
2003
+ * @returns {string | undefined}
2021
2004
  */
2022
- nameOrThrow() {
2023
- const ret = wasm.objectprop_nameOrThrow(this.__wbg_ptr);
2024
- if (ret[2]) {
2025
- throw takeFromExternrefTable0(ret[1]);
2005
+ indentText() {
2006
+ const ret = wasm.objectprop_indentText(this.__wbg_ptr);
2007
+ let v1;
2008
+ if (ret[0] !== 0) {
2009
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2010
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2026
2011
  }
2027
- return ObjectPropName.__wrap(ret[0]);
2012
+ return v1;
2028
2013
  }
2029
2014
  /**
2030
- * Returns the property value.
2031
- * @returns The property value, or undefined if malformed
2015
+ * Returns the next sibling node.
2016
+ * @returns The next sibling, or undefined if this is the last child
2032
2017
  * @returns {Node | undefined}
2033
2018
  */
2034
- value() {
2035
- const ret = wasm.objectprop_value(this.__wbg_ptr);
2019
+ nextSibling() {
2020
+ const ret = wasm.objectprop_nextSibling(this.__wbg_ptr);
2036
2021
  return ret === 0 ? undefined : Node.__wrap(ret);
2037
2022
  }
2038
- /**
2039
- * Returns the property value, throwing if malformed.
2040
- * @returns The property value
2041
- * @throws If the property value is malformed
2042
- * @returns {Node}
2043
- */
2044
- valueOrThrow() {
2045
- const ret = wasm.objectprop_valueOrThrow(this.__wbg_ptr);
2046
- if (ret[2]) {
2047
- throw takeFromExternrefTable0(ret[1]);
2048
- }
2049
- return Node.__wrap(ret[0]);
2050
- }
2051
- /**
2052
- * Returns the property value if it's an object.
2053
- * @returns The object value, or undefined if not an object
2054
- * @returns {JsonObject | undefined}
2055
- */
2056
- valueIfObject() {
2057
- const ret = wasm.objectprop_valueIfObject(this.__wbg_ptr);
2058
- return ret === 0 ? undefined : JsonObject.__wrap(ret);
2059
- }
2060
- /**
2061
- * Returns the property value as an object, throwing if not an object.
2062
- * @returns The object value
2063
- * @throws If the property value is not an object
2064
- * @returns {JsonObject}
2065
- */
2066
- valueIfObjectOrThrow() {
2067
- const ret = wasm.objectprop_valueIfObjectOrThrow(this.__wbg_ptr);
2068
- if (ret[2]) {
2069
- throw takeFromExternrefTable0(ret[1]);
2070
- }
2071
- return JsonObject.__wrap(ret[0]);
2072
- }
2073
- /**
2074
- * Gets the property value as an object, replacing the value with an empty object if needed.
2075
- * Always returns an object by replacing non-object values.
2076
- * @returns The object value (always succeeds)
2077
- * @returns {JsonObject}
2078
- */
2079
- valueIfObjectOrForce() {
2080
- const ret = wasm.objectprop_valueIfObjectOrForce(this.__wbg_ptr);
2081
- return JsonObject.__wrap(ret);
2082
- }
2083
- /**
2084
- * Returns the property value if it's an array.
2085
- * @returns The array value, or undefined if not an array
2086
- * @returns {JsonArray | undefined}
2087
- */
2088
- valueIfArray() {
2089
- const ret = wasm.objectprop_valueIfArray(this.__wbg_ptr);
2090
- return ret === 0 ? undefined : JsonArray.__wrap(ret);
2091
- }
2092
- /**
2093
- * Returns the property value as an array, throwing if not an array.
2094
- * @returns The array value
2095
- * @throws If the property value is not an array
2096
- * @returns {JsonArray}
2097
- */
2098
- valueIfArrayOrThrow() {
2099
- const ret = wasm.objectprop_valueIfArrayOrThrow(this.__wbg_ptr);
2100
- if (ret[2]) {
2101
- throw takeFromExternrefTable0(ret[1]);
2102
- }
2103
- return JsonArray.__wrap(ret[0]);
2104
- }
2105
- /**
2106
- * Gets the property value as an array, replacing the value with an empty array if needed.
2107
- * Always returns an array by replacing non-array values.
2108
- * @returns The array value (always succeeds)
2109
- * @returns {JsonArray}
2110
- */
2111
- valueIfArrayOrForce() {
2112
- const ret = wasm.objectprop_valueIfArrayOrForce(this.__wbg_ptr);
2113
- return JsonArray.__wrap(ret);
2114
- }
2115
- /**
2116
- * Removes this property from its parent object.
2117
- * After calling this method, the property is detached from the CST and can no longer be used.
2118
- */
2119
- remove() {
2120
- const ptr = this.__destroy_into_raw();
2121
- wasm.objectprop_remove(ptr);
2122
- }
2123
- /**
2124
- * Returns the index of this property within its parent object.
2125
- * @returns The property index
2126
- * @returns {number}
2127
- */
2128
- propertyIndex() {
2129
- const ret = wasm.objectprop_propertyIndex(this.__wbg_ptr);
2130
- return ret >>> 0;
2131
- }
2132
- /**
2133
- * Sets the value of this property.
2134
- * @param value - The new value to set
2135
- * @param {any} value
2136
- */
2137
- setValue(value) {
2138
- const ret = wasm.objectprop_setValue(this.__wbg_ptr, value);
2139
- if (ret[1]) {
2140
- throw takeFromExternrefTable0(ret[0]);
2141
- }
2142
- }
2143
2023
  /**
2144
2024
  * Replaces this property with a new property.
2145
2025
  * This allows changing both the property name and its value.
@@ -2160,34 +2040,89 @@ export class ObjectProp {
2160
2040
  return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
2161
2041
  }
2162
2042
  /**
2163
- * Returns the parent node in the CST.
2164
- * @returns The parent node, or undefined if this is the root
2165
- * @returns {Node | undefined}
2043
+ * Returns the property name, throwing if malformed.
2044
+ * @returns The property name
2045
+ * @throws If the property name is malformed
2046
+ * @returns {ObjectPropName}
2166
2047
  */
2167
- parent() {
2168
- const ret = wasm.objectprop_parent(this.__wbg_ptr);
2169
- return ret === 0 ? undefined : Node.__wrap(ret);
2048
+ nameOrThrow() {
2049
+ const ret = wasm.objectprop_nameOrThrow(this.__wbg_ptr);
2050
+ if (ret[2]) {
2051
+ throw takeFromExternrefTable0(ret[1]);
2052
+ }
2053
+ return ObjectPropName.__wrap(ret[0]);
2170
2054
  }
2171
2055
  /**
2172
- * Returns all ancestor nodes from parent to root.
2173
- * @returns Array of ancestor nodes
2056
+ * Returns the next property in the same object.
2057
+ * @returns The next property, or undefined if this is the last property
2058
+ * @returns {ObjectProp | undefined}
2059
+ */
2060
+ nextProperty() {
2061
+ const ret = wasm.objectprop_nextProperty(this.__wbg_ptr);
2062
+ return ret === 0 ? undefined : ObjectProp.__wrap(ret);
2063
+ }
2064
+ /**
2065
+ * Returns all next sibling nodes.
2066
+ * @returns Array of next siblings
2174
2067
  * @returns {Node[]}
2175
2068
  */
2176
- ancestors() {
2177
- const ret = wasm.objectprop_ancestors(this.__wbg_ptr);
2069
+ nextSiblings() {
2070
+ const ret = wasm.objectprop_nextSiblings(this.__wbg_ptr);
2178
2071
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2179
2072
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2180
2073
  return v1;
2181
2074
  }
2182
2075
  /**
2183
- * Returns the index of this node within its parent's children.
2184
- * @returns The child index
2076
+ * Returns the child node at the specified index.
2077
+ * @param index - The child index
2078
+ * @returns The child node, or undefined if index is out of bounds
2079
+ * @param {number} index
2080
+ * @returns {Node | undefined}
2081
+ */
2082
+ childAtIndex(index) {
2083
+ const ret = wasm.objectprop_childAtIndex(this.__wbg_ptr, index);
2084
+ return ret === 0 ? undefined : Node.__wrap(ret);
2085
+ }
2086
+ /**
2087
+ * Returns the index of this property within its parent object.
2088
+ * @returns The property index
2185
2089
  * @returns {number}
2186
2090
  */
2187
- childIndex() {
2188
- const ret = wasm.objectprop_childIndex(this.__wbg_ptr);
2091
+ propertyIndex() {
2092
+ const ret = wasm.objectprop_propertyIndex(this.__wbg_ptr);
2189
2093
  return ret >>> 0;
2190
2094
  }
2095
+ /**
2096
+ * Returns the property value if it's an array.
2097
+ * @returns The array value, or undefined if not an array
2098
+ * @returns {JsonArray | undefined}
2099
+ */
2100
+ valueIfArray() {
2101
+ const ret = wasm.objectprop_valueIfArray(this.__wbg_ptr);
2102
+ return ret === 0 ? undefined : JsonArray.__wrap(ret);
2103
+ }
2104
+ /**
2105
+ * Returns the property value, throwing if malformed.
2106
+ * @returns The property value
2107
+ * @throws If the property value is malformed
2108
+ * @returns {Node}
2109
+ */
2110
+ valueOrThrow() {
2111
+ const ret = wasm.objectprop_valueOrThrow(this.__wbg_ptr);
2112
+ if (ret[2]) {
2113
+ throw takeFromExternrefTable0(ret[1]);
2114
+ }
2115
+ return Node.__wrap(ret[0]);
2116
+ }
2117
+ /**
2118
+ * Returns the property value if it's an object.
2119
+ * @returns The object value, or undefined if not an object
2120
+ * @returns {JsonObject | undefined}
2121
+ */
2122
+ valueIfObject() {
2123
+ const ret = wasm.objectprop_valueIfObject(this.__wbg_ptr);
2124
+ return ret === 0 ? undefined : JsonObject.__wrap(ret);
2125
+ }
2191
2126
  /**
2192
2127
  * Returns the previous sibling node.
2193
2128
  * @returns The previous sibling, or undefined if this is the first child
@@ -2197,6 +2132,15 @@ export class ObjectProp {
2197
2132
  const ret = wasm.objectprop_previousSibling(this.__wbg_ptr);
2198
2133
  return ret === 0 ? undefined : Node.__wrap(ret);
2199
2134
  }
2135
+ /**
2136
+ * Returns the previous property in the same object.
2137
+ * @returns The previous property, or undefined if this is the first property
2138
+ * @returns {ObjectProp | undefined}
2139
+ */
2140
+ previousProperty() {
2141
+ const ret = wasm.objectprop_previousProperty(this.__wbg_ptr);
2142
+ return ret === 0 ? undefined : ObjectProp.__wrap(ret);
2143
+ }
2200
2144
  /**
2201
2145
  * Returns all previous sibling nodes.
2202
2146
  * @returns Array of previous siblings
@@ -2209,74 +2153,105 @@ export class ObjectProp {
2209
2153
  return v1;
2210
2154
  }
2211
2155
  /**
2212
- * Returns the next sibling node.
2213
- * @returns The next sibling, or undefined if this is the last child
2214
- * @returns {Node | undefined}
2156
+ * Returns whether this node's container uses trailing commas.
2157
+ * @returns true if trailing commas are used
2158
+ * @returns {boolean}
2215
2159
  */
2216
- nextSibling() {
2217
- const ret = wasm.objectprop_nextSibling(this.__wbg_ptr);
2218
- return ret === 0 ? undefined : Node.__wrap(ret);
2160
+ usesTrailingCommas() {
2161
+ const ret = wasm.objectprop_usesTrailingCommas(this.__wbg_ptr);
2162
+ return ret !== 0;
2219
2163
  }
2220
2164
  /**
2221
- * Returns all next sibling nodes.
2222
- * @returns Array of next siblings
2223
- * @returns {Node[]}
2165
+ * Gets the property value as an array, replacing the value with an empty array if needed.
2166
+ * Always returns an array by replacing non-array values.
2167
+ * @returns The array value (always succeeds)
2168
+ * @returns {JsonArray}
2224
2169
  */
2225
- nextSiblings() {
2226
- const ret = wasm.objectprop_nextSiblings(this.__wbg_ptr);
2227
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2228
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2229
- return v1;
2170
+ valueIfArrayOrForce() {
2171
+ const ret = wasm.objectprop_valueIfArrayOrForce(this.__wbg_ptr);
2172
+ return JsonArray.__wrap(ret);
2230
2173
  }
2231
2174
  /**
2232
- * Returns the previous property in the same object.
2233
- * @returns The previous property, or undefined if this is the first property
2234
- * @returns {ObjectProp | undefined}
2175
+ * Returns the property value as an array, throwing if not an array.
2176
+ * @returns The array value
2177
+ * @throws If the property value is not an array
2178
+ * @returns {JsonArray}
2235
2179
  */
2236
- previousProperty() {
2237
- const ret = wasm.objectprop_previousProperty(this.__wbg_ptr);
2238
- return ret === 0 ? undefined : ObjectProp.__wrap(ret);
2180
+ valueIfArrayOrThrow() {
2181
+ const ret = wasm.objectprop_valueIfArrayOrThrow(this.__wbg_ptr);
2182
+ if (ret[2]) {
2183
+ throw takeFromExternrefTable0(ret[1]);
2184
+ }
2185
+ return JsonArray.__wrap(ret[0]);
2239
2186
  }
2240
2187
  /**
2241
- * Returns the next property in the same object.
2242
- * @returns The next property, or undefined if this is the last property
2243
- * @returns {ObjectProp | undefined}
2188
+ * Gets the property value as an object, replacing the value with an empty object if needed.
2189
+ * Always returns an object by replacing non-object values.
2190
+ * @returns The object value (always succeeds)
2191
+ * @returns {JsonObject}
2244
2192
  */
2245
- nextProperty() {
2246
- const ret = wasm.objectprop_nextProperty(this.__wbg_ptr);
2247
- return ret === 0 ? undefined : ObjectProp.__wrap(ret);
2193
+ valueIfObjectOrForce() {
2194
+ const ret = wasm.objectprop_valueIfObjectOrForce(this.__wbg_ptr);
2195
+ return JsonObject.__wrap(ret);
2248
2196
  }
2249
2197
  /**
2250
- * Returns the root node of the document.
2251
- * @returns The root node, or undefined if detached
2252
- * @returns {RootNode | undefined}
2198
+ * Returns the property value as an object, throwing if not an object.
2199
+ * @returns The object value
2200
+ * @throws If the property value is not an object
2201
+ * @returns {JsonObject}
2253
2202
  */
2254
- rootNode() {
2255
- const ret = wasm.objectprop_rootNode(this.__wbg_ptr);
2256
- return ret === 0 ? undefined : RootNode.__wrap(ret);
2203
+ valueIfObjectOrThrow() {
2204
+ const ret = wasm.objectprop_valueIfObjectOrThrow(this.__wbg_ptr);
2205
+ if (ret[2]) {
2206
+ throw takeFromExternrefTable0(ret[1]);
2207
+ }
2208
+ return JsonObject.__wrap(ret[0]);
2257
2209
  }
2258
2210
  /**
2259
- * Returns the indentation string used at this node's depth.
2260
- * @returns The indentation string, or undefined if not applicable
2261
- * @returns {string | undefined}
2211
+ * Returns child nodes excluding whitespace, comments, and punctuation.
2212
+ * @returns Array of significant child nodes
2213
+ * @returns {Node[]}
2262
2214
  */
2263
- indentText() {
2264
- const ret = wasm.objectprop_indentText(this.__wbg_ptr);
2265
- let v1;
2266
- if (ret[0] !== 0) {
2267
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2268
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2269
- }
2215
+ childrenExcludeTriviaAndTokens() {
2216
+ const ret = wasm.objectprop_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
2217
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2218
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2270
2219
  return v1;
2271
2220
  }
2272
2221
  /**
2273
- * Returns whether this node's container uses trailing commas.
2274
- * @returns true if trailing commas are used
2275
- * @returns {boolean}
2222
+ * Returns the property name.
2223
+ * @returns The property name, or undefined if malformed
2224
+ * @returns {ObjectPropName | undefined}
2276
2225
  */
2277
- usesTrailingCommas() {
2278
- const ret = wasm.objectprop_usesTrailingCommas(this.__wbg_ptr);
2279
- return ret !== 0;
2226
+ name() {
2227
+ const ret = wasm.objectprop_name(this.__wbg_ptr);
2228
+ return ret === 0 ? undefined : ObjectPropName.__wrap(ret);
2229
+ }
2230
+ /**
2231
+ * Returns the property value.
2232
+ * @returns The property value, or undefined if malformed
2233
+ * @returns {Node | undefined}
2234
+ */
2235
+ value() {
2236
+ const ret = wasm.objectprop_value(this.__wbg_ptr);
2237
+ return ret === 0 ? undefined : Node.__wrap(ret);
2238
+ }
2239
+ /**
2240
+ * Returns the parent node in the CST.
2241
+ * @returns The parent node, or undefined if this is the root
2242
+ * @returns {Node | undefined}
2243
+ */
2244
+ parent() {
2245
+ const ret = wasm.objectprop_parent(this.__wbg_ptr);
2246
+ return ret === 0 ? undefined : Node.__wrap(ret);
2247
+ }
2248
+ /**
2249
+ * Removes this property from its parent object.
2250
+ * After calling this method, the property is detached from the CST and can no longer be used.
2251
+ */
2252
+ remove() {
2253
+ const ptr = this.__destroy_into_raw();
2254
+ wasm.objectprop_remove(ptr);
2280
2255
  }
2281
2256
  /**
2282
2257
  * Returns all child nodes including whitespace and punctuation.
@@ -2290,31 +2265,40 @@ export class ObjectProp {
2290
2265
  return v1;
2291
2266
  }
2292
2267
  /**
2293
- * Returns child nodes excluding whitespace, comments, and punctuation.
2294
- * @returns Array of significant child nodes
2268
+ * Returns all ancestor nodes from parent to root.
2269
+ * @returns Array of ancestor nodes
2295
2270
  * @returns {Node[]}
2296
2271
  */
2297
- childrenExcludeTriviaAndTokens() {
2298
- const ret = wasm.objectprop_childrenExcludeTriviaAndTokens(this.__wbg_ptr);
2272
+ ancestors() {
2273
+ const ret = wasm.objectprop_ancestors(this.__wbg_ptr);
2299
2274
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2300
2275
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2301
2276
  return v1;
2302
2277
  }
2303
2278
  /**
2304
- * Returns the child node at the specified index.
2305
- * @param index - The child index
2306
- * @returns The child node, or undefined if index is out of bounds
2307
- * @param {number} index
2308
- * @returns {Node | undefined}
2279
+ * Returns the root node of the document.
2280
+ * @returns The root node, or undefined if detached
2281
+ * @returns {RootNode | undefined}
2309
2282
  */
2310
- childAtIndex(index) {
2311
- const ret = wasm.objectprop_childAtIndex(this.__wbg_ptr, index);
2312
- return ret === 0 ? undefined : Node.__wrap(ret);
2283
+ rootNode() {
2284
+ const ret = wasm.objectprop_rootNode(this.__wbg_ptr);
2285
+ return ret === 0 ? undefined : RootNode.__wrap(ret);
2286
+ }
2287
+ /**
2288
+ * Sets the value of this property.
2289
+ * @param value - The new value to set
2290
+ * @param {any} value
2291
+ */
2292
+ setValue(value) {
2293
+ const ret = wasm.objectprop_setValue(this.__wbg_ptr, value);
2294
+ if (ret[1]) {
2295
+ throw takeFromExternrefTable0(ret[0]);
2296
+ }
2313
2297
  }
2314
2298
  }
2315
- const ObjectPropNameFinalization = (typeof FinalizationRegistry === "undefined")
2316
- ? { register: () => { }, unregister: () => { } }
2317
- : new FinalizationRegistry((ptr) => wasm.__wbg_objectpropname_free(ptr >>> 0, 1));
2299
+ if (Symbol.dispose) {
2300
+ ObjectProp.prototype[Symbol.dispose] = ObjectProp.prototype.free;
2301
+ }
2318
2302
  /**
2319
2303
  * Represents the name part of an object property in the CST.
2320
2304
  * Can be either a quoted string or an unquoted word literal (when allowLooseObjectPropertyNames is enabled).
@@ -2337,6 +2321,38 @@ export class ObjectPropName {
2337
2321
  const ptr = this.__destroy_into_raw();
2338
2322
  wasm.__wbg_objectpropname_free(ptr, 0);
2339
2323
  }
2324
+ /**
2325
+ * Returns the index of this node within its parent's children.
2326
+ * @returns The child index
2327
+ * @returns {number}
2328
+ */
2329
+ childIndex() {
2330
+ const ret = wasm.objectpropname_childIndex(this.__wbg_ptr);
2331
+ return ret >>> 0;
2332
+ }
2333
+ /**
2334
+ * Returns the indentation string used at this node's depth.
2335
+ * @returns The indentation string, or undefined if not applicable
2336
+ * @returns {string | undefined}
2337
+ */
2338
+ indentText() {
2339
+ const ret = wasm.objectpropname_indentText(this.__wbg_ptr);
2340
+ let v1;
2341
+ if (ret[0] !== 0) {
2342
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2343
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2344
+ }
2345
+ return v1;
2346
+ }
2347
+ /**
2348
+ * Returns the next sibling node.
2349
+ * @returns The next sibling, or undefined if this is the last child
2350
+ * @returns {Node | undefined}
2351
+ */
2352
+ nextSibling() {
2353
+ const ret = wasm.objectpropname_nextSibling(this.__wbg_ptr);
2354
+ return ret === 0 ? undefined : Node.__wrap(ret);
2355
+ }
2340
2356
  /**
2341
2357
  * Returns the decoded property name (unquoted and unescaped).
2342
2358
  * @returns The decoded property name
@@ -2363,31 +2379,31 @@ export class ObjectPropName {
2363
2379
  }
2364
2380
  }
2365
2381
  /**
2366
- * Returns the parent node in the CST.
2367
- * @returns The parent node, or undefined if this is the root
2382
+ * Returns the previous sibling node.
2383
+ * @returns The previous sibling, or undefined if this is the first child
2368
2384
  * @returns {Node | undefined}
2369
2385
  */
2370
- parent() {
2371
- const ret = wasm.objectpropname_parent(this.__wbg_ptr);
2386
+ previousSibling() {
2387
+ const ret = wasm.objectpropname_previousSibling(this.__wbg_ptr);
2372
2388
  return ret === 0 ? undefined : Node.__wrap(ret);
2373
2389
  }
2374
2390
  /**
2375
- * Returns the root node of the document.
2376
- * @returns The root node, or undefined if detached
2377
- * @returns {RootNode | undefined}
2391
+ * Returns whether this node's container uses trailing commas.
2392
+ * @returns true if trailing commas are used
2393
+ * @returns {boolean}
2378
2394
  */
2379
- rootNode() {
2380
- const ret = wasm.objectpropname_rootNode(this.__wbg_ptr);
2381
- return ret === 0 ? undefined : RootNode.__wrap(ret);
2395
+ usesTrailingCommas() {
2396
+ const ret = wasm.objectpropname_usesTrailingCommas(this.__wbg_ptr);
2397
+ return ret !== 0;
2382
2398
  }
2383
2399
  /**
2384
- * Returns the index of this node within its parent's children.
2385
- * @returns The child index
2386
- * @returns {number}
2400
+ * Returns the parent node in the CST.
2401
+ * @returns The parent node, or undefined if this is the root
2402
+ * @returns {Node | undefined}
2387
2403
  */
2388
- childIndex() {
2389
- const ret = wasm.objectpropname_childIndex(this.__wbg_ptr);
2390
- return ret >>> 0;
2404
+ parent() {
2405
+ const ret = wasm.objectpropname_parent(this.__wbg_ptr);
2406
+ return ret === 0 ? undefined : Node.__wrap(ret);
2391
2407
  }
2392
2408
  /**
2393
2409
  * Returns all ancestor nodes from parent to root.
@@ -2401,50 +2417,18 @@ export class ObjectPropName {
2401
2417
  return v1;
2402
2418
  }
2403
2419
  /**
2404
- * Returns the previous sibling node.
2405
- * @returns The previous sibling, or undefined if this is the first child
2406
- * @returns {Node | undefined}
2407
- */
2408
- previousSibling() {
2409
- const ret = wasm.objectpropname_previousSibling(this.__wbg_ptr);
2410
- return ret === 0 ? undefined : Node.__wrap(ret);
2411
- }
2412
- /**
2413
- * Returns the next sibling node.
2414
- * @returns The next sibling, or undefined if this is the last child
2415
- * @returns {Node | undefined}
2416
- */
2417
- nextSibling() {
2418
- const ret = wasm.objectpropname_nextSibling(this.__wbg_ptr);
2419
- return ret === 0 ? undefined : Node.__wrap(ret);
2420
- }
2421
- /**
2422
- * Returns the indentation string used at this node's depth.
2423
- * @returns The indentation string, or undefined if not applicable
2424
- * @returns {string | undefined}
2425
- */
2426
- indentText() {
2427
- const ret = wasm.objectpropname_indentText(this.__wbg_ptr);
2428
- let v1;
2429
- if (ret[0] !== 0) {
2430
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2431
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2432
- }
2433
- return v1;
2434
- }
2435
- /**
2436
- * Returns whether this node's container uses trailing commas.
2437
- * @returns true if trailing commas are used
2438
- * @returns {boolean}
2420
+ * Returns the root node of the document.
2421
+ * @returns The root node, or undefined if detached
2422
+ * @returns {RootNode | undefined}
2439
2423
  */
2440
- usesTrailingCommas() {
2441
- const ret = wasm.objectpropname_usesTrailingCommas(this.__wbg_ptr);
2442
- return ret !== 0;
2424
+ rootNode() {
2425
+ const ret = wasm.objectpropname_rootNode(this.__wbg_ptr);
2426
+ return ret === 0 ? undefined : RootNode.__wrap(ret);
2443
2427
  }
2444
2428
  }
2445
- const RootNodeFinalization = (typeof FinalizationRegistry === "undefined")
2446
- ? { register: () => { }, unregister: () => { } }
2447
- : new FinalizationRegistry((ptr) => wasm.__wbg_rootnode_free(ptr >>> 0, 1));
2429
+ if (Symbol.dispose) {
2430
+ ObjectPropName.prototype[Symbol.dispose] = ObjectPropName.prototype.free;
2431
+ }
2448
2432
  /**
2449
2433
  * Represents the root node of a JSONC document.
2450
2434
  * This is the entry point for manipulating the concrete syntax tree.
@@ -2468,160 +2452,67 @@ export class RootNode {
2468
2452
  wasm.__wbg_rootnode_free(ptr, 0);
2469
2453
  }
2470
2454
  /**
2471
- * Returns the root value node.
2472
- * @returns The root value, or undefined if the document is empty
2473
- * @returns {Node | undefined}
2474
- */
2475
- value() {
2476
- const ret = wasm.rootnode_value(this.__wbg_ptr);
2477
- return ret === 0 ? undefined : Node.__wrap(ret);
2478
- }
2479
- /**
2480
- * Returns the root value node, throwing if empty.
2481
- * @returns The root value
2482
- * @throws If the document is empty
2483
- * @returns {Node}
2484
- */
2485
- valueOrThrow() {
2486
- const ret = wasm.rootnode_valueOrThrow(this.__wbg_ptr);
2487
- if (ret[2]) {
2488
- throw takeFromExternrefTable0(ret[1]);
2489
- }
2490
- return Node.__wrap(ret[0]);
2491
- }
2492
- /**
2493
- * Returns the root value as an object if it is one.
2494
- * @returns The object, or undefined if root is not an object
2495
- * @returns {JsonObject | undefined}
2496
- */
2497
- asObject() {
2498
- const ret = wasm.rootnode_asObject(this.__wbg_ptr);
2499
- return ret === 0 ? undefined : JsonObject.__wrap(ret);
2500
- }
2501
- /**
2502
- * Returns the root value as an object, throwing if it's not an object.
2503
- * @returns The object
2504
- * @throws If the root is not an object
2505
- * @returns {JsonObject}
2506
- */
2507
- asObjectOrThrow() {
2508
- const ret = wasm.rootnode_asObjectOrThrow(this.__wbg_ptr);
2509
- if (ret[2]) {
2510
- throw takeFromExternrefTable0(ret[1]);
2511
- }
2512
- return JsonObject.__wrap(ret[0]);
2513
- }
2514
- /**
2515
- * Returns the root value as an object, creating an empty object if the root is empty.
2516
- * Returns undefined if the root contains a value of a different type.
2517
- * @returns The object, or undefined if a non-object value exists
2518
- * @returns {JsonObject | undefined}
2519
- */
2520
- asObjectOrCreate() {
2521
- const ret = wasm.rootnode_asObjectOrCreate(this.__wbg_ptr);
2522
- return ret === 0 ? undefined : JsonObject.__wrap(ret);
2523
- }
2524
- /**
2525
- * Returns the root value as an object, replacing any existing value with an empty object if needed.
2526
- * Unlike asObjectOrCreate, this always returns an object by replacing non-object values.
2527
- * @returns The object (always succeeds)
2528
- * @returns {JsonObject}
2529
- */
2530
- asObjectOrForce() {
2531
- const ret = wasm.rootnode_asObjectOrForce(this.__wbg_ptr);
2532
- return JsonObject.__wrap(ret);
2533
- }
2534
- /**
2535
- * Returns the root value as an array if it is one.
2536
- * @returns The array, or undefined if root is not an array
2537
- * @returns {JsonArray | undefined}
2455
+ * Returns the index of this node within its parent's children.
2456
+ * @returns The child index
2457
+ * @returns {number}
2538
2458
  */
2539
- asArray() {
2540
- const ret = wasm.rootnode_asArray(this.__wbg_ptr);
2541
- return ret === 0 ? undefined : JsonArray.__wrap(ret);
2459
+ childIndex() {
2460
+ const ret = wasm.rootnode_childIndex(this.__wbg_ptr);
2461
+ return ret >>> 0;
2542
2462
  }
2543
2463
  /**
2544
- * Returns the root value as an array, throwing if it's not an array.
2545
- * @returns The array
2546
- * @throws If the root is not an array
2547
- * @returns {JsonArray}
2464
+ * Returns the indentation string used at this node's depth.
2465
+ * @returns The indentation string, or undefined if not applicable
2466
+ * @returns {string | undefined}
2548
2467
  */
2549
- asArrayOrThrow() {
2550
- const ret = wasm.rootnode_asArrayOrThrow(this.__wbg_ptr);
2551
- if (ret[2]) {
2552
- throw takeFromExternrefTable0(ret[1]);
2468
+ indentText() {
2469
+ const ret = wasm.rootnode_indentText(this.__wbg_ptr);
2470
+ let v1;
2471
+ if (ret[0] !== 0) {
2472
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2473
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2553
2474
  }
2554
- return JsonArray.__wrap(ret[0]);
2555
- }
2556
- /**
2557
- * Returns the root value as an array, creating an empty array if the root is empty.
2558
- * Returns undefined if the root contains a value of a different type.
2559
- * @returns The array, or undefined if a non-array value exists
2560
- * @returns {JsonArray | undefined}
2561
- */
2562
- asArrayOrCreate() {
2563
- const ret = wasm.rootnode_asArrayOrCreate(this.__wbg_ptr);
2564
- return ret === 0 ? undefined : JsonArray.__wrap(ret);
2475
+ return v1;
2565
2476
  }
2566
2477
  /**
2567
- * Returns the root value as an array, replacing any existing value with an empty array if needed.
2568
- * Unlike asArrayOrCreate, this always returns an array by replacing non-array values.
2569
- * @returns The array (always succeeds)
2570
- * @returns {JsonArray}
2478
+ * Returns the newline kind used in the document.
2479
+ * @returns Either "\n" or "\r\n"
2480
+ * @returns {string}
2571
2481
  */
2572
- asArrayOrForce() {
2573
- const ret = wasm.rootnode_asArrayOrForce(this.__wbg_ptr);
2574
- return JsonArray.__wrap(ret);
2482
+ newlineKind() {
2483
+ const ret = wasm.rootnode_newlineKind(this.__wbg_ptr);
2484
+ return ret;
2575
2485
  }
2576
2486
  /**
2577
- * Converts the CST back to a string representation.
2578
- * @returns The JSONC string
2579
- * @returns {string}
2487
+ * Returns the next sibling node.
2488
+ * @returns The next sibling, or undefined if this is the last child
2489
+ * @returns {Node | undefined}
2580
2490
  */
2581
- toString() {
2582
- let deferred1_0;
2583
- let deferred1_1;
2584
- try {
2585
- const ret = wasm.rootnode_toString(this.__wbg_ptr);
2586
- deferred1_0 = ret[0];
2587
- deferred1_1 = ret[1];
2588
- return getStringFromWasm0(ret[0], ret[1]);
2589
- }
2590
- finally {
2591
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2592
- }
2491
+ nextSibling() {
2492
+ const ret = wasm.rootnode_nextSibling(this.__wbg_ptr);
2493
+ return ret === 0 ? undefined : Node.__wrap(ret);
2593
2494
  }
2594
2495
  /**
2595
- * Returns all child nodes including whitespace and punctuation.
2596
- * @returns Array of all child nodes
2496
+ * Returns all next sibling nodes.
2497
+ * @returns Array of next siblings
2597
2498
  * @returns {Node[]}
2598
2499
  */
2599
- children() {
2600
- const ret = wasm.rootnode_children(this.__wbg_ptr);
2500
+ nextSiblings() {
2501
+ const ret = wasm.rootnode_nextSiblings(this.__wbg_ptr);
2601
2502
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2602
2503
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2603
2504
  return v1;
2604
2505
  }
2605
2506
  /**
2606
- * Sets the root value of the document.
2607
- * Accepts any JSON value: string, number, boolean, null, array, or object.
2608
- * @param value - The new value to set
2609
- * @param {any} value
2610
- */
2611
- setValue(value) {
2612
- const ret = wasm.rootnode_setValue(this.__wbg_ptr, value);
2613
- if (ret[1]) {
2614
- throw takeFromExternrefTable0(ret[0]);
2615
- }
2616
- }
2617
- /**
2618
- * Configures whether trailing commas should be used throughout the document.
2619
- * When enabled, trailing commas are added for multiline formatting in objects and arrays.
2620
- * @param enabled - Whether to enable trailing commas
2621
- * @param {boolean} enabled
2507
+ * Returns the child node at the specified index.
2508
+ * @param index - The child index
2509
+ * @returns The child node, or undefined if index is out of bounds
2510
+ * @param {number} index
2511
+ * @returns {Node | undefined}
2622
2512
  */
2623
- setTrailingCommas(enabled) {
2624
- wasm.rootnode_setTrailingCommas(this.__wbg_ptr, enabled);
2513
+ childAtIndex(index) {
2514
+ const ret = wasm.rootnode_childAtIndex(this.__wbg_ptr, index);
2515
+ return ret === 0 ? undefined : Node.__wrap(ret);
2625
2516
  }
2626
2517
  /**
2627
2518
  * Clears all children from the root node, leaving an empty document.
@@ -2630,65 +2521,67 @@ export class RootNode {
2630
2521
  wasm.rootnode_clearChildren(this.__wbg_ptr);
2631
2522
  }
2632
2523
  /**
2633
- * Returns the indentation string used for a single level.
2634
- * @returns The single-level indentation string (e.g., " " or "\t")
2635
- * @returns {string | undefined}
2524
+ * Returns the root value node, throwing if empty.
2525
+ * @returns The root value
2526
+ * @throws If the document is empty
2527
+ * @returns {Node}
2636
2528
  */
2637
- singleIndentText() {
2638
- const ret = wasm.rootnode_singleIndentText(this.__wbg_ptr);
2639
- let v1;
2640
- if (ret[0] !== 0) {
2641
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2642
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2529
+ valueOrThrow() {
2530
+ const ret = wasm.rootnode_valueOrThrow(this.__wbg_ptr);
2531
+ if (ret[2]) {
2532
+ throw takeFromExternrefTable0(ret[1]);
2643
2533
  }
2644
- return v1;
2645
- }
2646
- /**
2647
- * Returns the newline kind used in the document.
2648
- * @returns Either "\n" or "\r\n"
2649
- * @returns {string}
2650
- */
2651
- newlineKind() {
2652
- const ret = wasm.rootnode_newlineKind(this.__wbg_ptr);
2653
- return ret;
2534
+ return Node.__wrap(ret[0]);
2654
2535
  }
2655
2536
  /**
2656
- * Returns the parent node in the CST.
2657
- * @returns The parent node, or undefined if this is the root
2537
+ * Returns the previous sibling node.
2538
+ * @returns The previous sibling, or undefined if this is the first child
2658
2539
  * @returns {Node | undefined}
2659
2540
  */
2660
- parent() {
2661
- const ret = wasm.rootnode_parent(this.__wbg_ptr);
2541
+ previousSibling() {
2542
+ const ret = wasm.rootnode_previousSibling(this.__wbg_ptr);
2662
2543
  return ret === 0 ? undefined : Node.__wrap(ret);
2663
2544
  }
2664
2545
  /**
2665
- * Returns the index of this node within its parent's children.
2666
- * @returns The child index
2667
- * @returns {number}
2546
+ * Converts the CST back to a string representation.
2547
+ * @returns The JSONC string
2548
+ * @returns {string}
2668
2549
  */
2669
- childIndex() {
2670
- const ret = wasm.rootnode_childIndex(this.__wbg_ptr);
2671
- return ret >>> 0;
2550
+ toString() {
2551
+ let deferred1_0;
2552
+ let deferred1_1;
2553
+ try {
2554
+ const ret = wasm.rootnode_toString(this.__wbg_ptr);
2555
+ deferred1_0 = ret[0];
2556
+ deferred1_1 = ret[1];
2557
+ return getStringFromWasm0(ret[0], ret[1]);
2558
+ }
2559
+ finally {
2560
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2561
+ }
2672
2562
  }
2673
2563
  /**
2674
- * Returns all ancestor nodes from parent to root.
2675
- * @returns Array of ancestor nodes
2676
- * @returns {Node[]}
2564
+ * Returns the root value as an array, replacing any existing value with an empty array if needed.
2565
+ * Unlike asArrayOrCreate, this always returns an array by replacing non-array values.
2566
+ * @returns The array (always succeeds)
2567
+ * @returns {JsonArray}
2677
2568
  */
2678
- ancestors() {
2679
- const ret = wasm.rootnode_ancestors(this.__wbg_ptr);
2680
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2681
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2682
- return v1;
2569
+ asArrayOrForce() {
2570
+ const ret = wasm.rootnode_asArrayOrForce(this.__wbg_ptr);
2571
+ return JsonArray.__wrap(ret);
2683
2572
  }
2684
2573
  /**
2685
- * Returns the previous sibling node.
2686
- * @returns The previous sibling, or undefined if this is the first child
2687
- * @returns {Node | undefined}
2574
+ * Returns the root value as an array, throwing if it's not an array.
2575
+ * @returns The array
2576
+ * @throws If the root is not an array
2577
+ * @returns {JsonArray}
2688
2578
  */
2689
- previousSibling() {
2690
- const ret = wasm.rootnode_previousSibling(this.__wbg_ptr);
2691
- return ret === 0 ? undefined : Node.__wrap(ret);
2579
+ asArrayOrThrow() {
2580
+ const ret = wasm.rootnode_asArrayOrThrow(this.__wbg_ptr);
2581
+ if (ret[2]) {
2582
+ throw takeFromExternrefTable0(ret[1]);
2583
+ }
2584
+ return JsonArray.__wrap(ret[0]);
2692
2585
  }
2693
2586
  /**
2694
2587
  * Returns all previous sibling nodes.
@@ -2702,32 +2595,45 @@ export class RootNode {
2702
2595
  return v1;
2703
2596
  }
2704
2597
  /**
2705
- * Returns the next sibling node.
2706
- * @returns The next sibling, or undefined if this is the last child
2707
- * @returns {Node | undefined}
2598
+ * Returns the root value as an array, creating an empty array if the root is empty.
2599
+ * Returns undefined if the root contains a value of a different type.
2600
+ * @returns The array, or undefined if a non-array value exists
2601
+ * @returns {JsonArray | undefined}
2708
2602
  */
2709
- nextSibling() {
2710
- const ret = wasm.rootnode_nextSibling(this.__wbg_ptr);
2711
- return ret === 0 ? undefined : Node.__wrap(ret);
2603
+ asArrayOrCreate() {
2604
+ const ret = wasm.rootnode_asArrayOrCreate(this.__wbg_ptr);
2605
+ return ret === 0 ? undefined : JsonArray.__wrap(ret);
2712
2606
  }
2713
2607
  /**
2714
- * Returns all next sibling nodes.
2715
- * @returns Array of next siblings
2716
- * @returns {Node[]}
2608
+ * Returns the root value as an object, replacing any existing value with an empty object if needed.
2609
+ * Unlike asObjectOrCreate, this always returns an object by replacing non-object values.
2610
+ * @returns The object (always succeeds)
2611
+ * @returns {JsonObject}
2717
2612
  */
2718
- nextSiblings() {
2719
- const ret = wasm.rootnode_nextSiblings(this.__wbg_ptr);
2720
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2721
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2722
- return v1;
2613
+ asObjectOrForce() {
2614
+ const ret = wasm.rootnode_asObjectOrForce(this.__wbg_ptr);
2615
+ return JsonObject.__wrap(ret);
2723
2616
  }
2724
2617
  /**
2725
- * Returns the indentation string used at this node's depth.
2726
- * @returns The indentation string, or undefined if not applicable
2618
+ * Returns the root value as an object, throwing if it's not an object.
2619
+ * @returns The object
2620
+ * @throws If the root is not an object
2621
+ * @returns {JsonObject}
2622
+ */
2623
+ asObjectOrThrow() {
2624
+ const ret = wasm.rootnode_asObjectOrThrow(this.__wbg_ptr);
2625
+ if (ret[2]) {
2626
+ throw takeFromExternrefTable0(ret[1]);
2627
+ }
2628
+ return JsonObject.__wrap(ret[0]);
2629
+ }
2630
+ /**
2631
+ * Returns the indentation string used for a single level.
2632
+ * @returns The single-level indentation string (e.g., " " or "\t")
2727
2633
  * @returns {string | undefined}
2728
2634
  */
2729
- indentText() {
2730
- const ret = wasm.rootnode_indentText(this.__wbg_ptr);
2635
+ singleIndentText() {
2636
+ const ret = wasm.rootnode_singleIndentText(this.__wbg_ptr);
2731
2637
  let v1;
2732
2638
  if (ret[0] !== 0) {
2733
2639
  v1 = getStringFromWasm0(ret[0], ret[1]).slice();
@@ -2735,6 +2641,25 @@ export class RootNode {
2735
2641
  }
2736
2642
  return v1;
2737
2643
  }
2644
+ /**
2645
+ * Returns the root value as an object, creating an empty object if the root is empty.
2646
+ * Returns undefined if the root contains a value of a different type.
2647
+ * @returns The object, or undefined if a non-object value exists
2648
+ * @returns {JsonObject | undefined}
2649
+ */
2650
+ asObjectOrCreate() {
2651
+ const ret = wasm.rootnode_asObjectOrCreate(this.__wbg_ptr);
2652
+ return ret === 0 ? undefined : JsonObject.__wrap(ret);
2653
+ }
2654
+ /**
2655
+ * Configures whether trailing commas should be used throughout the document.
2656
+ * When enabled, trailing commas are added for multiline formatting in objects and arrays.
2657
+ * @param enabled - Whether to enable trailing commas
2658
+ * @param {boolean} enabled
2659
+ */
2660
+ setTrailingCommas(enabled) {
2661
+ wasm.rootnode_setTrailingCommas(this.__wbg_ptr, enabled);
2662
+ }
2738
2663
  /**
2739
2664
  * Returns whether this node's container uses trailing commas.
2740
2665
  * @returns true if trailing commas are used
@@ -2756,16 +2681,43 @@ export class RootNode {
2756
2681
  return v1;
2757
2682
  }
2758
2683
  /**
2759
- * Returns the child node at the specified index.
2760
- * @param index - The child index
2761
- * @returns The child node, or undefined if index is out of bounds
2762
- * @param {number} index
2684
+ * Returns the root value node.
2685
+ * @returns The root value, or undefined if the document is empty
2763
2686
  * @returns {Node | undefined}
2764
2687
  */
2765
- childAtIndex(index) {
2766
- const ret = wasm.rootnode_childAtIndex(this.__wbg_ptr, index);
2688
+ value() {
2689
+ const ret = wasm.rootnode_value(this.__wbg_ptr);
2690
+ return ret === 0 ? undefined : Node.__wrap(ret);
2691
+ }
2692
+ /**
2693
+ * Returns the parent node in the CST.
2694
+ * @returns The parent node, or undefined if this is the root
2695
+ * @returns {Node | undefined}
2696
+ */
2697
+ parent() {
2698
+ const ret = wasm.rootnode_parent(this.__wbg_ptr);
2767
2699
  return ret === 0 ? undefined : Node.__wrap(ret);
2768
2700
  }
2701
+ /**
2702
+ * Returns the root value as an array if it is one.
2703
+ * @returns The array, or undefined if root is not an array
2704
+ * @returns {JsonArray | undefined}
2705
+ */
2706
+ asArray() {
2707
+ const ret = wasm.rootnode_asArray(this.__wbg_ptr);
2708
+ return ret === 0 ? undefined : JsonArray.__wrap(ret);
2709
+ }
2710
+ /**
2711
+ * Returns all child nodes including whitespace and punctuation.
2712
+ * @returns Array of all child nodes
2713
+ * @returns {Node[]}
2714
+ */
2715
+ children() {
2716
+ const ret = wasm.rootnode_children(this.__wbg_ptr);
2717
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2718
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2719
+ return v1;
2720
+ }
2769
2721
  /**
2770
2722
  * Converts the CST to a plain JavaScript value, similar to JSON.parse.
2771
2723
  * This recursively converts the root value to its JavaScript equivalent.
@@ -2778,10 +2730,42 @@ export class RootNode {
2778
2730
  const ret = wasm.rootnode_toValue(this.__wbg_ptr);
2779
2731
  return ret;
2780
2732
  }
2733
+ /**
2734
+ * Returns all ancestor nodes from parent to root.
2735
+ * @returns Array of ancestor nodes
2736
+ * @returns {Node[]}
2737
+ */
2738
+ ancestors() {
2739
+ const ret = wasm.rootnode_ancestors(this.__wbg_ptr);
2740
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2741
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2742
+ return v1;
2743
+ }
2744
+ /**
2745
+ * Returns the root value as an object if it is one.
2746
+ * @returns The object, or undefined if root is not an object
2747
+ * @returns {JsonObject | undefined}
2748
+ */
2749
+ asObject() {
2750
+ const ret = wasm.rootnode_asObject(this.__wbg_ptr);
2751
+ return ret === 0 ? undefined : JsonObject.__wrap(ret);
2752
+ }
2753
+ /**
2754
+ * Sets the root value of the document.
2755
+ * Accepts any JSON value: string, number, boolean, null, array, or object.
2756
+ * @param value - The new value to set
2757
+ * @param {any} value
2758
+ */
2759
+ setValue(value) {
2760
+ const ret = wasm.rootnode_setValue(this.__wbg_ptr, value);
2761
+ if (ret[1]) {
2762
+ throw takeFromExternrefTable0(ret[0]);
2763
+ }
2764
+ }
2765
+ }
2766
+ if (Symbol.dispose) {
2767
+ RootNode.prototype[Symbol.dispose] = RootNode.prototype.free;
2781
2768
  }
2782
- const StringLitFinalization = (typeof FinalizationRegistry === "undefined")
2783
- ? { register: () => { }, unregister: () => { } }
2784
- : new FinalizationRegistry((ptr) => wasm.__wbg_stringlit_free(ptr >>> 0, 1));
2785
2769
  /**
2786
2770
  * Represents a string literal node in the CST.
2787
2771
  * Provides methods for manipulating string values and their formatting.
@@ -2794,15 +2778,61 @@ export class StringLit {
2794
2778
  StringLitFinalization.register(obj, obj.__wbg_ptr, obj);
2795
2779
  return obj;
2796
2780
  }
2797
- __destroy_into_raw() {
2798
- const ptr = this.__wbg_ptr;
2799
- this.__wbg_ptr = 0;
2800
- StringLitFinalization.unregister(this);
2801
- return ptr;
2781
+ __destroy_into_raw() {
2782
+ const ptr = this.__wbg_ptr;
2783
+ this.__wbg_ptr = 0;
2784
+ StringLitFinalization.unregister(this);
2785
+ return ptr;
2786
+ }
2787
+ free() {
2788
+ const ptr = this.__destroy_into_raw();
2789
+ wasm.__wbg_stringlit_free(ptr, 0);
2790
+ }
2791
+ /**
2792
+ * Returns the index of this node within its parent's children.
2793
+ * @returns The child index
2794
+ * @returns {number}
2795
+ */
2796
+ childIndex() {
2797
+ const ret = wasm.stringlit_childIndex(this.__wbg_ptr);
2798
+ return ret >>> 0;
2799
+ }
2800
+ /**
2801
+ * Returns the indentation string used at this node's depth.
2802
+ * @returns The indentation string, or undefined if not applicable
2803
+ * @returns {string | undefined}
2804
+ */
2805
+ indentText() {
2806
+ const ret = wasm.stringlit_indentText(this.__wbg_ptr);
2807
+ let v1;
2808
+ if (ret[0] !== 0) {
2809
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2810
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2811
+ }
2812
+ return v1;
2813
+ }
2814
+ /**
2815
+ * Returns the next sibling node.
2816
+ * @returns The next sibling, or undefined if this is the last child
2817
+ * @returns {Node | undefined}
2818
+ */
2819
+ nextSibling() {
2820
+ const ret = wasm.stringlit_nextSibling(this.__wbg_ptr);
2821
+ return ret === 0 ? undefined : Node.__wrap(ret);
2802
2822
  }
2803
- free() {
2804
- const ptr = this.__destroy_into_raw();
2805
- wasm.__wbg_stringlit_free(ptr, 0);
2823
+ /**
2824
+ * Replaces this string literal with a new value.
2825
+ * @param replacement - The new value to replace this string with
2826
+ * @returns The new node that replaced this one, or undefined if this was the root value
2827
+ * @param {any} replacement
2828
+ * @returns {Node | undefined}
2829
+ */
2830
+ replaceWith(replacement) {
2831
+ const ret = wasm.stringlit_replaceWith(this.__wbg_ptr, replacement);
2832
+ if (ret[2]) {
2833
+ throw takeFromExternrefTable0(ret[1]);
2834
+ }
2835
+ return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
2806
2836
  }
2807
2837
  /**
2808
2838
  * Returns the decoded string value (without quotes and with escape sequences processed).
@@ -2830,22 +2860,15 @@ export class StringLit {
2830
2860
  }
2831
2861
  }
2832
2862
  /**
2833
- * Returns the raw string value including quotes and escape sequences.
2834
- * @returns The raw string representation
2835
- * @returns {string}
2863
+ * Returns all next sibling nodes.
2864
+ * @returns Array of next siblings
2865
+ * @returns {Node[]}
2836
2866
  */
2837
- rawValue() {
2838
- let deferred1_0;
2839
- let deferred1_1;
2840
- try {
2841
- const ret = wasm.stringlit_rawValue(this.__wbg_ptr);
2842
- deferred1_0 = ret[0];
2843
- deferred1_1 = ret[1];
2844
- return getStringFromWasm0(ret[0], ret[1]);
2845
- }
2846
- finally {
2847
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2848
- }
2867
+ nextSiblings() {
2868
+ const ret = wasm.stringlit_nextSiblings(this.__wbg_ptr);
2869
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2870
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2871
+ return v1;
2849
2872
  }
2850
2873
  /**
2851
2874
  * Sets the raw string value (should include quotes).
@@ -2857,57 +2880,6 @@ export class StringLit {
2857
2880
  const len0 = WASM_VECTOR_LEN;
2858
2881
  wasm.stringlit_setRawValue(this.__wbg_ptr, ptr0, len0);
2859
2882
  }
2860
- /**
2861
- * Replaces this string literal with a new value.
2862
- * @param replacement - The new value to replace this string with
2863
- * @returns The new node that replaced this one, or undefined if this was the root value
2864
- * @param {any} replacement
2865
- * @returns {Node | undefined}
2866
- */
2867
- replaceWith(replacement) {
2868
- const ret = wasm.stringlit_replaceWith(this.__wbg_ptr, replacement);
2869
- if (ret[2]) {
2870
- throw takeFromExternrefTable0(ret[1]);
2871
- }
2872
- return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
2873
- }
2874
- /**
2875
- * Removes this string literal from its parent.
2876
- * After calling this method, the node is detached from the CST and can no longer be used.
2877
- */
2878
- remove() {
2879
- const ptr = this.__destroy_into_raw();
2880
- wasm.stringlit_remove(ptr);
2881
- }
2882
- /**
2883
- * Returns the parent node in the CST.
2884
- * @returns The parent node, or undefined if this is the root
2885
- * @returns {Node | undefined}
2886
- */
2887
- parent() {
2888
- const ret = wasm.stringlit_parent(this.__wbg_ptr);
2889
- return ret === 0 ? undefined : Node.__wrap(ret);
2890
- }
2891
- /**
2892
- * Returns all ancestor nodes from parent to root.
2893
- * @returns Array of ancestor nodes
2894
- * @returns {Node[]}
2895
- */
2896
- ancestors() {
2897
- const ret = wasm.stringlit_ancestors(this.__wbg_ptr);
2898
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2899
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2900
- return v1;
2901
- }
2902
- /**
2903
- * Returns the index of this node within its parent's children.
2904
- * @returns The child index
2905
- * @returns {number}
2906
- */
2907
- childIndex() {
2908
- const ret = wasm.stringlit_childIndex(this.__wbg_ptr);
2909
- return ret >>> 0;
2910
- }
2911
2883
  /**
2912
2884
  * Returns the previous sibling node.
2913
2885
  * @returns The previous sibling, or undefined if this is the first child
@@ -2929,25 +2901,60 @@ export class StringLit {
2929
2901
  return v1;
2930
2902
  }
2931
2903
  /**
2932
- * Returns the next sibling node.
2933
- * @returns The next sibling, or undefined if this is the last child
2904
+ * Returns whether this node's container uses trailing commas.
2905
+ * @returns true if trailing commas are used
2906
+ * @returns {boolean}
2907
+ */
2908
+ usesTrailingCommas() {
2909
+ const ret = wasm.stringlit_usesTrailingCommas(this.__wbg_ptr);
2910
+ return ret !== 0;
2911
+ }
2912
+ /**
2913
+ * Returns the parent node in the CST.
2914
+ * @returns The parent node, or undefined if this is the root
2934
2915
  * @returns {Node | undefined}
2935
2916
  */
2936
- nextSibling() {
2937
- const ret = wasm.stringlit_nextSibling(this.__wbg_ptr);
2917
+ parent() {
2918
+ const ret = wasm.stringlit_parent(this.__wbg_ptr);
2938
2919
  return ret === 0 ? undefined : Node.__wrap(ret);
2939
2920
  }
2940
2921
  /**
2941
- * Returns all next sibling nodes.
2942
- * @returns Array of next siblings
2922
+ * Removes this string literal from its parent.
2923
+ * After calling this method, the node is detached from the CST and can no longer be used.
2924
+ */
2925
+ remove() {
2926
+ const ptr = this.__destroy_into_raw();
2927
+ wasm.stringlit_remove(ptr);
2928
+ }
2929
+ /**
2930
+ * Returns all ancestor nodes from parent to root.
2931
+ * @returns Array of ancestor nodes
2943
2932
  * @returns {Node[]}
2944
2933
  */
2945
- nextSiblings() {
2946
- const ret = wasm.stringlit_nextSiblings(this.__wbg_ptr);
2934
+ ancestors() {
2935
+ const ret = wasm.stringlit_ancestors(this.__wbg_ptr);
2947
2936
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2948
2937
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2949
2938
  return v1;
2950
2939
  }
2940
+ /**
2941
+ * Returns the raw string value including quotes and escape sequences.
2942
+ * @returns The raw string representation
2943
+ * @returns {string}
2944
+ */
2945
+ rawValue() {
2946
+ let deferred1_0;
2947
+ let deferred1_1;
2948
+ try {
2949
+ const ret = wasm.stringlit_rawValue(this.__wbg_ptr);
2950
+ deferred1_0 = ret[0];
2951
+ deferred1_1 = ret[1];
2952
+ return getStringFromWasm0(ret[0], ret[1]);
2953
+ }
2954
+ finally {
2955
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2956
+ }
2957
+ }
2951
2958
  /**
2952
2959
  * Returns the root node of the document.
2953
2960
  * @returns The root node, or undefined if detached
@@ -2957,33 +2964,10 @@ export class StringLit {
2957
2964
  const ret = wasm.stringlit_rootNode(this.__wbg_ptr);
2958
2965
  return ret === 0 ? undefined : RootNode.__wrap(ret);
2959
2966
  }
2960
- /**
2961
- * Returns the indentation string used at this node's depth.
2962
- * @returns The indentation string, or undefined if not applicable
2963
- * @returns {string | undefined}
2964
- */
2965
- indentText() {
2966
- const ret = wasm.stringlit_indentText(this.__wbg_ptr);
2967
- let v1;
2968
- if (ret[0] !== 0) {
2969
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2970
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2971
- }
2972
- return v1;
2973
- }
2974
- /**
2975
- * Returns whether this node's container uses trailing commas.
2976
- * @returns true if trailing commas are used
2977
- * @returns {boolean}
2978
- */
2979
- usesTrailingCommas() {
2980
- const ret = wasm.stringlit_usesTrailingCommas(this.__wbg_ptr);
2981
- return ret !== 0;
2982
- }
2983
2967
  }
2984
- const WordLitFinalization = (typeof FinalizationRegistry === "undefined")
2985
- ? { register: () => { }, unregister: () => { } }
2986
- : new FinalizationRegistry((ptr) => wasm.__wbg_wordlit_free(ptr >>> 0, 1));
2968
+ if (Symbol.dispose) {
2969
+ StringLit.prototype[Symbol.dispose] = StringLit.prototype.free;
2970
+ }
2987
2971
  /**
2988
2972
  * Represents an unquoted word literal node in the CST.
2989
2973
  * Used for unquoted property names when `allowLooseObjectPropertyNames` is enabled.
@@ -3007,84 +2991,72 @@ export class WordLit {
3007
2991
  wasm.__wbg_wordlit_free(ptr, 0);
3008
2992
  }
3009
2993
  /**
3010
- * Returns the unquoted word value.
3011
- * @returns The word literal as a string
3012
- * @returns {string}
3013
- */
3014
- value() {
3015
- let deferred1_0;
3016
- let deferred1_1;
3017
- try {
3018
- const ret = wasm.wordlit_value(this.__wbg_ptr);
3019
- deferred1_0 = ret[0];
3020
- deferred1_1 = ret[1];
3021
- return getStringFromWasm0(ret[0], ret[1]);
3022
- }
3023
- finally {
3024
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3025
- }
3026
- }
3027
- /**
3028
- * Sets the raw word value.
3029
- * The value should be a valid unquoted identifier (alphanumeric and underscores).
3030
- * @param value - The raw word string to set
3031
- * @param {string} value
2994
+ * Returns the index of this node within its parent's children.
2995
+ * @returns The child index
2996
+ * @returns {number}
3032
2997
  */
3033
- setRawValue(value) {
3034
- const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3035
- const len0 = WASM_VECTOR_LEN;
3036
- wasm.wordlit_setRawValue(this.__wbg_ptr, ptr0, len0);
2998
+ childIndex() {
2999
+ const ret = wasm.wordlit_childIndex(this.__wbg_ptr);
3000
+ return ret >>> 0;
3037
3001
  }
3038
3002
  /**
3039
- * Replaces this word literal with a new value.
3040
- * @param replacement - The new value to replace this word with
3041
- * @returns The new node that replaced this one, or undefined if this was the root value
3042
- * @param {any} replacement
3043
- * @returns {Node | undefined}
3003
+ * Returns the indentation string used at this node's depth.
3004
+ * @returns The indentation string, or undefined if not applicable
3005
+ * @returns {string | undefined}
3044
3006
  */
3045
- replaceWith(replacement) {
3046
- const ret = wasm.wordlit_replaceWith(this.__wbg_ptr, replacement);
3047
- if (ret[2]) {
3048
- throw takeFromExternrefTable0(ret[1]);
3007
+ indentText() {
3008
+ const ret = wasm.wordlit_indentText(this.__wbg_ptr);
3009
+ let v1;
3010
+ if (ret[0] !== 0) {
3011
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
3012
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3049
3013
  }
3050
- return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
3014
+ return v1;
3051
3015
  }
3052
3016
  /**
3053
- * Removes this node from its parent.
3054
- * After calling this method, the node is detached from the CST and can no longer be used.
3017
+ * Returns the next sibling node.
3018
+ * @returns The next sibling, or undefined if this is the last child
3019
+ * @returns {Node | undefined}
3055
3020
  */
3056
- remove() {
3057
- const ptr = this.__destroy_into_raw();
3058
- wasm.wordlit_remove(ptr);
3021
+ nextSibling() {
3022
+ const ret = wasm.wordlit_nextSibling(this.__wbg_ptr);
3023
+ return ret === 0 ? undefined : Node.__wrap(ret);
3059
3024
  }
3060
3025
  /**
3061
- * Returns the parent node in the CST.
3062
- * @returns The parent node, or undefined if this is the root
3026
+ * Replaces this word literal with a new value.
3027
+ * @param replacement - The new value to replace this word with
3028
+ * @returns The new node that replaced this one, or undefined if this was the root value
3029
+ * @param {any} replacement
3063
3030
  * @returns {Node | undefined}
3064
3031
  */
3065
- parent() {
3066
- const ret = wasm.wordlit_parent(this.__wbg_ptr);
3067
- return ret === 0 ? undefined : Node.__wrap(ret);
3032
+ replaceWith(replacement) {
3033
+ const ret = wasm.wordlit_replaceWith(this.__wbg_ptr, replacement);
3034
+ if (ret[2]) {
3035
+ throw takeFromExternrefTable0(ret[1]);
3036
+ }
3037
+ return ret[0] === 0 ? undefined : Node.__wrap(ret[0]);
3068
3038
  }
3069
3039
  /**
3070
- * Returns all ancestor nodes from parent to root.
3071
- * @returns Array of ancestor nodes
3040
+ * Returns all next sibling nodes.
3041
+ * @returns Array of next siblings
3072
3042
  * @returns {Node[]}
3073
3043
  */
3074
- ancestors() {
3075
- const ret = wasm.wordlit_ancestors(this.__wbg_ptr);
3044
+ nextSiblings() {
3045
+ const ret = wasm.wordlit_nextSiblings(this.__wbg_ptr);
3076
3046
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
3077
3047
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
3078
3048
  return v1;
3079
3049
  }
3080
3050
  /**
3081
- * Returns the index of this node within its parent's children.
3082
- * @returns The child index
3083
- * @returns {number}
3051
+ * Sets the raw word value.
3052
+ * The value should be a valid unquoted identifier (alphanumeric and underscores).
3053
+ * @param value - The raw word string to set
3054
+ * @param {string} value
3084
3055
  */
3085
- childIndex() {
3086
- const ret = wasm.wordlit_childIndex(this.__wbg_ptr);
3087
- return ret >>> 0;
3056
+ setRawValue(value) {
3057
+ const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3058
+ const len0 = WASM_VECTOR_LEN;
3059
+ wasm.wordlit_setRawValue(this.__wbg_ptr, ptr0, len0);
3088
3060
  }
3089
3061
  /**
3090
3062
  * Returns the previous sibling node.
@@ -3107,21 +3079,56 @@ export class WordLit {
3107
3079
  return v1;
3108
3080
  }
3109
3081
  /**
3110
- * Returns the next sibling node.
3111
- * @returns The next sibling, or undefined if this is the last child
3082
+ * Returns whether this node's container uses trailing commas.
3083
+ * @returns true if trailing commas are used
3084
+ * @returns {boolean}
3085
+ */
3086
+ usesTrailingCommas() {
3087
+ const ret = wasm.wordlit_usesTrailingCommas(this.__wbg_ptr);
3088
+ return ret !== 0;
3089
+ }
3090
+ /**
3091
+ * Returns the unquoted word value.
3092
+ * @returns The word literal as a string
3093
+ * @returns {string}
3094
+ */
3095
+ value() {
3096
+ let deferred1_0;
3097
+ let deferred1_1;
3098
+ try {
3099
+ const ret = wasm.wordlit_value(this.__wbg_ptr);
3100
+ deferred1_0 = ret[0];
3101
+ deferred1_1 = ret[1];
3102
+ return getStringFromWasm0(ret[0], ret[1]);
3103
+ }
3104
+ finally {
3105
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3106
+ }
3107
+ }
3108
+ /**
3109
+ * Returns the parent node in the CST.
3110
+ * @returns The parent node, or undefined if this is the root
3112
3111
  * @returns {Node | undefined}
3113
3112
  */
3114
- nextSibling() {
3115
- const ret = wasm.wordlit_nextSibling(this.__wbg_ptr);
3113
+ parent() {
3114
+ const ret = wasm.wordlit_parent(this.__wbg_ptr);
3116
3115
  return ret === 0 ? undefined : Node.__wrap(ret);
3117
3116
  }
3118
3117
  /**
3119
- * Returns all next sibling nodes.
3120
- * @returns Array of next siblings
3118
+ * Removes this node from its parent.
3119
+ * After calling this method, the node is detached from the CST and can no longer be used.
3120
+ */
3121
+ remove() {
3122
+ const ptr = this.__destroy_into_raw();
3123
+ wasm.wordlit_remove(ptr);
3124
+ }
3125
+ /**
3126
+ * Returns all ancestor nodes from parent to root.
3127
+ * @returns Array of ancestor nodes
3121
3128
  * @returns {Node[]}
3122
3129
  */
3123
- nextSiblings() {
3124
- const ret = wasm.wordlit_nextSiblings(this.__wbg_ptr);
3130
+ ancestors() {
3131
+ const ret = wasm.wordlit_ancestors(this.__wbg_ptr);
3125
3132
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
3126
3133
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
3127
3134
  return v1;
@@ -3135,31 +3142,47 @@ export class WordLit {
3135
3142
  const ret = wasm.wordlit_rootNode(this.__wbg_ptr);
3136
3143
  return ret === 0 ? undefined : RootNode.__wrap(ret);
3137
3144
  }
3138
- /**
3139
- * Returns the indentation string used at this node's depth.
3140
- * @returns The indentation string, or undefined if not applicable
3141
- * @returns {string | undefined}
3142
- */
3143
- indentText() {
3144
- const ret = wasm.wordlit_indentText(this.__wbg_ptr);
3145
- let v1;
3146
- if (ret[0] !== 0) {
3147
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
3148
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3149
- }
3150
- return v1;
3145
+ }
3146
+ if (Symbol.dispose)
3147
+ WordLit.prototype[Symbol.dispose] = WordLit.prototype.free;
3148
+ /**
3149
+ * Parses a JSONC (JSON with Comments) string into a concrete syntax tree.
3150
+ * @param text - The JSONC text to parse
3151
+ * @param options - Optional parsing options
3152
+ * @returns The root node of the parsed CST
3153
+ * @param {string} text
3154
+ * @param {ParseOptions | null} [options]
3155
+ * @returns {RootNode}
3156
+ */
3157
+ export function parse(text, options) {
3158
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3159
+ const len0 = WASM_VECTOR_LEN;
3160
+ const ret = wasm.parse(ptr0, len0, isLikeNone(options) ? 0 : addToExternrefTable0(options));
3161
+ if (ret[2]) {
3162
+ throw takeFromExternrefTable0(ret[1]);
3151
3163
  }
3152
- /**
3153
- * Returns whether this node's container uses trailing commas.
3154
- * @returns true if trailing commas are used
3155
- * @returns {boolean}
3156
- */
3157
- usesTrailingCommas() {
3158
- const ret = wasm.wordlit_usesTrailingCommas(this.__wbg_ptr);
3159
- return ret !== 0;
3164
+ return RootNode.__wrap(ret[0]);
3165
+ }
3166
+ /**
3167
+ * Parses a JSONC (JSON with Comments) string directly to a JavaScript object.
3168
+ * @param text - The JSONC text to parse
3169
+ * @param options - Optional parsing options
3170
+ * @returns The plain JavaScript value (object, array, string, number, boolean, or null)
3171
+ * @throws If the text cannot be parsed or converted
3172
+ * @param {string} text
3173
+ * @param {ParseOptions | null} [options]
3174
+ * @returns {any}
3175
+ */
3176
+ export function parseToValue(text, options) {
3177
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3178
+ const len0 = WASM_VECTOR_LEN;
3179
+ const ret = wasm.parseToValue(ptr0, len0, isLikeNone(options) ? 0 : addToExternrefTable0(options));
3180
+ if (ret[2]) {
3181
+ throw takeFromExternrefTable0(ret[1]);
3160
3182
  }
3183
+ return takeFromExternrefTable0(ret[0]);
3161
3184
  }
3162
- export function __wbg_Error_90f14b053b2af32f(arg0, arg1) {
3185
+ export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
3163
3186
  const ret = Error(getStringFromWasm0(arg0, arg1));
3164
3187
  return ret;
3165
3188
  }
@@ -3170,31 +3193,97 @@ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
3170
3193
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3171
3194
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3172
3195
  }
3173
- export function __wbg_call_90bf4b9978d51034() {
3196
+ export function __wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d(arg0, arg1) {
3197
+ const v = arg1;
3198
+ const ret = typeof v === "bigint" ? v : undefined;
3199
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
3200
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3201
+ }
3202
+ export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
3203
+ const v = arg0;
3204
+ const ret = typeof v === "boolean" ? v : undefined;
3205
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
3206
+ }
3207
+ export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
3208
+ const ret = debugString(arg1);
3209
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3210
+ const len1 = WASM_VECTOR_LEN;
3211
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3212
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3213
+ }
3214
+ export function __wbg___wbindgen_in_0d3e1e8f0c669317(arg0, arg1) {
3215
+ const ret = arg0 in arg1;
3216
+ return ret;
3217
+ }
3218
+ export function __wbg___wbindgen_is_bigint_0e1a2e3f55cfae27(arg0) {
3219
+ const ret = typeof arg0 === "bigint";
3220
+ return ret;
3221
+ }
3222
+ export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
3223
+ const ret = typeof arg0 === "function";
3224
+ return ret;
3225
+ }
3226
+ export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
3227
+ const val = arg0;
3228
+ const ret = typeof val === "object" && val !== null;
3229
+ return ret;
3230
+ }
3231
+ export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
3232
+ const ret = typeof arg0 === "string";
3233
+ return ret;
3234
+ }
3235
+ export function __wbg___wbindgen_jsval_eq_b6101cc9cef1fe36(arg0, arg1) {
3236
+ const ret = arg0 === arg1;
3237
+ return ret;
3238
+ }
3239
+ export function __wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d(arg0, arg1) {
3240
+ const ret = arg0 == arg1;
3241
+ return ret;
3242
+ }
3243
+ export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
3244
+ const obj = arg1;
3245
+ const ret = typeof obj === "number" ? obj : undefined;
3246
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
3247
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3248
+ }
3249
+ export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
3250
+ const obj = arg1;
3251
+ const ret = typeof obj === "string" ? obj : undefined;
3252
+ var ptr1 = isLikeNone(ret)
3253
+ ? 0
3254
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3255
+ var len1 = WASM_VECTOR_LEN;
3256
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3257
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3258
+ }
3259
+ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
3260
+ throw new Error(getStringFromWasm0(arg0, arg1));
3261
+ }
3262
+ export function __wbg_call_abb4ff46ce38be40() {
3174
3263
  return handleError(function (arg0, arg1) {
3175
3264
  const ret = arg0.call(arg1);
3176
3265
  return ret;
3177
3266
  }, arguments);
3178
3267
  }
3179
- export function __wbg_done_73bb10bcf6e0c339(arg0) {
3268
+ export function __wbg_done_62ea16af4ce34b24(arg0) {
3180
3269
  const ret = arg0.done;
3181
3270
  return ret;
3182
3271
  }
3183
- export function __wbg_entries_4f3de4ccde51d587(arg0) {
3272
+ export function __wbg_entries_83c79938054e065f(arg0) {
3184
3273
  const ret = Object.entries(arg0);
3185
3274
  return ret;
3186
3275
  }
3187
- export function __wbg_get_6e64f6b3af0c61a2(arg0, arg1) {
3276
+ export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
3188
3277
  const ret = arg0[arg1 >>> 0];
3189
3278
  return ret;
3190
3279
  }
3191
- export function __wbg_get_bb21663672334172() {
3280
+ export function __wbg_get_af9dab7e9603ea93() {
3192
3281
  return handleError(function (arg0, arg1) {
3193
3282
  const ret = Reflect.get(arg0, arg1);
3194
3283
  return ret;
3195
3284
  }, arguments);
3196
3285
  }
3197
- export function __wbg_instanceof_ArrayBuffer_625e762023eb35cf(arg0) {
3286
+ export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
3198
3287
  let result;
3199
3288
  try {
3200
3289
  result = arg0 instanceof ArrayBuffer;
@@ -3205,7 +3294,7 @@ export function __wbg_instanceof_ArrayBuffer_625e762023eb35cf(arg0) {
3205
3294
  const ret = result;
3206
3295
  return ret;
3207
3296
  }
3208
- export function __wbg_instanceof_Map_7d3de120a6cca988(arg0) {
3297
+ export function __wbg_instanceof_Map_084be8da74364158(arg0) {
3209
3298
  let result;
3210
3299
  try {
3211
3300
  result = arg0 instanceof Map;
@@ -3216,7 +3305,7 @@ export function __wbg_instanceof_Map_7d3de120a6cca988(arg0) {
3216
3305
  const ret = result;
3217
3306
  return ret;
3218
3307
  }
3219
- export function __wbg_instanceof_Uint8Array_6935b7b95ef40080(arg0) {
3308
+ export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
3220
3309
  let result;
3221
3310
  try {
3222
3311
  result = arg0 instanceof Uint8Array;
@@ -3227,51 +3316,51 @@ export function __wbg_instanceof_Uint8Array_6935b7b95ef40080(arg0) {
3227
3316
  const ret = result;
3228
3317
  return ret;
3229
3318
  }
3230
- export function __wbg_isArray_fe31d4a8d77ae781(arg0) {
3319
+ export function __wbg_isArray_51fd9e6422c0a395(arg0) {
3231
3320
  const ret = Array.isArray(arg0);
3232
3321
  return ret;
3233
3322
  }
3234
- export function __wbg_isSafeInteger_342db8cae87edb4e(arg0) {
3323
+ export function __wbg_isSafeInteger_ae7d3f054d55fa16(arg0) {
3235
3324
  const ret = Number.isSafeInteger(arg0);
3236
3325
  return ret;
3237
3326
  }
3238
- export function __wbg_iterator_fe047a6b04943f88() {
3327
+ export function __wbg_iterator_27b7c8b35ab3e86b() {
3239
3328
  const ret = Symbol.iterator;
3240
3329
  return ret;
3241
3330
  }
3242
- export function __wbg_length_09646ad20ebb8534(arg0) {
3331
+ export function __wbg_length_22ac23eaec9d8053(arg0) {
3243
3332
  const ret = arg0.length;
3244
3333
  return ret;
3245
3334
  }
3246
- export function __wbg_length_537fa63a6103cbdb(arg0) {
3335
+ export function __wbg_length_d45040a40c570362(arg0) {
3247
3336
  const ret = arg0.length;
3248
3337
  return ret;
3249
3338
  }
3250
- export function __wbg_new_1b925e0c0e1d30ba() {
3339
+ export function __wbg_new_1ba21ce319a06297() {
3251
3340
  const ret = new Object();
3252
3341
  return ret;
3253
3342
  }
3254
- export function __wbg_new_3c48ee6a683248da() {
3255
- const ret = new Map();
3343
+ export function __wbg_new_25f239778d6112b9() {
3344
+ const ret = new Array();
3256
3345
  return ret;
3257
3346
  }
3258
- export function __wbg_new_7c134f9c83abf3a4(arg0, arg1) {
3259
- const ret = new Error(getStringFromWasm0(arg0, arg1));
3347
+ export function __wbg_new_6421f6084cc5bc5a(arg0) {
3348
+ const ret = new Uint8Array(arg0);
3260
3349
  return ret;
3261
3350
  }
3262
- export function __wbg_new_d6b08dae7359cebb(arg0) {
3263
- const ret = new Uint8Array(arg0);
3351
+ export function __wbg_new_b546ae120718850e() {
3352
+ const ret = new Map();
3264
3353
  return ret;
3265
3354
  }
3266
- export function __wbg_new_d8a154d0939e6bb4() {
3267
- const ret = new Array();
3355
+ export function __wbg_new_df1173567d5ff028(arg0, arg1) {
3356
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3268
3357
  return ret;
3269
3358
  }
3270
- export function __wbg_next_59846e169128a0ea(arg0) {
3359
+ export function __wbg_next_138a17bbf04e926c(arg0) {
3271
3360
  const ret = arg0.next;
3272
3361
  return ret;
3273
3362
  }
3274
- export function __wbg_next_c782e76a0400870a() {
3363
+ export function __wbg_next_3cfe5c0fe2a4cc53() {
3275
3364
  return handleError(function (arg0) {
3276
3365
  const ret = arg0.next();
3277
3366
  return ret;
@@ -3285,89 +3374,23 @@ export function __wbg_objectprop_new(arg0) {
3285
3374
  const ret = ObjectProp.__wrap(arg0);
3286
3375
  return ret;
3287
3376
  }
3288
- export function __wbg_prototypesetcall_a81ac58a5b6e988c(arg0, arg1, arg2) {
3377
+ export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
3289
3378
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
3290
3379
  }
3291
- export function __wbg_set_038a8a067d895c6a(arg0, arg1, arg2) {
3292
- arg0[arg1 >>> 0] = arg2;
3293
- }
3294
3380
  export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
3295
3381
  arg0[arg1] = arg2;
3296
3382
  }
3297
- export function __wbg_set_a15b7b524330d4f1(arg0, arg1, arg2) {
3383
+ export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
3384
+ arg0[arg1 >>> 0] = arg2;
3385
+ }
3386
+ export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
3298
3387
  const ret = arg0.set(arg1, arg2);
3299
3388
  return ret;
3300
3389
  }
3301
- export function __wbg_value_4ae21701b6f5c482(arg0) {
3390
+ export function __wbg_value_57b7b035e117f7ee(arg0) {
3302
3391
  const ret = arg0.value;
3303
3392
  return ret;
3304
3393
  }
3305
- export function __wbg_wbindgenbigintgetasi64_d3d568a64e846827(arg0, arg1) {
3306
- const v = arg1;
3307
- const ret = typeof v === "bigint" ? v : undefined;
3308
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
3309
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3310
- }
3311
- export function __wbg_wbindgenbooleanget_527bfac1bf7c06df(arg0) {
3312
- const v = arg0;
3313
- const ret = typeof v === "boolean" ? v : undefined;
3314
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
3315
- }
3316
- export function __wbg_wbindgendebugstring_0c28a61befa1f3ce(arg0, arg1) {
3317
- const ret = debugString(arg1);
3318
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3319
- const len1 = WASM_VECTOR_LEN;
3320
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3321
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3322
- }
3323
- export function __wbg_wbindgenin_ed944d66e9a43ef2(arg0, arg1) {
3324
- const ret = arg0 in arg1;
3325
- return ret;
3326
- }
3327
- export function __wbg_wbindgenisbigint_1a3fbe7ad37b3968(arg0) {
3328
- const ret = typeof arg0 === "bigint";
3329
- return ret;
3330
- }
3331
- export function __wbg_wbindgenisfunction_27a5c72d80bbdf07(arg0) {
3332
- const ret = typeof arg0 === "function";
3333
- return ret;
3334
- }
3335
- export function __wbg_wbindgenisobject_bdb9aa7f2dd707ef(arg0) {
3336
- const val = arg0;
3337
- const ret = typeof val === "object" && val !== null;
3338
- return ret;
3339
- }
3340
- export function __wbg_wbindgenisstring_55b63daa584dc807(arg0) {
3341
- const ret = typeof arg0 === "string";
3342
- return ret;
3343
- }
3344
- export function __wbg_wbindgenjsvaleq_af67af1ed6574f4f(arg0, arg1) {
3345
- const ret = arg0 === arg1;
3346
- return ret;
3347
- }
3348
- export function __wbg_wbindgenjsvallooseeq_4f1ced8136023b79(arg0, arg1) {
3349
- const ret = arg0 == arg1;
3350
- return ret;
3351
- }
3352
- export function __wbg_wbindgennumberget_41a5988c9fc46eeb(arg0, arg1) {
3353
- const obj = arg1;
3354
- const ret = typeof obj === "number" ? obj : undefined;
3355
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
3356
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3357
- }
3358
- export function __wbg_wbindgenstringget_c45e0c672ada3c64(arg0, arg1) {
3359
- const obj = arg1;
3360
- const ret = typeof obj === "string" ? obj : undefined;
3361
- var ptr1 = isLikeNone(ret)
3362
- ? 0
3363
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3364
- var len1 = WASM_VECTOR_LEN;
3365
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3366
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3367
- }
3368
- export function __wbg_wbindgenthrow_681185b504fabc8e(arg0, arg1) {
3369
- throw new Error(getStringFromWasm0(arg0, arg1));
3370
- }
3371
3394
  export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
3372
3395
  // Cast intrinsic for `Ref(String) -> Externref`.
3373
3396
  const ret = getStringFromWasm0(arg0, arg1);
@@ -3389,7 +3412,7 @@ export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
3389
3412
  return ret;
3390
3413
  }
3391
3414
  export function __wbindgen_init_externref_table() {
3392
- const table = wasm.__wbindgen_export_4;
3415
+ const table = wasm.__wbindgen_externrefs;
3393
3416
  const offset = table.grow(4);
3394
3417
  table.set(0, undefined);
3395
3418
  table.set(offset + 0, undefined);