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