@sebastienrousseau/noyalib-wasm 0.0.33 → 0.0.34
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/noyalib_wasm.d.ts +8 -0
- package/noyalib_wasm.js +1 -1
- package/noyalib_wasm_bg.js +18 -0
- package/noyalib_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/noyalib_wasm.d.ts
CHANGED
|
@@ -85,6 +85,14 @@ export function merge(base_yaml: string, override_yaml: string): string;
|
|
|
85
85
|
*/
|
|
86
86
|
export function parse(yaml: string): any;
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Parse YAML and return the JSON data model: like [`parse`], but every
|
|
90
|
+
* tag is stripped recursively, so the result is exactly what the YAML
|
|
91
|
+
* test suite's expected JSON is and what a JSON consumer expects.
|
|
92
|
+
* `parse` keeps tags as `{"!tag": value}` for callers that need them.
|
|
93
|
+
*/
|
|
94
|
+
export function parseJson(yaml: string): any;
|
|
95
|
+
|
|
88
96
|
/**
|
|
89
97
|
* Serialize a JS object to a YAML string.
|
|
90
98
|
*/
|
package/noyalib_wasm.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./noyalib_wasm_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
WasmDocument, getPath, merge, parse, stringify, validateJson
|
|
8
|
+
WasmDocument, getPath, merge, parse, parseJson, stringify, validateJson
|
|
9
9
|
} from "./noyalib_wasm_bg.js";
|
package/noyalib_wasm_bg.js
CHANGED
|
@@ -228,6 +228,24 @@ export function parse(yaml) {
|
|
|
228
228
|
return takeFromExternrefTable0(ret[0]);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Parse YAML and return the JSON data model: like [`parse`], but every
|
|
233
|
+
* tag is stripped recursively, so the result is exactly what the YAML
|
|
234
|
+
* test suite's expected JSON is and what a JSON consumer expects.
|
|
235
|
+
* `parse` keeps tags as `{"!tag": value}` for callers that need them.
|
|
236
|
+
* @param {string} yaml
|
|
237
|
+
* @returns {any}
|
|
238
|
+
*/
|
|
239
|
+
export function parseJson(yaml) {
|
|
240
|
+
const ptr0 = passStringToWasm0(yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
241
|
+
const len0 = WASM_VECTOR_LEN;
|
|
242
|
+
const ret = wasm.parseJson(ptr0, len0);
|
|
243
|
+
if (ret[2]) {
|
|
244
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
245
|
+
}
|
|
246
|
+
return takeFromExternrefTable0(ret[0]);
|
|
247
|
+
}
|
|
248
|
+
|
|
231
249
|
/**
|
|
232
250
|
* Serialize a JS object to a YAML string.
|
|
233
251
|
* @param {any} value
|
package/noyalib_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Sebastien Rousseau <sebastian.rousseau@gmail.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "WebAssembly (wasm-bindgen) bindings for the noyalib YAML library — browser-ready parse / serialise / lossless edit",
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.34",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|