@sebastienrousseau/noyalib-wasm 0.0.45 → 0.0.46
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 +139 -298
- package/noyalib_wasm.d.ts +8 -8
- package/noyalib_wasm_bg.js +80 -80
- package/noyalib_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,377 +1,218 @@
|
|
|
1
1
|
<!-- SPDX-License-Identifier: Apache-2.0 OR MIT -->
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="https://cloudcdn.pro/noyalib/v1/logos/noyalib.svg" alt="
|
|
4
|
+
<img src="https://cloudcdn.pro/noyalib/v1/logos/noyalib.svg" alt="noyalib-wasm logo" width="128" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<h1 align="center">noyalib-wasm</h1>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
|
|
11
|
-
pure-Rust YAML 1.2, zero <code>unsafe</code>, ~338 KB after
|
|
12
|
-
LTO. Runs in browsers, Node, Cloudflare Workers, Deno, and
|
|
13
|
-
any other WASM-capable host.</strong>
|
|
10
|
+
Browser and JavaScript bindings for YAML 1.2 parsing and lossless editing.
|
|
14
11
|
</p>
|
|
15
12
|
|
|
16
13
|
<p align="center">
|
|
17
14
|
<a href="https://github.com/sebastienrousseau/noyalib-wasm/actions"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/noyalib-wasm/ci.yml?style=for-the-badge&logo=github" alt="Build" /></a>
|
|
18
|
-
<a href="https://www.npmjs.com/package/@sebastienrousseau/noyalib-wasm"><img src="https://img.shields.io/npm/v/@sebastienrousseau/noyalib-wasm?style=for-the-badge&color=fc8d62&logo=npm" alt="
|
|
19
|
-
<a href="https://docs.rs/noyalib-wasm"><img src="https://img.shields.io/badge/docs.rs-noyalib--wasm-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" alt="Docs
|
|
20
|
-
<a href="https://bundlephobia.com/package/@sebastienrousseau/noyalib-wasm"><img src="https://img.shields.io/bundlephobia/minzip/@sebastienrousseau/noyalib-wasm?style=for-the-badge&color=informational" alt="Bundle size" /></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@sebastienrousseau/noyalib-wasm"><img src="https://img.shields.io/npm/v/@sebastienrousseau/noyalib-wasm?style=for-the-badge&color=fc8d62&logo=npm" alt="Registry" /></a>
|
|
16
|
+
<a href="https://docs.rs/noyalib-wasm"><img src="https://img.shields.io/badge/docs.rs-noyalib--wasm-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" alt="Docs" /></a>
|
|
21
17
|
<a href="https://scorecard.dev/viewer/?uri=github.com/sebastienrousseau/noyalib-wasm"><img src="https://img.shields.io/ossf-scorecard/github.com/sebastienrousseau/noyalib-wasm?style=for-the-badge&label=OpenSSF%20Scorecard&logo=openssf" alt="OpenSSF Scorecard" /></a>
|
|
22
|
-
<a href="
|
|
18
|
+
<a href="LICENSE-APACHE"><img src="https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg?style=for-the-badge" alt="License: Apache-2.0 OR MIT" /></a>
|
|
19
|
+
<a href="https://github.com/sebastienrousseau/noyalib-wasm/blob/main/docs/POLICIES.md"><img src="https://img.shields.io/badge/MSRV-1.86.0-93450a.svg?style=for-the-badge&logo=rust" alt="MSRV 1.86.0" /></a>
|
|
23
20
|
</p>
|
|
24
21
|
|
|
25
22
|
---
|
|
26
23
|
|
|
27
24
|
## Contents
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
- [Requirements](#requirements) — toolchain floor, platforms, the core pin
|
|
31
|
-
- [Quick Start](#quick-start) — parse, edit, validate
|
|
32
|
-
- [Why this approach?](#why-this-approach) — vs `js-yaml`
|
|
33
|
-
- [Surface](#surface) — exported APIs
|
|
34
|
-
- [Bundle size](#bundle-size) — what you ship to users
|
|
35
|
-
- [Targets](#targets) — every wasm-pack flavour
|
|
36
|
-
- [Provenance](#provenance) — npm + cosign
|
|
37
|
-
- [Examples](#examples) — Node + browser demos
|
|
38
|
-
- [When not to use noyalib-wasm](#when-not-to-use-noyalib-wasm)
|
|
39
|
-
- [Documentation](#documentation)
|
|
40
|
-
- [License](#license)
|
|
26
|
+
**Getting started**
|
|
41
27
|
|
|
42
|
-
|
|
28
|
+
- [Install](#install) — npm-compatible package managers and source builds
|
|
29
|
+
- [Requirements](#requirements) — toolchain floor, runtimes
|
|
30
|
+
- [Quick Start](#quick-start) — parse, inspect, and edit YAML
|
|
43
31
|
|
|
44
|
-
|
|
32
|
+
**The noyalib-wasm ecosystem**
|
|
45
33
|
|
|
46
|
-
|
|
47
|
-
npm install @sebastienrousseau/noyalib-wasm
|
|
48
|
-
# or
|
|
49
|
-
pnpm add @sebastienrousseau/noyalib-wasm
|
|
50
|
-
# or
|
|
51
|
-
yarn add @sebastienrousseau/noyalib-wasm
|
|
52
|
-
```
|
|
34
|
+
- [The noyalib-wasm ecosystem](#the-noyalib-wasm-ecosystem) — bindings and companion tools
|
|
53
35
|
|
|
54
|
-
|
|
36
|
+
**Library reference**
|
|
55
37
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
- [Capabilities at a glance](#capabilities-at-a-glance) — the current surface by theme
|
|
39
|
+
- [Ecosystem comparison](#ecosystem-comparison) — short matrix; full table at [`docs/COMPARISON.md`](docs/COMPARISON.md)
|
|
40
|
+
- [Benchmarks](#benchmarks) — harness and bundle measurements; full table at [`docs/BENCHMARKS.md`](docs/BENCHMARKS.md)
|
|
41
|
+
- [Features](#features) — JavaScript exports
|
|
42
|
+
- [Configuration](#configuration) — wasm-pack targets and build modes
|
|
43
|
+
- [Examples](#examples) — browser and Node examples
|
|
61
44
|
|
|
62
|
-
|
|
63
|
-
> shipped from `sebastienrousseau/noyalib/crates/noyalib-wasm/`.
|
|
64
|
-
> From v0.0.12 onward `noyalib-wasm` lives here as its own crate,
|
|
65
|
-
> released in strict lockstep with the parent
|
|
66
|
-
> [`noyalib`](https://github.com/sebastienrousseau/noyalib) at
|
|
67
|
-
> the same version. See
|
|
68
|
-
> [ADR-0005](https://github.com/sebastienrousseau/noyalib/blob/main/docs/adr/0005-workspace-split.md)
|
|
69
|
-
> for the rationale and rollback recipe.
|
|
45
|
+
**Operational**
|
|
70
46
|
|
|
71
|
-
|
|
47
|
+
- [When not to use noyalib-wasm](#when-not-to-use-noyalib-wasm) — limitations
|
|
48
|
+
- [Development](#development) — make targets, WASM tests, CI
|
|
49
|
+
- [Security](#security) — guarantees and compliance
|
|
50
|
+
- [Documentation](#documentation) — all reference docs
|
|
51
|
+
- [Stability guarantees](#stability-guarantees) — JavaScript API, SemVer, and toolchain discipline
|
|
52
|
+
- [License](#license)
|
|
72
53
|
|
|
73
|
-
|
|
54
|
+
---
|
|
74
55
|
|
|
75
|
-
|
|
76
|
-
the manifest, enforced by the `msrv-core` CI job on every push.
|
|
77
|
-
- **Any tier-1 platform.** CI runs the tests on Linux, macOS, and
|
|
78
|
-
Windows with the stable, beta, and nightly toolchains; stable is the
|
|
79
|
-
gate, beta and nightly are early warning.
|
|
80
|
-
- **The matching core.** This crate pins `noyalib` at the identical
|
|
81
|
-
`=0.0.X` and releases in lockstep with it; Cargo resolves that pin
|
|
82
|
-
for you.
|
|
83
|
-
- **For the bundle**: `wasm-pack` and a JavaScript runtime that loads
|
|
84
|
-
WebAssembly (browsers, Node.js 18+, Deno, Bun, Cloudflare Workers).
|
|
85
|
-
`cargo test` needs neither; the pure-Rust core is tested natively.
|
|
56
|
+
## Install
|
|
86
57
|
|
|
87
|
-
|
|
58
|
+
### As a JavaScript library
|
|
88
59
|
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
parse,
|
|
92
|
-
stringify,
|
|
93
|
-
validateJson,
|
|
94
|
-
getPath,
|
|
95
|
-
merge,
|
|
96
|
-
WasmDocument,
|
|
97
|
-
} from "@sebastienrousseau/noyalib-wasm";
|
|
98
|
-
|
|
99
|
-
await init(); // load the WASM blob
|
|
100
|
-
|
|
101
|
-
// Plain parse / stringify — like js-yaml. Mappings come back as
|
|
102
|
-
// plain JS Objects (not `Map`), so dotted property access works.
|
|
103
|
-
const obj = parse("host: api.example.com\nport: 8080\n");
|
|
104
|
-
console.log(obj.host); // "api.example.com"
|
|
105
|
-
const yaml = stringify(obj);
|
|
106
|
-
|
|
107
|
-
// Indexed read without going through `parse`.
|
|
108
|
-
const port = getPath("host: api.example.com\nport: 8080\n", "port"); // 8080
|
|
109
|
-
|
|
110
|
-
// JSON-compatible YAML 1.2 schema check.
|
|
111
|
-
validateJson("a: 1\nb: [2, 3]\n"); // true
|
|
112
|
-
|
|
113
|
-
// Lossless CST edit — comments + indentation preserved.
|
|
114
|
-
const doc = new WasmDocument(source);
|
|
115
|
-
doc.set("server.port", "9090");
|
|
116
|
-
fs.writeFileSync("config.yaml", doc.toString());
|
|
60
|
+
```bash
|
|
61
|
+
npm install @sebastienrousseau/noyalib-wasm@0.0.46
|
|
117
62
|
```
|
|
118
63
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
## Why this approach?
|
|
122
|
-
|
|
123
|
-
[`js-yaml`](https://github.com/nodeca/js-yaml) is the de-facto
|
|
124
|
-
JS YAML parser, and it's good — but it makes two tradeoffs that
|
|
125
|
-
hurt for editor and tooling workloads:
|
|
126
|
-
|
|
127
|
-
1. **`js-yaml` discards comments by spec.** It implements the
|
|
128
|
-
YAML data model, which excludes comments. Round-tripping a
|
|
129
|
-
document through `parse` → `dump` strips every `#` line.
|
|
130
|
-
noyalib's `Document` API runs through a lossless CST that
|
|
131
|
-
reproduces the source byte-for-byte; only the surgically
|
|
132
|
-
touched span changes on a `set`.
|
|
133
|
-
|
|
134
|
-
2. **`js-yaml` follows YAML 1.1 by default.** That's the
|
|
135
|
-
"Norway problem": `country: NO` parses as `country: false`,
|
|
136
|
-
silently rewriting the country code. noyalib defaults to
|
|
137
|
-
YAML 1.2 strict semantics; only `true` / `false` are
|
|
138
|
-
booleans.
|
|
139
|
-
|
|
140
|
-
### Custom YAML tags
|
|
141
|
-
|
|
142
|
-
`parse(yaml)` surfaces YAML tags as plain JS object keys:
|
|
143
|
-
`!Color '#ff8800'` deserialises into `{ "!Color": "#ff8800" }`.
|
|
144
|
-
This matches the serde-bridge convention every other
|
|
145
|
-
`serde-wasm-bindgen` consumer uses (the `Value::Tagged` variant
|
|
146
|
-
serialises as a single-entry map for cross-format interop).
|
|
147
|
-
Round-tripping via `stringify` does **not** restore the
|
|
148
|
-
YAML-tag prefix — the JS object's tag-as-key shape becomes a
|
|
149
|
-
quoted mapping key in the emitted YAML.
|
|
150
|
-
|
|
151
|
-
For editor / tooling workloads where the YAML-tag wire form
|
|
152
|
-
must survive a parse → emit cycle, use the `WasmDocument`
|
|
153
|
-
class instead. Its `set` / `setValue` are surgical edits
|
|
154
|
-
through the CST, so untouched tag prefixes round-trip
|
|
155
|
-
verbatim:
|
|
64
|
+
`pnpm add` and `yarn add` work with the same package. To build from source:
|
|
156
65
|
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
doc.set("color", "!Color '#00aaff'"); // tag survives
|
|
160
|
-
console.log(doc.toString()); // "color: !Color '#00aaff'\n"
|
|
66
|
+
```bash
|
|
67
|
+
wasm-pack build --release --target bundler
|
|
161
68
|
```
|
|
162
69
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
- **JSON Schema 2020-12 validation built in.** Same engine as
|
|
166
|
-
the `noyavalidate` CLI ships.
|
|
167
|
-
- **Pure-Rust, zero `unsafe`.** Every byte of the parser,
|
|
168
|
-
scanner, formatter, and CST is checked at compile time by the
|
|
169
|
-
workspace `#![forbid(unsafe_code)]` lint.
|
|
170
|
-
- **~338 KB bundle.** That's roughly the same size as `js-yaml`
|
|
171
|
-
minified + gzipped, with the lossless-CST surface and YAML
|
|
172
|
-
1.2 semantics baked in.
|
|
173
|
-
|
|
174
|
-
---
|
|
70
|
+
## Requirements
|
|
175
71
|
|
|
176
|
-
|
|
72
|
+
- Rust **1.86.0 or newer** and `wasm-pack` when building from source.
|
|
73
|
+
- A WebAssembly-capable browser, Node.js, Deno, Bun, or edge runtime.
|
|
74
|
+
- The crate pins `noyalib` at exactly `=0.0.46` under the lockstep contract.
|
|
177
75
|
|
|
178
|
-
|
|
76
|
+
| Surface | Minimum | Enforcement |
|
|
77
|
+
| :--- | :---: | :--- |
|
|
78
|
+
| Rust crate | Rust 1.86.0 | manifest and MSRV CI |
|
|
79
|
+
| JavaScript package | WebAssembly runtime | Node and browser CI |
|
|
179
80
|
|
|
180
|
-
|
|
81
|
+
## Quick Start
|
|
181
82
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
| `parse(yaml: string): any` | Parse a YAML document into a JS value. Mappings become plain Objects; sequences become Arrays; scalars become numbers / strings / booleans / null. Mirrors `js-yaml`'s `load`. |
|
|
185
|
-
| `stringify(value: any): string` | Serialise a JS value back to YAML. |
|
|
186
|
-
| `validateJson(yaml: string): boolean` | Validate that the document conforms to the YAML 1.2 JSON-compatible schema (only types JSON allows: null / bool / number / string / array / object). Returns `true` / `false`; structural JSON Schema 2020-12 validation is on the `noyavalidate` CLI roadmap. |
|
|
187
|
-
| `getPath(yaml: string, path: string): any` | Indexed read without going through `parse`. Dotted paths (`"server.host"`); returns `null` if missing. |
|
|
188
|
-
| `merge(base: string, override: string): string` | Deep-merge two YAML documents. Delegates to `noyalib::Value::merge`. |
|
|
83
|
+
```js
|
|
84
|
+
import init, { parse, getPath, WasmDocument } from "@sebastienrousseau/noyalib-wasm";
|
|
189
85
|
|
|
190
|
-
|
|
86
|
+
await init();
|
|
191
87
|
|
|
192
|
-
|
|
193
|
-
|
|
88
|
+
const value = parse("host: api.example.com\nport: 8080\n");
|
|
89
|
+
const port = getPath("port: 8080\n", "port");
|
|
194
90
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
| `getSource(path: string): string \| null` | Raw source fragment at a dotted path (no re-quoting / canonicalisation). |
|
|
200
|
-
| `set(path: string, fragment: string): void` | Surgically rewrite a value at a dotted path. The fragment is a YAML-shaped string (`"9090"`, `"[1,2,3]"`, …). |
|
|
201
|
-
| `setValue(path: string, value: any): void` | Same as `set` but accepts a JS value instead of a YAML fragment. |
|
|
202
|
-
| `spanAt(path: string): { start: number, end: number } \| null` | Byte range of the value at a dotted path. |
|
|
203
|
-
| `commentsAt(path: string): { before: string[], inline: string \| null }` | Comments associated with the node at a path. |
|
|
204
|
-
| `replaceSpan(start: number, end: number, replacement: string): void` | Primitive byte replacement. |
|
|
91
|
+
const document = new WasmDocument("# service\nport: 8080\n");
|
|
92
|
+
document.set("port", "9090");
|
|
93
|
+
console.log(document.toString());
|
|
94
|
+
```
|
|
205
95
|
|
|
206
|
-
|
|
207
|
-
blob is loaded, individual calls are synchronous.
|
|
96
|
+
## The noyalib-wasm ecosystem
|
|
208
97
|
|
|
209
|
-
|
|
98
|
+
| Component | Purpose |
|
|
99
|
+
| :--- | :--- |
|
|
100
|
+
| `noyalib-wasm` | JavaScript and WebAssembly API |
|
|
101
|
+
| [`noyalib`](https://github.com/sebastienrousseau/noyalib) | Rust parser and lossless CST engine |
|
|
102
|
+
| [`noya-cli`](https://github.com/sebastienrousseau/noya-cli) | Native command-line formatting and validation |
|
|
103
|
+
| npm package | Provenance-attested browser and runtime distribution |
|
|
210
104
|
|
|
211
|
-
##
|
|
105
|
+
## Capabilities at a glance
|
|
212
106
|
|
|
213
|
-
|
|
|
214
|
-
|
|
215
|
-
|
|
|
216
|
-
|
|
|
107
|
+
| Area | Capability | Status |
|
|
108
|
+
| :--- | :--- | :--- |
|
|
109
|
+
| Data model | `parse` and `stringify` | Stable |
|
|
110
|
+
| Indexed access | `getPath` and `merge` | Stable |
|
|
111
|
+
| Validation | JSON-compatible YAML check | Stable |
|
|
112
|
+
| Lossless CST | `WasmDocument` reads and surgical edits | Stable |
|
|
113
|
+
| Targets | bundler, web, nodejs, deno, and no-modules | Supported |
|
|
217
114
|
|
|
218
|
-
|
|
219
|
-
`parse` / `stringify` API are independent modules; bundlers
|
|
220
|
-
drop whichever your code does not import.
|
|
115
|
+
## Ecosystem comparison
|
|
221
116
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
117
|
+
| Project | YAML 1.2 | Preserves untouched source | Browser-ready |
|
|
118
|
+
| :--- | :---: | :---: | :---: |
|
|
119
|
+
| **noyalib-wasm** | Yes | Yes, through `WasmDocument` | Yes |
|
|
120
|
+
| `js-yaml` | Configurable | No | Yes |
|
|
121
|
+
| Native `noyalib` | Yes | Yes | Requires a Rust host |
|
|
225
122
|
|
|
226
|
-
|
|
123
|
+
See [`docs/COMPARISON.md`](docs/COMPARISON.md) for scope and caveats.
|
|
227
124
|
|
|
228
|
-
##
|
|
125
|
+
## Benchmarks
|
|
229
126
|
|
|
230
|
-
|
|
127
|
+
The repository measures calls across the real JavaScript-to-WASM boundary and
|
|
128
|
+
tracks release bundle size. Measurements are descriptive, not CI pass/fail
|
|
129
|
+
thresholds.
|
|
231
130
|
|
|
232
|
-
```
|
|
233
|
-
wasm-pack build --target
|
|
234
|
-
|
|
235
|
-
wasm-pack build --target nodejs # commonjs Node import
|
|
236
|
-
wasm-pack build --target deno # Deno-native module
|
|
237
|
-
wasm-pack build --target no-modules # plain global, no module loader
|
|
131
|
+
```bash
|
|
132
|
+
wasm-pack build --release --target nodejs
|
|
133
|
+
node benches/bench.js
|
|
238
134
|
```
|
|
239
135
|
|
|
240
|
-
|
|
241
|
-
`bundler` target via their packaging step.
|
|
136
|
+
See [`docs/BENCHMARKS.md`](docs/BENCHMARKS.md) for the recorded method.
|
|
242
137
|
|
|
243
|
-
|
|
138
|
+
## Features
|
|
244
139
|
|
|
245
|
-
|
|
140
|
+
- `parse`, `stringify`, `validateJson`, `getPath`, and `merge` free functions.
|
|
141
|
+
- `WasmDocument` lossless reads, source spans, comments, and surgical edits.
|
|
142
|
+
- JavaScript-native values through `serde-wasm-bindgen`.
|
|
143
|
+
- npm provenance and release supply-chain metadata.
|
|
144
|
+
- Browser, server, edge, and no-module build targets.
|
|
246
145
|
|
|
247
|
-
|
|
248
|
-
[npm provenance attestation](https://docs.npmjs.com/generating-provenance-statements)
|
|
249
|
-
linking the published bundle to the GitHub Actions run that
|
|
250
|
-
produced it. Verify via:
|
|
146
|
+
## Configuration
|
|
251
147
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
148
|
+
| Command | Target |
|
|
149
|
+
| :--- | :--- |
|
|
150
|
+
| `wasm-pack build --target bundler` | Vite, Webpack, Rollup, and esbuild |
|
|
151
|
+
| `wasm-pack build --target web` | Native browser ES modules |
|
|
152
|
+
| `wasm-pack build --target nodejs` | Node.js CommonJS |
|
|
153
|
+
| `wasm-pack build --target deno` | Deno-native module |
|
|
154
|
+
| `wasm-pack build --target no-modules` | Global browser binding |
|
|
255
155
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
`.wasm` artefact is not attached to releases; the npm package
|
|
259
|
-
(with its provenance attestation, above) is the distribution
|
|
260
|
-
channel for the compiled bundle. Verify a release artefact:
|
|
261
|
-
|
|
262
|
-
```sh
|
|
263
|
-
cosign verify-blob \
|
|
264
|
-
--certificate-identity-regexp 'https://github.com/sebastienrousseau/noyalib-wasm/' \
|
|
265
|
-
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
|
|
266
|
-
--bundle <artefact>.bundle \
|
|
267
|
-
<artefact>
|
|
268
|
-
```
|
|
156
|
+
The release profile leaves `wasm-opt` to the packaging pipeline so one build
|
|
157
|
+
step owns the final artifact transformation.
|
|
269
158
|
|
|
270
|
-
|
|
159
|
+
## Examples
|
|
271
160
|
|
|
272
|
-
|
|
161
|
+
- [`node-stringify.js`](examples/node-stringify.js): parse and stringify.
|
|
162
|
+
- [`cst-edit.js`](examples/cst-edit.js): comment-preserving edit.
|
|
163
|
+
- [`paths-and-spans.js`](examples/paths-and-spans.js): indexed access and spans.
|
|
164
|
+
- [`browser/index.html`](examples/browser/index.html): browser editor.
|
|
273
165
|
|
|
274
|
-
##
|
|
166
|
+
## When not to use noyalib-wasm
|
|
275
167
|
|
|
276
|
-
|
|
277
|
-
|
|
168
|
+
- Use a smaller JavaScript-only parser when comments and source-preserving edits
|
|
169
|
+
do not matter.
|
|
170
|
+
- Use native `noyalib` for streaming or memory-sensitive server workloads.
|
|
171
|
+
- `validateJson` checks JSON round-trip compatibility; it is not a JSON Schema
|
|
172
|
+
validator. Use `noyavalidate` or the core schema feature for that purpose.
|
|
278
173
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
| [`node-stringify.js`](examples/node-stringify.js) | Node | `parse` + `stringify` round-trip. |
|
|
282
|
-
| [`cst-edit.js`](examples/cst-edit.js) | Node | Lossless CST edit; comments + whitespace preserved. |
|
|
283
|
-
| [`paths-and-spans.js`](examples/paths-and-spans.js) | Node | `getPath`, `merge`, `getSource`, `spanAt`, `replaceSpan`, `setValue`, `commentsAt`. |
|
|
284
|
-
| [`json-compat.js`](examples/json-compat.js) | Node | `validateJson` — refuse YAML that JSON cannot represent (NaN / Infinity). |
|
|
285
|
-
| [`browser/index.html`](examples/browser/index.html) | Browser | Live in-page YAML editor with a parsed-JSON pane. |
|
|
286
|
-
| [`benches/bench.js`](benches/bench.js) | Node | Throughput measured across the real JS↔wasm boundary. |
|
|
174
|
+
The [detailed README reference](docs/README-REFERENCE.md) retains API tables,
|
|
175
|
+
bundle detail, target notes, and provenance commands.
|
|
287
176
|
|
|
288
|
-
|
|
289
|
-
> checks JSON round-trip safety. For JSON Schema 2020-12 use
|
|
290
|
-
> `noyavalidate --schema`, or the `noyalib` crate's `validate-schema`
|
|
291
|
-
> feature.
|
|
177
|
+
## Development
|
|
292
178
|
|
|
293
179
|
```bash
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
# Browser:
|
|
300
|
-
wasm-pack build --release --target web crates/noyalib-wasm
|
|
301
|
-
cd crates/noyalib-wasm/examples/browser
|
|
302
|
-
python3 -m http.server # or any static-file server
|
|
180
|
+
make
|
|
181
|
+
make test
|
|
182
|
+
make clippy
|
|
183
|
+
make fmt
|
|
184
|
+
wasm-pack test --node
|
|
303
185
|
```
|
|
304
186
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
- **You only ever consume YAML in Node and don't care about
|
|
310
|
-
comment-preserving edits or YAML 1.2 strictness.** `js-yaml`
|
|
311
|
-
is smaller (~50 KB minified) and the de-facto standard;
|
|
312
|
-
reach for it first.
|
|
313
|
-
- **You need a streaming parser for multi-GB documents.** The
|
|
314
|
-
WASM bindings always read the full document into memory.
|
|
315
|
-
For TB-scale streaming workloads, drive the noyalib library
|
|
316
|
-
directly from a Rust process and pipe results out.
|
|
317
|
-
|
|
318
|
-
---
|
|
187
|
+
CI checks native and WebAssembly builds, Node integration, rustdoc, dependency
|
|
188
|
+
policy, the shared YAML suite, and package provenance. See
|
|
189
|
+
[`DEVELOPMENT.md`](DEVELOPMENT.md).
|
|
319
190
|
|
|
320
|
-
##
|
|
191
|
+
## Security
|
|
321
192
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
including the core `noyalib` library, shares this floor. CI verifies the floor on every PR via
|
|
326
|
-
the `Per-crate MSRV` workflow job. The bump policy lives in
|
|
327
|
-
[`docs/POLICIES.md`](https://github.com/sebastienrousseau/noyalib/blob/main/docs/POLICIES.md#1-msrv-minimum-supported-rust-version).
|
|
328
|
-
|
|
329
|
-
**Tier-1 WASM targets** (CI-verified each PR via
|
|
330
|
-
`wasm-pack test --node`): `wasm32-unknown-unknown` produced
|
|
331
|
-
under every `wasm-pack` mode — `bundler` (Webpack, Rollup,
|
|
332
|
-
esbuild, Vite), `web` (native ES module), `nodejs` (CJS),
|
|
333
|
-
`deno`, `no-modules`. Cloudflare Workers, Deno, and Bun
|
|
334
|
-
consume the `bundler` target.
|
|
335
|
-
|
|
336
|
-
---
|
|
193
|
+
Report vulnerabilities through [`SECURITY.md`](SECURITY.md). The Rust crate
|
|
194
|
+
forbids `unsafe` code and treats YAML and JavaScript values as untrusted input.
|
|
195
|
+
Published npm artifacts carry provenance linking them to the release workflow.
|
|
337
196
|
|
|
338
197
|
## Documentation
|
|
339
198
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
|
|
347
|
-
-
|
|
348
|
-
[`docs/POLICIES.md`](https://github.com/sebastienrousseau/noyalib/blob/main/docs/POLICIES.md)
|
|
349
|
-
- **Security policy**:
|
|
350
|
-
[`SECURITY.md`](https://github.com/sebastienrousseau/noyalib/blob/main/SECURITY.md)
|
|
351
|
-
- **JS API reference**:
|
|
352
|
-
[`docs/js-api.md`](docs/js-api.md)
|
|
353
|
-
- **Bundling (Vite, Webpack, Next.js, Cloudflare Workers, Deno, Bun)**:
|
|
354
|
-
[`docs/bundling.md`](docs/bundling.md)
|
|
355
|
-
- **npm package**:
|
|
356
|
-
<https://www.npmjs.com/package/@sebastienrousseau/noyalib-wasm>
|
|
357
|
-
- **API reference (rustdoc)**: <https://docs.rs/noyalib-wasm>
|
|
358
|
-
- **Workspace README**:
|
|
359
|
-
<https://github.com/sebastienrousseau/noyalib#readme>
|
|
360
|
-
|
|
361
|
-
---
|
|
199
|
+
- [User Manual](https://sebastienrousseau.github.io/noyalib-wasm/manual/)
|
|
200
|
+
- [Rust API reference](https://docs.rs/noyalib-wasm)
|
|
201
|
+
- [JavaScript API](docs/js-api.md)
|
|
202
|
+
- [Bundling guide](docs/bundling.md)
|
|
203
|
+
- [Developer documentation](DEVELOPMENT.md)
|
|
204
|
+
- [Engineering policies](docs/POLICIES.md)
|
|
205
|
+
- [Compliance grade](docs/COMPLIANCE-GRADE.md)
|
|
206
|
+
- [Detailed README reference](docs/README-REFERENCE.md)
|
|
362
207
|
|
|
363
|
-
##
|
|
208
|
+
## Stability guarantees
|
|
364
209
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
itself passes 406 of 406 with no skip list. A two-document configuration that
|
|
370
|
-
uses most of YAML at once (`tests/fixtures/ultra-complex/`) is also parsed to
|
|
371
|
-
exactly its expected JSON, natively and in Node. Details and the family table:
|
|
372
|
-
[noyalib.com/conformance](https://noyalib.com/conformance/).
|
|
210
|
+
- During `0.0.x`, the patch component is the breaking-change axis.
|
|
211
|
+
- Exported JavaScript names, argument shapes, and return shapes are public API.
|
|
212
|
+
- Untouched bytes remain stable when using the lossless `WasmDocument` surface.
|
|
213
|
+
- The MSRV may rise only on the breaking axis with a changelog explanation.
|
|
373
214
|
|
|
374
215
|
## License
|
|
375
216
|
|
|
376
|
-
|
|
377
|
-
|
|
217
|
+
Licensed under either [Apache License 2.0](LICENSE-APACHE) or
|
|
218
|
+
[MIT](LICENSE-MIT), at your option.
|
package/noyalib_wasm.d.ts
CHANGED
|
@@ -18,10 +18,6 @@ export class WasmDocument {
|
|
|
18
18
|
* conventions.
|
|
19
19
|
*/
|
|
20
20
|
commentsAt(path: string): any;
|
|
21
|
-
/**
|
|
22
|
-
* Get the parsed value at a dotted path.
|
|
23
|
-
*/
|
|
24
|
-
get(path: string): any;
|
|
25
21
|
/**
|
|
26
22
|
* Get the raw source fragment at a dotted path.
|
|
27
23
|
*
|
|
@@ -29,6 +25,10 @@ export class WasmDocument {
|
|
|
29
25
|
* conventions.
|
|
30
26
|
*/
|
|
31
27
|
getSource(path: string): any;
|
|
28
|
+
/**
|
|
29
|
+
* Get the parsed value at a dotted path.
|
|
30
|
+
*/
|
|
31
|
+
get(path: string): any;
|
|
32
32
|
/**
|
|
33
33
|
* Parse a YAML string into a lossless Document.
|
|
34
34
|
*/
|
|
@@ -40,10 +40,6 @@ export class WasmDocument {
|
|
|
40
40
|
* per JS naming conventions.
|
|
41
41
|
*/
|
|
42
42
|
replaceSpan(start: number, end: number, replacement: string): void;
|
|
43
|
-
/**
|
|
44
|
-
* Set a value at a dotted path using a YAML fragment string.
|
|
45
|
-
*/
|
|
46
|
-
set(path: string, fragment: string): void;
|
|
47
43
|
/**
|
|
48
44
|
* Set a value at a dotted path using a JS object.
|
|
49
45
|
*
|
|
@@ -51,6 +47,10 @@ export class WasmDocument {
|
|
|
51
47
|
* conventions.
|
|
52
48
|
*/
|
|
53
49
|
setValue(path: string, value: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* Set a value at a dotted path using a YAML fragment string.
|
|
52
|
+
*/
|
|
53
|
+
set(path: string, fragment: string): void;
|
|
54
54
|
/**
|
|
55
55
|
* Get the byte range `{ start, end }` for the value at a dotted path.
|
|
56
56
|
*
|
package/noyalib_wasm_bg.js
CHANGED
|
@@ -33,20 +33,6 @@ export class WasmDocument {
|
|
|
33
33
|
}
|
|
34
34
|
return takeFromExternrefTable0(ret[0]);
|
|
35
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
36
|
/**
|
|
51
37
|
* Get the raw source fragment at a dotted path.
|
|
52
38
|
*
|
|
@@ -61,6 +47,20 @@ export class WasmDocument {
|
|
|
61
47
|
const ret = wasm.wasmdocument_getSource(this.__wbg_ptr, ptr0, len0);
|
|
62
48
|
return ret;
|
|
63
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the parsed value at a dotted path.
|
|
52
|
+
* @param {string} path
|
|
53
|
+
* @returns {any}
|
|
54
|
+
*/
|
|
55
|
+
get(path) {
|
|
56
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
57
|
+
const len0 = WASM_VECTOR_LEN;
|
|
58
|
+
const ret = wasm.wasmdocument_get(this.__wbg_ptr, ptr0, len0);
|
|
59
|
+
if (ret[2]) {
|
|
60
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
61
|
+
}
|
|
62
|
+
return takeFromExternrefTable0(ret[0]);
|
|
63
|
+
}
|
|
64
64
|
/**
|
|
65
65
|
* Parse a YAML string into a lossless Document.
|
|
66
66
|
* @param {string} yaml
|
|
@@ -94,32 +94,32 @@ export class WasmDocument {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
|
-
* Set a value at a dotted path using a
|
|
97
|
+
* Set a value at a dotted path using a JS object.
|
|
98
|
+
*
|
|
99
|
+
* Bound on the JS side as `setValue(path, value)` per JS naming
|
|
100
|
+
* conventions.
|
|
98
101
|
* @param {string} path
|
|
99
|
-
* @param {
|
|
102
|
+
* @param {any} value
|
|
100
103
|
*/
|
|
101
|
-
|
|
104
|
+
setValue(path, value) {
|
|
102
105
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
103
106
|
const len0 = WASM_VECTOR_LEN;
|
|
104
|
-
const
|
|
105
|
-
const len1 = WASM_VECTOR_LEN;
|
|
106
|
-
const ret = wasm.wasmdocument_set(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
107
|
+
const ret = wasm.wasmdocument_setValue(this.__wbg_ptr, ptr0, len0, value);
|
|
107
108
|
if (ret[1]) {
|
|
108
109
|
throw takeFromExternrefTable0(ret[0]);
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
/**
|
|
112
|
-
* Set a value at a dotted path using a
|
|
113
|
-
*
|
|
114
|
-
* Bound on the JS side as `setValue(path, value)` per JS naming
|
|
115
|
-
* conventions.
|
|
113
|
+
* Set a value at a dotted path using a YAML fragment string.
|
|
116
114
|
* @param {string} path
|
|
117
|
-
* @param {
|
|
115
|
+
* @param {string} fragment
|
|
118
116
|
*/
|
|
119
|
-
|
|
117
|
+
set(path, fragment) {
|
|
120
118
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
121
119
|
const len0 = WASM_VECTOR_LEN;
|
|
122
|
-
const
|
|
120
|
+
const ptr1 = passStringToWasm0(fragment, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
121
|
+
const len1 = WASM_VECTOR_LEN;
|
|
122
|
+
const ret = wasm.wasmdocument_set(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
123
123
|
if (ret[1]) {
|
|
124
124
|
throw takeFromExternrefTable0(ret[0]);
|
|
125
125
|
}
|
|
@@ -285,7 +285,7 @@ export function validateJson(yaml) {
|
|
|
285
285
|
}
|
|
286
286
|
return ret[0] !== 0;
|
|
287
287
|
}
|
|
288
|
-
export function
|
|
288
|
+
export function __wbg_Error_67e7344beaa85059(arg0, arg1) {
|
|
289
289
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
290
290
|
return ret;
|
|
291
291
|
}
|
|
@@ -296,60 +296,60 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
|
296
296
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
297
297
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
298
298
|
}
|
|
299
|
-
export function
|
|
299
|
+
export function __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8(arg0, arg1) {
|
|
300
300
|
const v = arg1;
|
|
301
301
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
302
302
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
303
303
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
304
304
|
}
|
|
305
|
-
export function
|
|
305
|
+
export function __wbg___wbindgen_boolean_get_7a12af2b3f899c5a(arg0) {
|
|
306
306
|
const v = arg0;
|
|
307
307
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
308
308
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
309
309
|
}
|
|
310
|
-
export function
|
|
310
|
+
export function __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0(arg0, arg1) {
|
|
311
311
|
const ret = debugString(arg1);
|
|
312
312
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
313
313
|
const len1 = WASM_VECTOR_LEN;
|
|
314
314
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
315
315
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
316
316
|
}
|
|
317
|
-
export function
|
|
317
|
+
export function __wbg___wbindgen_in_50072d4d6e45c193(arg0, arg1) {
|
|
318
318
|
const ret = arg0 in arg1;
|
|
319
319
|
return ret;
|
|
320
320
|
}
|
|
321
|
-
export function
|
|
321
|
+
export function __wbg___wbindgen_is_bigint_60fc0336cb14f5d7(arg0) {
|
|
322
322
|
const ret = typeof(arg0) === 'bigint';
|
|
323
323
|
return ret;
|
|
324
324
|
}
|
|
325
|
-
export function
|
|
325
|
+
export function __wbg___wbindgen_is_function_fcda5e3902d732fe(arg0) {
|
|
326
326
|
const ret = typeof(arg0) === 'function';
|
|
327
327
|
return ret;
|
|
328
328
|
}
|
|
329
|
-
export function
|
|
329
|
+
export function __wbg___wbindgen_is_object_edb6b15aa3afe12e(arg0) {
|
|
330
330
|
const val = arg0;
|
|
331
331
|
const ret = typeof(val) === 'object' && val !== null;
|
|
332
332
|
return ret;
|
|
333
333
|
}
|
|
334
|
-
export function
|
|
334
|
+
export function __wbg___wbindgen_is_string_c4f7cb494a2a21f1(arg0) {
|
|
335
335
|
const ret = typeof(arg0) === 'string';
|
|
336
336
|
return ret;
|
|
337
337
|
}
|
|
338
|
-
export function
|
|
338
|
+
export function __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b(arg0, arg1) {
|
|
339
339
|
const ret = arg0 === arg1;
|
|
340
340
|
return ret;
|
|
341
341
|
}
|
|
342
|
-
export function
|
|
342
|
+
export function __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd(arg0, arg1) {
|
|
343
343
|
const ret = arg0 == arg1;
|
|
344
344
|
return ret;
|
|
345
345
|
}
|
|
346
|
-
export function
|
|
346
|
+
export function __wbg___wbindgen_number_get_1dc732b810cb937c(arg0, arg1) {
|
|
347
347
|
const obj = arg1;
|
|
348
348
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
349
349
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
350
350
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
351
351
|
}
|
|
352
|
-
export function
|
|
352
|
+
export function __wbg___wbindgen_string_get_92ab86bb19cbc12f(arg0, arg1) {
|
|
353
353
|
const obj = arg1;
|
|
354
354
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
355
355
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -357,34 +357,34 @@ export function __wbg___wbindgen_string_get_d154f1e671052120(arg0, arg1) {
|
|
|
357
357
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
358
358
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
359
359
|
}
|
|
360
|
-
export function
|
|
360
|
+
export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
|
|
361
361
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
362
362
|
}
|
|
363
|
-
export function
|
|
363
|
+
export function __wbg_call_269c5566fbede3eb() { return handleError(function (arg0, arg1) {
|
|
364
364
|
const ret = arg0.call(arg1);
|
|
365
365
|
return ret;
|
|
366
366
|
}, arguments); }
|
|
367
|
-
export function
|
|
367
|
+
export function __wbg_done_cffed884d87aa22e(arg0) {
|
|
368
368
|
const ret = arg0.done;
|
|
369
369
|
return ret;
|
|
370
370
|
}
|
|
371
|
-
export function
|
|
371
|
+
export function __wbg_entries_972a87586902cf87(arg0) {
|
|
372
372
|
const ret = Object.entries(arg0);
|
|
373
373
|
return ret;
|
|
374
374
|
}
|
|
375
|
-
export function
|
|
376
|
-
const ret = arg0[arg1 >>> 0];
|
|
377
|
-
return ret;
|
|
378
|
-
}
|
|
379
|
-
export function __wbg_get_d173c0308df22d37() { return handleError(function (arg0, arg1) {
|
|
375
|
+
export function __wbg_get_6cf5a4d4d8ad3c5a() { return handleError(function (arg0, arg1) {
|
|
380
376
|
const ret = Reflect.get(arg0, arg1);
|
|
381
377
|
return ret;
|
|
382
378
|
}, arguments); }
|
|
383
|
-
export function
|
|
379
|
+
export function __wbg_get_b1f0ab13c737f856(arg0, arg1) {
|
|
384
380
|
const ret = arg0[arg1 >>> 0];
|
|
385
381
|
return ret;
|
|
386
382
|
}
|
|
387
|
-
export function
|
|
383
|
+
export function __wbg_get_unchecked_363572bdd397d473(arg0, arg1) {
|
|
384
|
+
const ret = arg0[arg1 >>> 0];
|
|
385
|
+
return ret;
|
|
386
|
+
}
|
|
387
|
+
export function __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae(arg0) {
|
|
388
388
|
let result;
|
|
389
389
|
try {
|
|
390
390
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -394,7 +394,7 @@ export function __wbg_instanceof_ArrayBuffer_993d02d2d254cad1(arg0) {
|
|
|
394
394
|
const ret = result;
|
|
395
395
|
return ret;
|
|
396
396
|
}
|
|
397
|
-
export function
|
|
397
|
+
export function __wbg_instanceof_Map_1ff6a2b54c899f0d(arg0) {
|
|
398
398
|
let result;
|
|
399
399
|
try {
|
|
400
400
|
result = arg0 instanceof Map;
|
|
@@ -404,7 +404,7 @@ export function __wbg_instanceof_Map_9a4d6ead180ae3a9(arg0) {
|
|
|
404
404
|
const ret = result;
|
|
405
405
|
return ret;
|
|
406
406
|
}
|
|
407
|
-
export function
|
|
407
|
+
export function __wbg_instanceof_Uint8Array_598adc0fef426aa8(arg0) {
|
|
408
408
|
let result;
|
|
409
409
|
try {
|
|
410
410
|
result = arg0 instanceof Uint8Array;
|
|
@@ -414,83 +414,83 @@ export function __wbg_instanceof_Uint8Array_f935dbb0aa7cdeed(arg0) {
|
|
|
414
414
|
const ret = result;
|
|
415
415
|
return ret;
|
|
416
416
|
}
|
|
417
|
-
export function
|
|
417
|
+
export function __wbg_isArray_5674713bb7b79043(arg0) {
|
|
418
418
|
const ret = Array.isArray(arg0);
|
|
419
419
|
return ret;
|
|
420
420
|
}
|
|
421
|
-
export function
|
|
421
|
+
export function __wbg_isSafeInteger_8f51c743827d1ec5(arg0) {
|
|
422
422
|
const ret = Number.isSafeInteger(arg0);
|
|
423
423
|
return ret;
|
|
424
424
|
}
|
|
425
|
-
export function
|
|
425
|
+
export function __wbg_iterator_22ddeb808cf55a6f() {
|
|
426
426
|
const ret = Symbol.iterator;
|
|
427
427
|
return ret;
|
|
428
428
|
}
|
|
429
|
-
export function
|
|
429
|
+
export function __wbg_length_31bdaf014f5fbde2(arg0) {
|
|
430
430
|
const ret = arg0.length;
|
|
431
431
|
return ret;
|
|
432
432
|
}
|
|
433
|
-
export function
|
|
433
|
+
export function __wbg_length_4e1adc0d42e23620(arg0) {
|
|
434
434
|
const ret = arg0.length;
|
|
435
435
|
return ret;
|
|
436
436
|
}
|
|
437
|
-
export function
|
|
438
|
-
const ret = new Array();
|
|
439
|
-
return ret;
|
|
440
|
-
}
|
|
441
|
-
export function __wbg_new_77cc4f4f472aeb81(arg0) {
|
|
437
|
+
export function __wbg_new_1da3429bc3c4541c(arg0) {
|
|
442
438
|
const ret = new Uint8Array(arg0);
|
|
443
439
|
return ret;
|
|
444
440
|
}
|
|
445
|
-
export function
|
|
441
|
+
export function __wbg_new_8d36e20aa758e411() {
|
|
446
442
|
const ret = new Map();
|
|
447
443
|
return ret;
|
|
448
444
|
}
|
|
449
|
-
export function
|
|
445
|
+
export function __wbg_new_bebc3f4757acf305() {
|
|
450
446
|
const ret = new Object();
|
|
451
447
|
return ret;
|
|
452
448
|
}
|
|
453
|
-
export function
|
|
454
|
-
const ret =
|
|
449
|
+
export function __wbg_new_ffa92086ea89f79c() {
|
|
450
|
+
const ret = new Array();
|
|
455
451
|
return ret;
|
|
456
|
-
}
|
|
457
|
-
export function
|
|
452
|
+
}
|
|
453
|
+
export function __wbg_next_95053e306b1c3aed(arg0) {
|
|
458
454
|
const ret = arg0.next;
|
|
459
455
|
return ret;
|
|
460
456
|
}
|
|
461
|
-
export function
|
|
457
|
+
export function __wbg_next_f31ecb8646d2c605() { return handleError(function (arg0) {
|
|
458
|
+
const ret = arg0.next();
|
|
459
|
+
return ret;
|
|
460
|
+
}, arguments); }
|
|
461
|
+
export function __wbg_prototypesetcall_ae9f5e7459250748(arg0, arg1, arg2) {
|
|
462
462
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
463
463
|
}
|
|
464
|
-
export function
|
|
465
|
-
|
|
466
|
-
return ret;
|
|
464
|
+
export function __wbg_set_13d25b81ab403f5e(arg0, arg1, arg2) {
|
|
465
|
+
arg0[arg1 >>> 0] = arg2;
|
|
467
466
|
}
|
|
468
467
|
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
469
468
|
arg0[arg1] = arg2;
|
|
470
469
|
}
|
|
471
|
-
export function
|
|
472
|
-
|
|
470
|
+
export function __wbg_set_bf6dde4923b9b059(arg0, arg1, arg2) {
|
|
471
|
+
const ret = arg0.set(arg1, arg2);
|
|
472
|
+
return ret;
|
|
473
473
|
}
|
|
474
|
-
export function
|
|
474
|
+
export function __wbg_value_c227f843d21da141(arg0) {
|
|
475
475
|
const ret = arg0.value;
|
|
476
476
|
return ret;
|
|
477
477
|
}
|
|
478
|
-
export function
|
|
478
|
+
export function __wbindgen_generic_0000000000000001(arg0) {
|
|
479
479
|
// Cast intrinsic for `F64 -> Externref`.
|
|
480
480
|
const ret = arg0;
|
|
481
481
|
return ret;
|
|
482
482
|
}
|
|
483
|
-
export function
|
|
483
|
+
export function __wbindgen_generic_0000000000000002(arg0) {
|
|
484
484
|
// Cast intrinsic for `I64 -> Externref`.
|
|
485
485
|
const ret = arg0;
|
|
486
486
|
return ret;
|
|
487
487
|
}
|
|
488
|
-
export function
|
|
488
|
+
export function __wbindgen_generic_0000000000000003(arg0, arg1) {
|
|
489
489
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
490
490
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
491
491
|
return ret;
|
|
492
492
|
}
|
|
493
|
-
export function
|
|
493
|
+
export function __wbindgen_generic_0000000000000004(arg0) {
|
|
494
494
|
// Cast intrinsic for `U64 -> Externref`.
|
|
495
495
|
const ret = BigInt.asUintN(64, arg0);
|
|
496
496
|
return ret;
|
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.46",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|