@sebastienrousseau/noyalib-wasm 0.0.27 → 0.0.28
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/LICENSE-APACHE +190 -0
- package/LICENSE-MIT +21 -0
- package/noyalib_wasm_bg.wasm +0 -0
- package/package.json +7 -17
- package/noyalib_wasm_bg.js +0 -678
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Sebastien Rousseau
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sebastien Rousseau
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/noyalib_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebastienrousseau/noyalib-wasm",
|
|
3
|
-
"type": "module",
|
|
4
3
|
"collaborators": [
|
|
5
4
|
"Sebastien Rousseau <sebastian.rousseau@gmail.com>"
|
|
6
5
|
],
|
|
7
6
|
"description": "WebAssembly (wasm-bindgen) bindings for the noyalib YAML library — browser-ready parse / serialise / lossless edit",
|
|
8
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.28",
|
|
9
8
|
"license": "MIT OR Apache-2.0",
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
@@ -14,21 +13,12 @@
|
|
|
14
13
|
"files": [
|
|
15
14
|
"noyalib_wasm_bg.wasm",
|
|
16
15
|
"noyalib_wasm.js",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
16
|
+
"noyalib_wasm.d.ts",
|
|
17
|
+
"LICENSE-APACHE",
|
|
18
|
+
"LICENSE-MIT"
|
|
19
19
|
],
|
|
20
|
-
"
|
|
20
|
+
"module": "noyalib_wasm.js",
|
|
21
21
|
"homepage": "https://github.com/sebastienrousseau/noyalib-wasm",
|
|
22
22
|
"types": "noyalib_wasm.d.ts",
|
|
23
|
-
"sideEffects":
|
|
24
|
-
|
|
25
|
-
"./snippets/*"
|
|
26
|
-
],
|
|
27
|
-
"keywords": [
|
|
28
|
-
"yaml",
|
|
29
|
-
"wasm",
|
|
30
|
-
"wasm-bindgen",
|
|
31
|
-
"browser",
|
|
32
|
-
"noyalib"
|
|
33
|
-
]
|
|
34
|
-
}
|
|
23
|
+
"sideEffects": false
|
|
24
|
+
}
|
package/noyalib_wasm_bg.js
DELETED
|
@@ -1,678 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A YAML document with byte-faithful source preservation and path-targeted
|
|
3
|
-
* edits.
|
|
4
|
-
*/
|
|
5
|
-
export class WasmDocument {
|
|
6
|
-
__destroy_into_raw() {
|
|
7
|
-
const ptr = this.__wbg_ptr;
|
|
8
|
-
this.__wbg_ptr = 0;
|
|
9
|
-
WasmDocumentFinalization.unregister(this);
|
|
10
|
-
return ptr;
|
|
11
|
-
}
|
|
12
|
-
free() {
|
|
13
|
-
const ptr = this.__destroy_into_raw();
|
|
14
|
-
wasm.__wbg_wasmdocument_free(ptr, 0);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Read the YAML comments associated with the node at `path`.
|
|
18
|
-
* Returns `{ before: string[], inline: string | null }` so the
|
|
19
|
-
* caller can surface human-authored doc-comments alongside
|
|
20
|
-
* values — the demo that motivates the entire CST architecture.
|
|
21
|
-
*
|
|
22
|
-
* Bound on the JS side as `commentsAt(path)` per JS naming
|
|
23
|
-
* conventions.
|
|
24
|
-
* @param {string} path
|
|
25
|
-
* @returns {any}
|
|
26
|
-
*/
|
|
27
|
-
commentsAt(path) {
|
|
28
|
-
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29
|
-
const len0 = WASM_VECTOR_LEN;
|
|
30
|
-
const ret = wasm.wasmdocument_commentsAt(this.__wbg_ptr, ptr0, len0);
|
|
31
|
-
if (ret[2]) {
|
|
32
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
33
|
-
}
|
|
34
|
-
return takeFromExternrefTable0(ret[0]);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Get the parsed value at a dotted path.
|
|
38
|
-
* @param {string} path
|
|
39
|
-
* @returns {any}
|
|
40
|
-
*/
|
|
41
|
-
get(path) {
|
|
42
|
-
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
43
|
-
const len0 = WASM_VECTOR_LEN;
|
|
44
|
-
const ret = wasm.wasmdocument_get(this.__wbg_ptr, ptr0, len0);
|
|
45
|
-
if (ret[2]) {
|
|
46
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
47
|
-
}
|
|
48
|
-
return takeFromExternrefTable0(ret[0]);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get the raw source fragment at a dotted path.
|
|
52
|
-
*
|
|
53
|
-
* Bound on the JS side as `getSource(path)` per JS naming
|
|
54
|
-
* conventions.
|
|
55
|
-
* @param {string} path
|
|
56
|
-
* @returns {any}
|
|
57
|
-
*/
|
|
58
|
-
getSource(path) {
|
|
59
|
-
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
60
|
-
const len0 = WASM_VECTOR_LEN;
|
|
61
|
-
const ret = wasm.wasmdocument_getSource(this.__wbg_ptr, ptr0, len0);
|
|
62
|
-
return ret;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Parse a YAML string into a lossless Document.
|
|
66
|
-
* @param {string} yaml
|
|
67
|
-
*/
|
|
68
|
-
constructor(yaml) {
|
|
69
|
-
const ptr0 = passStringToWasm0(yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
70
|
-
const len0 = WASM_VECTOR_LEN;
|
|
71
|
-
const ret = wasm.wasmdocument_new(ptr0, len0);
|
|
72
|
-
if (ret[2]) {
|
|
73
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
74
|
-
}
|
|
75
|
-
this.__wbg_ptr = ret[0];
|
|
76
|
-
WasmDocumentFinalization.register(this, this.__wbg_ptr, this);
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Replace the bytes at `start..end` with `replacement`.
|
|
81
|
-
*
|
|
82
|
-
* Bound on the JS side as `replaceSpan(start, end, replacement)`
|
|
83
|
-
* per JS naming conventions.
|
|
84
|
-
* @param {number} start
|
|
85
|
-
* @param {number} end
|
|
86
|
-
* @param {string} replacement
|
|
87
|
-
*/
|
|
88
|
-
replaceSpan(start, end, replacement) {
|
|
89
|
-
const ptr0 = passStringToWasm0(replacement, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
90
|
-
const len0 = WASM_VECTOR_LEN;
|
|
91
|
-
const ret = wasm.wasmdocument_replaceSpan(this.__wbg_ptr, start, end, ptr0, len0);
|
|
92
|
-
if (ret[1]) {
|
|
93
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Set a value at a dotted path using a YAML fragment string.
|
|
98
|
-
* @param {string} path
|
|
99
|
-
* @param {string} fragment
|
|
100
|
-
*/
|
|
101
|
-
set(path, fragment) {
|
|
102
|
-
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
103
|
-
const len0 = WASM_VECTOR_LEN;
|
|
104
|
-
const ptr1 = passStringToWasm0(fragment, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
105
|
-
const len1 = WASM_VECTOR_LEN;
|
|
106
|
-
const ret = wasm.wasmdocument_set(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
107
|
-
if (ret[1]) {
|
|
108
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Set a value at a dotted path using a JS object.
|
|
113
|
-
*
|
|
114
|
-
* Bound on the JS side as `setValue(path, value)` per JS naming
|
|
115
|
-
* conventions.
|
|
116
|
-
* @param {string} path
|
|
117
|
-
* @param {any} value
|
|
118
|
-
*/
|
|
119
|
-
setValue(path, value) {
|
|
120
|
-
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
121
|
-
const len0 = WASM_VECTOR_LEN;
|
|
122
|
-
const ret = wasm.wasmdocument_setValue(this.__wbg_ptr, ptr0, len0, value);
|
|
123
|
-
if (ret[1]) {
|
|
124
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Get the byte range `{ start, end }` for the value at a dotted path.
|
|
129
|
-
*
|
|
130
|
-
* Bound on the JS side as `spanAt(path)` per JS naming
|
|
131
|
-
* conventions.
|
|
132
|
-
* @param {string} path
|
|
133
|
-
* @returns {any}
|
|
134
|
-
*/
|
|
135
|
-
spanAt(path) {
|
|
136
|
-
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
137
|
-
const len0 = WASM_VECTOR_LEN;
|
|
138
|
-
const ret = wasm.wasmdocument_spanAt(this.__wbg_ptr, ptr0, len0);
|
|
139
|
-
if (ret[2]) {
|
|
140
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
141
|
-
}
|
|
142
|
-
return takeFromExternrefTable0(ret[0]);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Re-emit the document as a string. Byte-identical to original if no
|
|
146
|
-
* edits.
|
|
147
|
-
*
|
|
148
|
-
* Bound on the JS side as `toString()` (the conventional camelCase
|
|
149
|
-
* name) so callers can write `doc.toString()` and override the
|
|
150
|
-
* default `Object.prototype.toString` rather than coexist with it.
|
|
151
|
-
* @returns {string}
|
|
152
|
-
*/
|
|
153
|
-
toString() {
|
|
154
|
-
let deferred1_0;
|
|
155
|
-
let deferred1_1;
|
|
156
|
-
try {
|
|
157
|
-
const ret = wasm.wasmdocument_toString(this.__wbg_ptr);
|
|
158
|
-
deferred1_0 = ret[0];
|
|
159
|
-
deferred1_1 = ret[1];
|
|
160
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
161
|
-
} finally {
|
|
162
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
if (Symbol.dispose) WasmDocument.prototype[Symbol.dispose] = WasmDocument.prototype.free;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Get a value at a dotted path from a YAML string. Bound on the
|
|
170
|
-
* JS side as `getPath(yaml, path)` per JS naming conventions.
|
|
171
|
-
* @param {string} yaml
|
|
172
|
-
* @param {string} path
|
|
173
|
-
* @returns {any}
|
|
174
|
-
*/
|
|
175
|
-
export function getPath(yaml, path) {
|
|
176
|
-
const ptr0 = passStringToWasm0(yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
177
|
-
const len0 = WASM_VECTOR_LEN;
|
|
178
|
-
const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
179
|
-
const len1 = WASM_VECTOR_LEN;
|
|
180
|
-
const ret = wasm.getPath(ptr0, len0, ptr1, len1);
|
|
181
|
-
if (ret[2]) {
|
|
182
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
183
|
-
}
|
|
184
|
-
return takeFromExternrefTable0(ret[0]);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Merge two YAML documents.
|
|
189
|
-
* @param {string} base_yaml
|
|
190
|
-
* @param {string} override_yaml
|
|
191
|
-
* @returns {string}
|
|
192
|
-
*/
|
|
193
|
-
export function merge(base_yaml, override_yaml) {
|
|
194
|
-
let deferred4_0;
|
|
195
|
-
let deferred4_1;
|
|
196
|
-
try {
|
|
197
|
-
const ptr0 = passStringToWasm0(base_yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
198
|
-
const len0 = WASM_VECTOR_LEN;
|
|
199
|
-
const ptr1 = passStringToWasm0(override_yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
200
|
-
const len1 = WASM_VECTOR_LEN;
|
|
201
|
-
const ret = wasm.merge(ptr0, len0, ptr1, len1);
|
|
202
|
-
var ptr3 = ret[0];
|
|
203
|
-
var len3 = ret[1];
|
|
204
|
-
if (ret[3]) {
|
|
205
|
-
ptr3 = 0; len3 = 0;
|
|
206
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
207
|
-
}
|
|
208
|
-
deferred4_0 = ptr3;
|
|
209
|
-
deferred4_1 = len3;
|
|
210
|
-
return getStringFromWasm0(ptr3, len3);
|
|
211
|
-
} finally {
|
|
212
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Parse a YAML string and return a JS object.
|
|
218
|
-
* @param {string} yaml
|
|
219
|
-
* @returns {any}
|
|
220
|
-
*/
|
|
221
|
-
export function parse(yaml) {
|
|
222
|
-
const ptr0 = passStringToWasm0(yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
223
|
-
const len0 = WASM_VECTOR_LEN;
|
|
224
|
-
const ret = wasm.parse(ptr0, len0);
|
|
225
|
-
if (ret[2]) {
|
|
226
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
227
|
-
}
|
|
228
|
-
return takeFromExternrefTable0(ret[0]);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Serialize a JS object to a YAML string.
|
|
233
|
-
* @param {any} value
|
|
234
|
-
* @returns {string}
|
|
235
|
-
*/
|
|
236
|
-
export function stringify(value) {
|
|
237
|
-
let deferred2_0;
|
|
238
|
-
let deferred2_1;
|
|
239
|
-
try {
|
|
240
|
-
const ret = wasm.stringify(value);
|
|
241
|
-
var ptr1 = ret[0];
|
|
242
|
-
var len1 = ret[1];
|
|
243
|
-
if (ret[3]) {
|
|
244
|
-
ptr1 = 0; len1 = 0;
|
|
245
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
246
|
-
}
|
|
247
|
-
deferred2_0 = ptr1;
|
|
248
|
-
deferred2_1 = len1;
|
|
249
|
-
return getStringFromWasm0(ptr1, len1);
|
|
250
|
-
} finally {
|
|
251
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Validate YAML against the JSON-compatible schema. Bound on the
|
|
257
|
-
* JS side as `validateJson(yaml)` per JS naming conventions.
|
|
258
|
-
* @param {string} yaml
|
|
259
|
-
* @returns {boolean}
|
|
260
|
-
*/
|
|
261
|
-
export function validateJson(yaml) {
|
|
262
|
-
const ptr0 = passStringToWasm0(yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
263
|
-
const len0 = WASM_VECTOR_LEN;
|
|
264
|
-
const ret = wasm.validateJson(ptr0, len0);
|
|
265
|
-
if (ret[2]) {
|
|
266
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
267
|
-
}
|
|
268
|
-
return ret[0] !== 0;
|
|
269
|
-
}
|
|
270
|
-
export function __wbg_Error_408e67f47ca7b58b(arg0, arg1) {
|
|
271
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
272
|
-
return ret;
|
|
273
|
-
}
|
|
274
|
-
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
275
|
-
const ret = String(arg1);
|
|
276
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
277
|
-
const len1 = WASM_VECTOR_LEN;
|
|
278
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
279
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
280
|
-
}
|
|
281
|
-
export function __wbg___wbindgen_bigint_get_as_i64_c4ecf48528083721(arg0, arg1) {
|
|
282
|
-
const v = arg1;
|
|
283
|
-
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
284
|
-
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
285
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
286
|
-
}
|
|
287
|
-
export function __wbg___wbindgen_boolean_get_c9c83ebd41b34df3(arg0) {
|
|
288
|
-
const v = arg0;
|
|
289
|
-
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
290
|
-
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
291
|
-
}
|
|
292
|
-
export function __wbg___wbindgen_debug_string_a57024b9c6e4a48b(arg0, arg1) {
|
|
293
|
-
const ret = debugString(arg1);
|
|
294
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
295
|
-
const len1 = WASM_VECTOR_LEN;
|
|
296
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
297
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
298
|
-
}
|
|
299
|
-
export function __wbg___wbindgen_in_ac983077f137f2e6(arg0, arg1) {
|
|
300
|
-
const ret = arg0 in arg1;
|
|
301
|
-
return ret;
|
|
302
|
-
}
|
|
303
|
-
export function __wbg___wbindgen_is_bigint_8ffbbef442139384(arg0) {
|
|
304
|
-
const ret = typeof(arg0) === 'bigint';
|
|
305
|
-
return ret;
|
|
306
|
-
}
|
|
307
|
-
export function __wbg___wbindgen_is_function_5e4570eb24ffa122(arg0) {
|
|
308
|
-
const ret = typeof(arg0) === 'function';
|
|
309
|
-
return ret;
|
|
310
|
-
}
|
|
311
|
-
export function __wbg___wbindgen_is_object_a2790eb24c211ea0(arg0) {
|
|
312
|
-
const val = arg0;
|
|
313
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
314
|
-
return ret;
|
|
315
|
-
}
|
|
316
|
-
export function __wbg___wbindgen_is_string_e6f02f0ea5f20a32(arg0) {
|
|
317
|
-
const ret = typeof(arg0) === 'string';
|
|
318
|
-
return ret;
|
|
319
|
-
}
|
|
320
|
-
export function __wbg___wbindgen_jsval_eq_0a18949a61670320(arg0, arg1) {
|
|
321
|
-
const ret = arg0 === arg1;
|
|
322
|
-
return ret;
|
|
323
|
-
}
|
|
324
|
-
export function __wbg___wbindgen_jsval_loose_eq_acf2776254a8d832(arg0, arg1) {
|
|
325
|
-
const ret = arg0 == arg1;
|
|
326
|
-
return ret;
|
|
327
|
-
}
|
|
328
|
-
export function __wbg___wbindgen_number_get_136b9679cab35cfb(arg0, arg1) {
|
|
329
|
-
const obj = arg1;
|
|
330
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
331
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
332
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
333
|
-
}
|
|
334
|
-
export function __wbg___wbindgen_string_get_d154f1e671052120(arg0, arg1) {
|
|
335
|
-
const obj = arg1;
|
|
336
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
337
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
338
|
-
var len1 = WASM_VECTOR_LEN;
|
|
339
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
340
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
341
|
-
}
|
|
342
|
-
export function __wbg___wbindgen_throw_bb96b2010945f0bc(arg0, arg1) {
|
|
343
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
344
|
-
}
|
|
345
|
-
export function __wbg_call_1c5886ab9c57d1c7() { return handleError(function (arg0, arg1) {
|
|
346
|
-
const ret = arg0.call(arg1);
|
|
347
|
-
return ret;
|
|
348
|
-
}, arguments); }
|
|
349
|
-
export function __wbg_done_669171204c3dcae2(arg0) {
|
|
350
|
-
const ret = arg0.done;
|
|
351
|
-
return ret;
|
|
352
|
-
}
|
|
353
|
-
export function __wbg_entries_7774d489e1da5f4f(arg0) {
|
|
354
|
-
const ret = Object.entries(arg0);
|
|
355
|
-
return ret;
|
|
356
|
-
}
|
|
357
|
-
export function __wbg_get_c0c8f8d7da0c03dd(arg0, arg1) {
|
|
358
|
-
const ret = arg0[arg1 >>> 0];
|
|
359
|
-
return ret;
|
|
360
|
-
}
|
|
361
|
-
export function __wbg_get_d173c0308df22d37() { return handleError(function (arg0, arg1) {
|
|
362
|
-
const ret = Reflect.get(arg0, arg1);
|
|
363
|
-
return ret;
|
|
364
|
-
}, arguments); }
|
|
365
|
-
export function __wbg_get_unchecked_e20b893aeafc3fca(arg0, arg1) {
|
|
366
|
-
const ret = arg0[arg1 >>> 0];
|
|
367
|
-
return ret;
|
|
368
|
-
}
|
|
369
|
-
export function __wbg_instanceof_ArrayBuffer_993d02d2d254cad1(arg0) {
|
|
370
|
-
let result;
|
|
371
|
-
try {
|
|
372
|
-
result = arg0 instanceof ArrayBuffer;
|
|
373
|
-
} catch (_) {
|
|
374
|
-
result = false;
|
|
375
|
-
}
|
|
376
|
-
const ret = result;
|
|
377
|
-
return ret;
|
|
378
|
-
}
|
|
379
|
-
export function __wbg_instanceof_Map_9a4d6ead180ae3a9(arg0) {
|
|
380
|
-
let result;
|
|
381
|
-
try {
|
|
382
|
-
result = arg0 instanceof Map;
|
|
383
|
-
} catch (_) {
|
|
384
|
-
result = false;
|
|
385
|
-
}
|
|
386
|
-
const ret = result;
|
|
387
|
-
return ret;
|
|
388
|
-
}
|
|
389
|
-
export function __wbg_instanceof_Uint8Array_f935dbb0aa7cdeed(arg0) {
|
|
390
|
-
let result;
|
|
391
|
-
try {
|
|
392
|
-
result = arg0 instanceof Uint8Array;
|
|
393
|
-
} catch (_) {
|
|
394
|
-
result = false;
|
|
395
|
-
}
|
|
396
|
-
const ret = result;
|
|
397
|
-
return ret;
|
|
398
|
-
}
|
|
399
|
-
export function __wbg_isArray_6339f732981044bf(arg0) {
|
|
400
|
-
const ret = Array.isArray(arg0);
|
|
401
|
-
return ret;
|
|
402
|
-
}
|
|
403
|
-
export function __wbg_isSafeInteger_f3d6cd19ccfe4512(arg0) {
|
|
404
|
-
const ret = Number.isSafeInteger(arg0);
|
|
405
|
-
return ret;
|
|
406
|
-
}
|
|
407
|
-
export function __wbg_iterator_5cebbb86e33c6dd6() {
|
|
408
|
-
const ret = Symbol.iterator;
|
|
409
|
-
return ret;
|
|
410
|
-
}
|
|
411
|
-
export function __wbg_length_36bd29c6848c2144(arg0) {
|
|
412
|
-
const ret = arg0.length;
|
|
413
|
-
return ret;
|
|
414
|
-
}
|
|
415
|
-
export function __wbg_length_ecfa2c63d3d0d82c(arg0) {
|
|
416
|
-
const ret = arg0.length;
|
|
417
|
-
return ret;
|
|
418
|
-
}
|
|
419
|
-
export function __wbg_new_116be93542d39019() {
|
|
420
|
-
const ret = new Array();
|
|
421
|
-
return ret;
|
|
422
|
-
}
|
|
423
|
-
export function __wbg_new_77cc4f4f472aeb81(arg0) {
|
|
424
|
-
const ret = new Uint8Array(arg0);
|
|
425
|
-
return ret;
|
|
426
|
-
}
|
|
427
|
-
export function __wbg_new_cdf041679ded4c5f() {
|
|
428
|
-
const ret = new Map();
|
|
429
|
-
return ret;
|
|
430
|
-
}
|
|
431
|
-
export function __wbg_new_ebe3e0f6837f0879() {
|
|
432
|
-
const ret = new Object();
|
|
433
|
-
return ret;
|
|
434
|
-
}
|
|
435
|
-
export function __wbg_next_42cf16ee0dafc9e2() { return handleError(function (arg0) {
|
|
436
|
-
const ret = arg0.next();
|
|
437
|
-
return ret;
|
|
438
|
-
}, arguments); }
|
|
439
|
-
export function __wbg_next_8f26b64fa5e9f64b(arg0) {
|
|
440
|
-
const ret = arg0.next;
|
|
441
|
-
return ret;
|
|
442
|
-
}
|
|
443
|
-
export function __wbg_prototypesetcall_de8e0d9553586985(arg0, arg1, arg2) {
|
|
444
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
445
|
-
}
|
|
446
|
-
export function __wbg_set_014226dfeca53178(arg0, arg1, arg2) {
|
|
447
|
-
const ret = arg0.set(arg1, arg2);
|
|
448
|
-
return ret;
|
|
449
|
-
}
|
|
450
|
-
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
451
|
-
arg0[arg1] = arg2;
|
|
452
|
-
}
|
|
453
|
-
export function __wbg_set_a80955eb93b145c6(arg0, arg1, arg2) {
|
|
454
|
-
arg0[arg1 >>> 0] = arg2;
|
|
455
|
-
}
|
|
456
|
-
export function __wbg_value_1e2369fab29b420e(arg0) {
|
|
457
|
-
const ret = arg0.value;
|
|
458
|
-
return ret;
|
|
459
|
-
}
|
|
460
|
-
export function __wbindgen_cast_0000000000000001(arg0) {
|
|
461
|
-
// Cast intrinsic for `F64 -> Externref`.
|
|
462
|
-
const ret = arg0;
|
|
463
|
-
return ret;
|
|
464
|
-
}
|
|
465
|
-
export function __wbindgen_cast_0000000000000002(arg0) {
|
|
466
|
-
// Cast intrinsic for `I64 -> Externref`.
|
|
467
|
-
const ret = arg0;
|
|
468
|
-
return ret;
|
|
469
|
-
}
|
|
470
|
-
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
471
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
472
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
473
|
-
return ret;
|
|
474
|
-
}
|
|
475
|
-
export function __wbindgen_cast_0000000000000004(arg0) {
|
|
476
|
-
// Cast intrinsic for `U64 -> Externref`.
|
|
477
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
478
|
-
return ret;
|
|
479
|
-
}
|
|
480
|
-
export function __wbindgen_init_externref_table() {
|
|
481
|
-
const table = wasm.__wbindgen_externrefs;
|
|
482
|
-
const offset = table.grow(4);
|
|
483
|
-
table.set(0, undefined);
|
|
484
|
-
table.set(offset + 0, undefined);
|
|
485
|
-
table.set(offset + 1, null);
|
|
486
|
-
table.set(offset + 2, true);
|
|
487
|
-
table.set(offset + 3, false);
|
|
488
|
-
}
|
|
489
|
-
const WasmDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
490
|
-
? { register: () => {}, unregister: () => {} }
|
|
491
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmdocument_free(ptr, 1));
|
|
492
|
-
|
|
493
|
-
function addToExternrefTable0(obj) {
|
|
494
|
-
const idx = wasm.__externref_table_alloc();
|
|
495
|
-
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
496
|
-
return idx;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
function debugString(val) {
|
|
500
|
-
// primitive types
|
|
501
|
-
const type = typeof val;
|
|
502
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
503
|
-
return `${val}`;
|
|
504
|
-
}
|
|
505
|
-
if (type == 'string') {
|
|
506
|
-
return `"${val}"`;
|
|
507
|
-
}
|
|
508
|
-
if (type == 'symbol') {
|
|
509
|
-
const description = val.description;
|
|
510
|
-
if (description == null) {
|
|
511
|
-
return 'Symbol';
|
|
512
|
-
} else {
|
|
513
|
-
return `Symbol(${description})`;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
if (type == 'function') {
|
|
517
|
-
const name = val.name;
|
|
518
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
519
|
-
return `Function(${name})`;
|
|
520
|
-
} else {
|
|
521
|
-
return 'Function';
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
// objects
|
|
525
|
-
if (Array.isArray(val)) {
|
|
526
|
-
const length = val.length;
|
|
527
|
-
let debug = '[';
|
|
528
|
-
if (length > 0) {
|
|
529
|
-
debug += debugString(val[0]);
|
|
530
|
-
}
|
|
531
|
-
for(let i = 1; i < length; i++) {
|
|
532
|
-
debug += ', ' + debugString(val[i]);
|
|
533
|
-
}
|
|
534
|
-
debug += ']';
|
|
535
|
-
return debug;
|
|
536
|
-
}
|
|
537
|
-
// Test for built-in
|
|
538
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
539
|
-
let className;
|
|
540
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
541
|
-
className = builtInMatches[1];
|
|
542
|
-
} else {
|
|
543
|
-
// Failed to match the standard '[object ClassName]'
|
|
544
|
-
return toString.call(val);
|
|
545
|
-
}
|
|
546
|
-
if (className == 'Object') {
|
|
547
|
-
// we're a user defined class or Object
|
|
548
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
549
|
-
// easier than looping through ownProperties of `val`.
|
|
550
|
-
try {
|
|
551
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
552
|
-
} catch (_) {
|
|
553
|
-
return 'Object';
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
// errors
|
|
557
|
-
if (val instanceof Error) {
|
|
558
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
559
|
-
}
|
|
560
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
561
|
-
return className;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
565
|
-
ptr = ptr >>> 0;
|
|
566
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
let cachedDataViewMemory0 = null;
|
|
570
|
-
function getDataViewMemory0() {
|
|
571
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
572
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
573
|
-
}
|
|
574
|
-
return cachedDataViewMemory0;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
function getStringFromWasm0(ptr, len) {
|
|
578
|
-
return decodeText(ptr >>> 0, len);
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
let cachedUint8ArrayMemory0 = null;
|
|
582
|
-
function getUint8ArrayMemory0() {
|
|
583
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
584
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
585
|
-
}
|
|
586
|
-
return cachedUint8ArrayMemory0;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
function handleError(f, args) {
|
|
590
|
-
try {
|
|
591
|
-
return f.apply(this, args);
|
|
592
|
-
} catch (e) {
|
|
593
|
-
const idx = addToExternrefTable0(e);
|
|
594
|
-
wasm.__wbindgen_exn_store(idx);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
function isLikeNone(x) {
|
|
599
|
-
return x === undefined || x === null;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
603
|
-
if (realloc === undefined) {
|
|
604
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
605
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
606
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
607
|
-
WASM_VECTOR_LEN = buf.length;
|
|
608
|
-
return ptr;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
let len = arg.length;
|
|
612
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
613
|
-
|
|
614
|
-
const mem = getUint8ArrayMemory0();
|
|
615
|
-
|
|
616
|
-
let offset = 0;
|
|
617
|
-
|
|
618
|
-
for (; offset < len; offset++) {
|
|
619
|
-
const code = arg.charCodeAt(offset);
|
|
620
|
-
if (code > 0x7F) break;
|
|
621
|
-
mem[ptr + offset] = code;
|
|
622
|
-
}
|
|
623
|
-
if (offset !== len) {
|
|
624
|
-
if (offset !== 0) {
|
|
625
|
-
arg = arg.slice(offset);
|
|
626
|
-
}
|
|
627
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
628
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
629
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
630
|
-
|
|
631
|
-
offset += ret.written;
|
|
632
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
WASM_VECTOR_LEN = offset;
|
|
636
|
-
return ptr;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
function takeFromExternrefTable0(idx) {
|
|
640
|
-
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
641
|
-
wasm.__externref_table_dealloc(idx);
|
|
642
|
-
return value;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
646
|
-
cachedTextDecoder.decode();
|
|
647
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
648
|
-
let numBytesDecoded = 0;
|
|
649
|
-
function decodeText(ptr, len) {
|
|
650
|
-
numBytesDecoded += len;
|
|
651
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
652
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
653
|
-
cachedTextDecoder.decode();
|
|
654
|
-
numBytesDecoded = len;
|
|
655
|
-
}
|
|
656
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
const cachedTextEncoder = new TextEncoder();
|
|
660
|
-
|
|
661
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
662
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
663
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
664
|
-
view.set(buf);
|
|
665
|
-
return {
|
|
666
|
-
read: arg.length,
|
|
667
|
-
written: buf.length
|
|
668
|
-
};
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
let WASM_VECTOR_LEN = 0;
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
let wasm;
|
|
676
|
-
export function __wbg_set_wasm(val) {
|
|
677
|
-
wasm = val;
|
|
678
|
-
}
|