@wafertools/testdata-parser 0.5.0
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 +175 -0
- package/package.json +21 -0
- package/testdata_parser.d.ts +65 -0
- package/testdata_parser.js +615 -0
- package/testdata_parser_bg.wasm +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# @wafertools/testdata-parser
|
|
2
|
+
|
|
3
|
+
Rust/WASM parsers for semiconductor test data formats: **STDF**, **ATDF**, **CSV**, and **JSON**. Compiled to a single WASM module via `wasm-bindgen`; the same Rust source also builds natively (used by [tsmap](https://github.com/wafertools/tsmap)'s Tauri backend).
|
|
4
|
+
|
|
5
|
+
All formats parse to one shared shape (`ParsedStdf` / `ScanResult`) — there is no format-specific output type on the JS side.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @wafertools/testdata-parser
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
The module must be initialized once before calling any parse function — it loads and instantiates the WASM binary.
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import init, { parse_stdf } from '@wafertools/testdata-parser';
|
|
19
|
+
|
|
20
|
+
await init(); // fetches testdata_parser_bg.wasm relative to the module URL
|
|
21
|
+
const bytes = new Uint8Array(await file.arrayBuffer());
|
|
22
|
+
const parsed = parse_stdf(bytes); // ParsedStdf, or throws a string error
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`init()` also installs a panic hook that routes any Rust panic to `console.error` with a stack trace, instead of an opaque WASM trap.
|
|
26
|
+
|
|
27
|
+
In a bundler/dev-server context, `new URL('...testdata_parser_bg.wasm', import.meta.url)` resolution can be finicky — see tsmap's `parserWorker.ts` for a worked example of loading this module off the main thread in a Vite app.
|
|
28
|
+
|
|
29
|
+
## API
|
|
30
|
+
|
|
31
|
+
Every parse function takes raw file bytes (`Uint8Array`) and returns a plain JS object (via `serde-wasm-bindgen`), or throws a `string` on error. Gzip-compressed input (`.gz`) is transparently decompressed for every format.
|
|
32
|
+
|
|
33
|
+
| Function | Signature | Returns |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `parse_stdf` | `(bytes: Uint8Array) => ParsedStdf` | Full parse of an STDF file |
|
|
36
|
+
| `parse_atdf` | `(bytes: Uint8Array) => ParsedStdf` | Full parse of an ATDF file |
|
|
37
|
+
| `parse_csv` | `(bytes: Uint8Array, mapping: CsvMapping) => ParsedStdf` | Full parse of a CSV, using an explicit column mapping |
|
|
38
|
+
| `parse_json` | `(bytes: Uint8Array, mapping: CsvMapping) => ParsedStdf` | Full parse of a JSON array-of-records file, using the same mapping shape as CSV |
|
|
39
|
+
| `stdf_test_names` | `(bytes: Uint8Array) => ScanResult` | Fast first-pass scan: test definitions + die count, no die accumulation |
|
|
40
|
+
| `atdf_test_names` | `(bytes: Uint8Array) => ScanResult` | Same first-pass scan for ATDF |
|
|
41
|
+
| `parse_stdf_filtered` | `(bytes: Uint8Array, selected: number[]) => ParsedStdf` | Full parse, skipping per-site accumulation for test numbers not in `selected` |
|
|
42
|
+
| `parse_atdf_filtered` | `(bytes: Uint8Array, selected: number[]) => ParsedStdf` | Same filtered parse for ATDF |
|
|
43
|
+
|
|
44
|
+
### Two-pass parsing (STDF/ATDF)
|
|
45
|
+
|
|
46
|
+
STDF and ATDF files can be large and contain far more tests than a caller wants to hold in memory. The intended flow:
|
|
47
|
+
|
|
48
|
+
1. **`stdf_test_names`/`atdf_test_names`** — a fast scan (PTR/FTR records only) that returns every test definition and the die count, without accumulating per-site test values.
|
|
49
|
+
2. Caller lets the user (or some policy) choose a subset of test numbers.
|
|
50
|
+
3. **`parse_stdf_filtered`/`parse_atdf_filtered`** — a full parse that still walks every record (so bin/wafer/lot data is complete) but only accumulates test values for the `selected` test numbers, bounding memory for wide files.
|
|
51
|
+
|
|
52
|
+
`test_defs` in the filtered result only includes tests seen in the second pass; a test that only appears on an early stop-on-fail die may be pruned from a truncated re-scan. Callers doing two-pass filtering should merge in the `test_defs` from the first-pass `ScanResult` to avoid losing that metadata (this is what tsmap's `testDefs` backfill does).
|
|
53
|
+
|
|
54
|
+
### CsvMapping
|
|
55
|
+
|
|
56
|
+
`parse_csv` and `parse_json` require an explicit mapping — there's no header auto-detection. Column mapping fields (all are source column names, matched against the file's header row):
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
interface CsvMapping {
|
|
60
|
+
x: string; // die X coordinate column
|
|
61
|
+
y: string; // die Y coordinate column
|
|
62
|
+
hbin?: string; // hardware bin column
|
|
63
|
+
sbin?: string; // software bin column
|
|
64
|
+
wafer?: string; // wafer ID column (groups rows into WaferData[])
|
|
65
|
+
lot?: string; // lot ID column
|
|
66
|
+
site?: string; // test site number column (numeric; non-numeric -> no site)
|
|
67
|
+
tests: CsvTestCol[]; // one entry per fixed test-value column
|
|
68
|
+
meta: string[]; // extra columns to surface as generic per-row metadata
|
|
69
|
+
splitBy: string[]; // columns to additionally facet wafers by (beyond `wafer`)
|
|
70
|
+
testnameCol?: string; // for "tall" CSVs: column holding the test name per row
|
|
71
|
+
testvalueCol?: string; // for "tall" CSVs: column holding the test value per row
|
|
72
|
+
loLimitCol?: string;
|
|
73
|
+
hiLimitCol?: string;
|
|
74
|
+
unitsCol?: string;
|
|
75
|
+
passBins: number[]; // hbin/sbin values treated as a pass for pass/fail summary
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface CsvTestCol {
|
|
79
|
+
col: string; // source column name
|
|
80
|
+
testNumber: number; // assigned test number
|
|
81
|
+
name: string; // display name
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Two ways to describe test columns are supported: a **fixed set** of `tests` (one column per test, "wide" format), or a **tall** layout (`testnameCol`/`testvalueCol` — one row per die×test, with the test identity read from a column rather than the header).
|
|
86
|
+
|
|
87
|
+
### Return shape — `ParsedStdf`
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
interface ParsedStdf {
|
|
91
|
+
meta: LotMeta;
|
|
92
|
+
wafers: WaferData[];
|
|
93
|
+
testDefs: Record<string, TestDef>; // keyed by test number as a string
|
|
94
|
+
sites: SiteInfo[];
|
|
95
|
+
warnings?: string[]; // non-fatal advisories, e.g. fabricated soft bins; omitted if empty
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface WaferData {
|
|
99
|
+
waferId: string;
|
|
100
|
+
results: DieResult[];
|
|
101
|
+
partCount?: number;
|
|
102
|
+
goodCount?: number;
|
|
103
|
+
failCount?: number;
|
|
104
|
+
fields?: MetaField[]; // per-wafer metadata (STDF/ATDF WIR/WRR); empty for formats without it
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface DieResult {
|
|
108
|
+
x: number;
|
|
109
|
+
y: number;
|
|
110
|
+
hbin?: number;
|
|
111
|
+
sbin?: number;
|
|
112
|
+
siteNum?: number;
|
|
113
|
+
partId?: number;
|
|
114
|
+
testValues?: Record<string, number>; // keyed by test number as a string
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface TestDef {
|
|
118
|
+
name: string;
|
|
119
|
+
testType: string; // "P" (parametric) or "F" (functional)
|
|
120
|
+
loLimit?: number;
|
|
121
|
+
hiLimit?: number;
|
|
122
|
+
units?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
interface LotMeta {
|
|
126
|
+
fields: MetaField[]; // every non-empty field from the source's lot record (STDF/ATDF MIR)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface MetaField {
|
|
130
|
+
key: string; // source field name, e.g. "lotId", "tstTemp", "startT"
|
|
131
|
+
value: string; // always a string; timestamps are ISO 8601
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface SiteInfo {
|
|
135
|
+
headNum: number;
|
|
136
|
+
siteNum: number;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`testDefs` and `testValues` are both keyed by **test number**, not test name — test numbers are the unique identity in STDF/ATDF; names are not guaranteed unique.
|
|
141
|
+
|
|
142
|
+
`meta`/`fields` are intentionally generic key/value pairs rather than a fixed struct: new metadata fields flow through from the source format with no type or crate change, and it's up to the host application to decide which fields to surface and how to label them.
|
|
143
|
+
|
|
144
|
+
### Return shape — `ScanResult`
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
interface ScanResult {
|
|
148
|
+
testDefs: Record<string, TestDef>;
|
|
149
|
+
dieCount: number;
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Native (non-WASM) usage
|
|
154
|
+
|
|
155
|
+
The crate also builds as a native Rust library (used directly by tsmap's Tauri commands, bypassing WASM entirely). Native-only entry points read from a file path instead of a byte buffer and are synchronous:
|
|
156
|
+
|
|
157
|
+
| Function | Module |
|
|
158
|
+
| --- | --- |
|
|
159
|
+
| `parse_stdf_sync(path: String) -> Result<ParsedStdf, String>` | `parse_stdf` |
|
|
160
|
+
| `parse_atdf_sync(path: String) -> Result<ParsedStdf, String>` | `parse_atdf` |
|
|
161
|
+
| `csv_headers_inner(path) -> Result<CsvHeadersResult, String>` | `parse_csv` |
|
|
162
|
+
| `parse_csv_inner(path, mapping) -> Result<ParsedStdf, String>` | `parse_csv` |
|
|
163
|
+
| `json_headers_sync(path) -> Result<Vec<String>, String>` | `parse_json` |
|
|
164
|
+
|
|
165
|
+
Enable the `native` feature (default) for these; the `wasm` feature gates the `wasm-bindgen` exports above. See `Cargo.toml` for the full feature list, including `bench` (enables a timed parse variant used by the perf benchmarks).
|
|
166
|
+
|
|
167
|
+
## Design notes
|
|
168
|
+
|
|
169
|
+
- **Byte readers are panic-free.** STDF/ATDF field readers are bounds-checked and return `Option`/`Result` rather than panicking on truncated input — a panic inside WASM aborts the whole module with no recovery, so this is a hard requirement, not a style preference.
|
|
170
|
+
- **Big-endian and little-endian STDF** are both supported (detected from the FAR record's `CPU_TYPE`).
|
|
171
|
+
- **Gzip is transparent** — every entry point decompresses `.gz` input automatically by sniffing the magic bytes; callers don't need to branch on compression.
|
|
172
|
+
|
|
173
|
+
## Versioning
|
|
174
|
+
|
|
175
|
+
This crate has its own release lifecycle, independent of any consuming application's version. See the parent repository's `CLAUDE.md` for the bump/build/publish steps.
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wafertools/testdata-parser",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"description": "Rust/WASM parsers for semiconductor test data formats (STDF, ATDF, CSV, JSON)",
|
|
5
|
+
"version": "0.5.0",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/wafertools/tsmap"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"testdata_parser_bg.wasm",
|
|
13
|
+
"testdata_parser.js",
|
|
14
|
+
"testdata_parser.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"main": "testdata_parser.js",
|
|
17
|
+
"types": "testdata_parser.d.ts",
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./snippets/*"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export function atdf_test_names(bytes: Uint8Array): any;
|
|
5
|
+
|
|
6
|
+
export function init(): void;
|
|
7
|
+
|
|
8
|
+
export function parse_atdf(bytes: Uint8Array): any;
|
|
9
|
+
|
|
10
|
+
export function parse_atdf_filtered(bytes: Uint8Array, selected: any): any;
|
|
11
|
+
|
|
12
|
+
export function parse_csv(bytes: Uint8Array, mapping: any): any;
|
|
13
|
+
|
|
14
|
+
export function parse_json(bytes: Uint8Array, mapping: any): any;
|
|
15
|
+
|
|
16
|
+
export function parse_stdf(bytes: Uint8Array): any;
|
|
17
|
+
|
|
18
|
+
export function parse_stdf_filtered(bytes: Uint8Array, selected: any): any;
|
|
19
|
+
|
|
20
|
+
export function stdf_test_names(bytes: Uint8Array): any;
|
|
21
|
+
|
|
22
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
23
|
+
|
|
24
|
+
export interface InitOutput {
|
|
25
|
+
readonly memory: WebAssembly.Memory;
|
|
26
|
+
readonly atdf_test_names: (a: number, b: number) => [number, number, number];
|
|
27
|
+
readonly init: () => void;
|
|
28
|
+
readonly parse_atdf: (a: number, b: number) => [number, number, number];
|
|
29
|
+
readonly parse_atdf_filtered: (a: number, b: number, c: any) => [number, number, number];
|
|
30
|
+
readonly parse_csv: (a: number, b: number, c: any) => [number, number, number];
|
|
31
|
+
readonly parse_json: (a: number, b: number, c: any) => [number, number, number];
|
|
32
|
+
readonly parse_stdf: (a: number, b: number) => [number, number, number];
|
|
33
|
+
readonly parse_stdf_filtered: (a: number, b: number, c: any) => [number, number, number];
|
|
34
|
+
readonly stdf_test_names: (a: number, b: number) => [number, number, number];
|
|
35
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
36
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
37
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
38
|
+
readonly __externref_table_alloc: () => number;
|
|
39
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
40
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
41
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
42
|
+
readonly __wbindgen_start: () => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
49
|
+
* a precompiled `WebAssembly.Module`.
|
|
50
|
+
*
|
|
51
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
52
|
+
*
|
|
53
|
+
* @returns {InitOutput}
|
|
54
|
+
*/
|
|
55
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
59
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
60
|
+
*
|
|
61
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
62
|
+
*
|
|
63
|
+
* @returns {Promise<InitOutput>}
|
|
64
|
+
*/
|
|
65
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
/* @ts-self-types="./testdata_parser.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {Uint8Array} bytes
|
|
5
|
+
* @returns {any}
|
|
6
|
+
*/
|
|
7
|
+
export function atdf_test_names(bytes) {
|
|
8
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
9
|
+
const len0 = WASM_VECTOR_LEN;
|
|
10
|
+
const ret = wasm.atdf_test_names(ptr0, len0);
|
|
11
|
+
if (ret[2]) {
|
|
12
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13
|
+
}
|
|
14
|
+
return takeFromExternrefTable0(ret[0]);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function init() {
|
|
18
|
+
wasm.init();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {Uint8Array} bytes
|
|
23
|
+
* @returns {any}
|
|
24
|
+
*/
|
|
25
|
+
export function parse_atdf(bytes) {
|
|
26
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
27
|
+
const len0 = WASM_VECTOR_LEN;
|
|
28
|
+
const ret = wasm.parse_atdf(ptr0, len0);
|
|
29
|
+
if (ret[2]) {
|
|
30
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
31
|
+
}
|
|
32
|
+
return takeFromExternrefTable0(ret[0]);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {Uint8Array} bytes
|
|
37
|
+
* @param {any} selected
|
|
38
|
+
* @returns {any}
|
|
39
|
+
*/
|
|
40
|
+
export function parse_atdf_filtered(bytes, selected) {
|
|
41
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
42
|
+
const len0 = WASM_VECTOR_LEN;
|
|
43
|
+
const ret = wasm.parse_atdf_filtered(ptr0, len0, selected);
|
|
44
|
+
if (ret[2]) {
|
|
45
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
46
|
+
}
|
|
47
|
+
return takeFromExternrefTable0(ret[0]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {Uint8Array} bytes
|
|
52
|
+
* @param {any} mapping
|
|
53
|
+
* @returns {any}
|
|
54
|
+
*/
|
|
55
|
+
export function parse_csv(bytes, mapping) {
|
|
56
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
57
|
+
const len0 = WASM_VECTOR_LEN;
|
|
58
|
+
const ret = wasm.parse_csv(ptr0, len0, mapping);
|
|
59
|
+
if (ret[2]) {
|
|
60
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
61
|
+
}
|
|
62
|
+
return takeFromExternrefTable0(ret[0]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @param {Uint8Array} bytes
|
|
67
|
+
* @param {any} mapping
|
|
68
|
+
* @returns {any}
|
|
69
|
+
*/
|
|
70
|
+
export function parse_json(bytes, mapping) {
|
|
71
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
72
|
+
const len0 = WASM_VECTOR_LEN;
|
|
73
|
+
const ret = wasm.parse_json(ptr0, len0, mapping);
|
|
74
|
+
if (ret[2]) {
|
|
75
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
76
|
+
}
|
|
77
|
+
return takeFromExternrefTable0(ret[0]);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @param {Uint8Array} bytes
|
|
82
|
+
* @returns {any}
|
|
83
|
+
*/
|
|
84
|
+
export function parse_stdf(bytes) {
|
|
85
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
86
|
+
const len0 = WASM_VECTOR_LEN;
|
|
87
|
+
const ret = wasm.parse_stdf(ptr0, len0);
|
|
88
|
+
if (ret[2]) {
|
|
89
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
90
|
+
}
|
|
91
|
+
return takeFromExternrefTable0(ret[0]);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @param {Uint8Array} bytes
|
|
96
|
+
* @param {any} selected
|
|
97
|
+
* @returns {any}
|
|
98
|
+
*/
|
|
99
|
+
export function parse_stdf_filtered(bytes, selected) {
|
|
100
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
101
|
+
const len0 = WASM_VECTOR_LEN;
|
|
102
|
+
const ret = wasm.parse_stdf_filtered(ptr0, len0, selected);
|
|
103
|
+
if (ret[2]) {
|
|
104
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
105
|
+
}
|
|
106
|
+
return takeFromExternrefTable0(ret[0]);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {Uint8Array} bytes
|
|
111
|
+
* @returns {any}
|
|
112
|
+
*/
|
|
113
|
+
export function stdf_test_names(bytes) {
|
|
114
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
115
|
+
const len0 = WASM_VECTOR_LEN;
|
|
116
|
+
const ret = wasm.stdf_test_names(ptr0, len0);
|
|
117
|
+
if (ret[2]) {
|
|
118
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
119
|
+
}
|
|
120
|
+
return takeFromExternrefTable0(ret[0]);
|
|
121
|
+
}
|
|
122
|
+
function __wbg_get_imports() {
|
|
123
|
+
const import0 = {
|
|
124
|
+
__proto__: null,
|
|
125
|
+
__wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
|
|
126
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
127
|
+
return ret;
|
|
128
|
+
},
|
|
129
|
+
__wbg_Number_6b506e6536831eaa: function(arg0) {
|
|
130
|
+
const ret = Number(arg0);
|
|
131
|
+
return ret;
|
|
132
|
+
},
|
|
133
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
134
|
+
const ret = String(arg1);
|
|
135
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
136
|
+
const len1 = WASM_VECTOR_LEN;
|
|
137
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
138
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
139
|
+
},
|
|
140
|
+
__wbg___wbindgen_boolean_get_1a45e2c38d4d41b9: function(arg0) {
|
|
141
|
+
const v = arg0;
|
|
142
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
143
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
144
|
+
},
|
|
145
|
+
__wbg___wbindgen_debug_string_0accd80f45e5faa2: function(arg0, arg1) {
|
|
146
|
+
const ret = debugString(arg1);
|
|
147
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
148
|
+
const len1 = WASM_VECTOR_LEN;
|
|
149
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
150
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
151
|
+
},
|
|
152
|
+
__wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
|
|
153
|
+
const ret = typeof(arg0) === 'function';
|
|
154
|
+
return ret;
|
|
155
|
+
},
|
|
156
|
+
__wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
|
|
157
|
+
const val = arg0;
|
|
158
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
159
|
+
return ret;
|
|
160
|
+
},
|
|
161
|
+
__wbg___wbindgen_is_string_c236cabd84a4d769: function(arg0) {
|
|
162
|
+
const ret = typeof(arg0) === 'string';
|
|
163
|
+
return ret;
|
|
164
|
+
},
|
|
165
|
+
__wbg___wbindgen_jsval_loose_eq_2c56564c75129511: function(arg0, arg1) {
|
|
166
|
+
const ret = arg0 == arg1;
|
|
167
|
+
return ret;
|
|
168
|
+
},
|
|
169
|
+
__wbg___wbindgen_number_get_9bb1761122181af2: function(arg0, arg1) {
|
|
170
|
+
const obj = arg1;
|
|
171
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
172
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
173
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
174
|
+
},
|
|
175
|
+
__wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
|
|
176
|
+
const obj = arg1;
|
|
177
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
178
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
179
|
+
var len1 = WASM_VECTOR_LEN;
|
|
180
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
181
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
182
|
+
},
|
|
183
|
+
__wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
|
|
184
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
185
|
+
},
|
|
186
|
+
__wbg_call_8a89609d89f6608a: function() { return handleError(function (arg0, arg1) {
|
|
187
|
+
const ret = arg0.call(arg1);
|
|
188
|
+
return ret;
|
|
189
|
+
}, arguments); },
|
|
190
|
+
__wbg_done_60cf307fcc680536: function(arg0) {
|
|
191
|
+
const ret = arg0.done;
|
|
192
|
+
return ret;
|
|
193
|
+
},
|
|
194
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
195
|
+
let deferred0_0;
|
|
196
|
+
let deferred0_1;
|
|
197
|
+
try {
|
|
198
|
+
deferred0_0 = arg0;
|
|
199
|
+
deferred0_1 = arg1;
|
|
200
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
201
|
+
} finally {
|
|
202
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
__wbg_get_1f8f054ddbaa7db2: function() { return handleError(function (arg0, arg1) {
|
|
206
|
+
const ret = Reflect.get(arg0, arg1);
|
|
207
|
+
return ret;
|
|
208
|
+
}, arguments); },
|
|
209
|
+
__wbg_get_unchecked_33f6e5c9e2f2d6b2: function(arg0, arg1) {
|
|
210
|
+
const ret = arg0[arg1 >>> 0];
|
|
211
|
+
return ret;
|
|
212
|
+
},
|
|
213
|
+
__wbg_instanceof_ArrayBuffer_8f49811467741499: function(arg0) {
|
|
214
|
+
let result;
|
|
215
|
+
try {
|
|
216
|
+
result = arg0 instanceof ArrayBuffer;
|
|
217
|
+
} catch (_) {
|
|
218
|
+
result = false;
|
|
219
|
+
}
|
|
220
|
+
const ret = result;
|
|
221
|
+
return ret;
|
|
222
|
+
},
|
|
223
|
+
__wbg_instanceof_Uint8Array_86f30649f63ef9c2: function(arg0) {
|
|
224
|
+
let result;
|
|
225
|
+
try {
|
|
226
|
+
result = arg0 instanceof Uint8Array;
|
|
227
|
+
} catch (_) {
|
|
228
|
+
result = false;
|
|
229
|
+
}
|
|
230
|
+
const ret = result;
|
|
231
|
+
return ret;
|
|
232
|
+
},
|
|
233
|
+
__wbg_isArray_67c2c9c4313f4448: function(arg0) {
|
|
234
|
+
const ret = Array.isArray(arg0);
|
|
235
|
+
return ret;
|
|
236
|
+
},
|
|
237
|
+
__wbg_isSafeInteger_66acec27e09e99a7: function(arg0) {
|
|
238
|
+
const ret = Number.isSafeInteger(arg0);
|
|
239
|
+
return ret;
|
|
240
|
+
},
|
|
241
|
+
__wbg_iterator_8732428d309e270e: function() {
|
|
242
|
+
const ret = Symbol.iterator;
|
|
243
|
+
return ret;
|
|
244
|
+
},
|
|
245
|
+
__wbg_length_4a591ecaa01354d9: function(arg0) {
|
|
246
|
+
const ret = arg0.length;
|
|
247
|
+
return ret;
|
|
248
|
+
},
|
|
249
|
+
__wbg_length_66f1a4b2e9026940: function(arg0) {
|
|
250
|
+
const ret = arg0.length;
|
|
251
|
+
return ret;
|
|
252
|
+
},
|
|
253
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
254
|
+
const ret = new Error();
|
|
255
|
+
return ret;
|
|
256
|
+
},
|
|
257
|
+
__wbg_new_578aeef4b6b94378: function(arg0) {
|
|
258
|
+
const ret = new Uint8Array(arg0);
|
|
259
|
+
return ret;
|
|
260
|
+
},
|
|
261
|
+
__wbg_new_622fc80556be2e26: function() {
|
|
262
|
+
const ret = new Map();
|
|
263
|
+
return ret;
|
|
264
|
+
},
|
|
265
|
+
__wbg_new_ce1ab61c1c2b300d: function() {
|
|
266
|
+
const ret = new Object();
|
|
267
|
+
return ret;
|
|
268
|
+
},
|
|
269
|
+
__wbg_new_d90091b82fdf5b91: function() {
|
|
270
|
+
const ret = new Array();
|
|
271
|
+
return ret;
|
|
272
|
+
},
|
|
273
|
+
__wbg_next_9e03acdf51c4960d: function(arg0) {
|
|
274
|
+
const ret = arg0.next;
|
|
275
|
+
return ret;
|
|
276
|
+
},
|
|
277
|
+
__wbg_next_eb8ca7351fa27906: function() { return handleError(function (arg0) {
|
|
278
|
+
const ret = arg0.next();
|
|
279
|
+
return ret;
|
|
280
|
+
}, arguments); },
|
|
281
|
+
__wbg_prototypesetcall_3249fc62a0fafa30: function(arg0, arg1, arg2) {
|
|
282
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
283
|
+
},
|
|
284
|
+
__wbg_set_52b1e1eb5bed906a: function(arg0, arg1, arg2) {
|
|
285
|
+
const ret = arg0.set(arg1, arg2);
|
|
286
|
+
return ret;
|
|
287
|
+
},
|
|
288
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
289
|
+
arg0[arg1] = arg2;
|
|
290
|
+
},
|
|
291
|
+
__wbg_set_dca99999bba88a9a: function(arg0, arg1, arg2) {
|
|
292
|
+
arg0[arg1 >>> 0] = arg2;
|
|
293
|
+
},
|
|
294
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
295
|
+
const ret = arg1.stack;
|
|
296
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
297
|
+
const len1 = WASM_VECTOR_LEN;
|
|
298
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
299
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
300
|
+
},
|
|
301
|
+
__wbg_stringify_8286df6dcc591521: function() { return handleError(function (arg0) {
|
|
302
|
+
const ret = JSON.stringify(arg0);
|
|
303
|
+
return ret;
|
|
304
|
+
}, arguments); },
|
|
305
|
+
__wbg_value_f3625092ee4b37f4: function(arg0) {
|
|
306
|
+
const ret = arg0.value;
|
|
307
|
+
return ret;
|
|
308
|
+
},
|
|
309
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
310
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
311
|
+
const ret = arg0;
|
|
312
|
+
return ret;
|
|
313
|
+
},
|
|
314
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
315
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
316
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
317
|
+
return ret;
|
|
318
|
+
},
|
|
319
|
+
__wbindgen_init_externref_table: function() {
|
|
320
|
+
const table = wasm.__wbindgen_externrefs;
|
|
321
|
+
const offset = table.grow(4);
|
|
322
|
+
table.set(0, undefined);
|
|
323
|
+
table.set(offset + 0, undefined);
|
|
324
|
+
table.set(offset + 1, null);
|
|
325
|
+
table.set(offset + 2, true);
|
|
326
|
+
table.set(offset + 3, false);
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
return {
|
|
330
|
+
__proto__: null,
|
|
331
|
+
"./testdata_parser_bg.js": import0,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function addToExternrefTable0(obj) {
|
|
336
|
+
const idx = wasm.__externref_table_alloc();
|
|
337
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
338
|
+
return idx;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function debugString(val) {
|
|
342
|
+
// primitive types
|
|
343
|
+
const type = typeof val;
|
|
344
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
345
|
+
return `${val}`;
|
|
346
|
+
}
|
|
347
|
+
if (type == 'string') {
|
|
348
|
+
return `"${val}"`;
|
|
349
|
+
}
|
|
350
|
+
if (type == 'symbol') {
|
|
351
|
+
const description = val.description;
|
|
352
|
+
if (description == null) {
|
|
353
|
+
return 'Symbol';
|
|
354
|
+
} else {
|
|
355
|
+
return `Symbol(${description})`;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (type == 'function') {
|
|
359
|
+
const name = val.name;
|
|
360
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
361
|
+
return `Function(${name})`;
|
|
362
|
+
} else {
|
|
363
|
+
return 'Function';
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
// objects
|
|
367
|
+
if (Array.isArray(val)) {
|
|
368
|
+
const length = val.length;
|
|
369
|
+
let debug = '[';
|
|
370
|
+
if (length > 0) {
|
|
371
|
+
debug += debugString(val[0]);
|
|
372
|
+
}
|
|
373
|
+
for(let i = 1; i < length; i++) {
|
|
374
|
+
debug += ', ' + debugString(val[i]);
|
|
375
|
+
}
|
|
376
|
+
debug += ']';
|
|
377
|
+
return debug;
|
|
378
|
+
}
|
|
379
|
+
// Test for built-in
|
|
380
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
381
|
+
let className;
|
|
382
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
383
|
+
className = builtInMatches[1];
|
|
384
|
+
} else {
|
|
385
|
+
// Failed to match the standard '[object ClassName]'
|
|
386
|
+
return toString.call(val);
|
|
387
|
+
}
|
|
388
|
+
if (className == 'Object') {
|
|
389
|
+
// we're a user defined class or Object
|
|
390
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
391
|
+
// easier than looping through ownProperties of `val`.
|
|
392
|
+
try {
|
|
393
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
394
|
+
} catch (_) {
|
|
395
|
+
return 'Object';
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
// errors
|
|
399
|
+
if (val instanceof Error) {
|
|
400
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
401
|
+
}
|
|
402
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
403
|
+
return className;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
407
|
+
ptr = ptr >>> 0;
|
|
408
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
let cachedDataViewMemory0 = null;
|
|
412
|
+
function getDataViewMemory0() {
|
|
413
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
414
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
415
|
+
}
|
|
416
|
+
return cachedDataViewMemory0;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function getStringFromWasm0(ptr, len) {
|
|
420
|
+
return decodeText(ptr >>> 0, len);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
let cachedUint8ArrayMemory0 = null;
|
|
424
|
+
function getUint8ArrayMemory0() {
|
|
425
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
426
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
427
|
+
}
|
|
428
|
+
return cachedUint8ArrayMemory0;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
function handleError(f, args) {
|
|
432
|
+
try {
|
|
433
|
+
return f.apply(this, args);
|
|
434
|
+
} catch (e) {
|
|
435
|
+
const idx = addToExternrefTable0(e);
|
|
436
|
+
wasm.__wbindgen_exn_store(idx);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function isLikeNone(x) {
|
|
441
|
+
return x === undefined || x === null;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
445
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
446
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
447
|
+
WASM_VECTOR_LEN = arg.length;
|
|
448
|
+
return ptr;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
452
|
+
if (realloc === undefined) {
|
|
453
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
454
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
455
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
456
|
+
WASM_VECTOR_LEN = buf.length;
|
|
457
|
+
return ptr;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
let len = arg.length;
|
|
461
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
462
|
+
|
|
463
|
+
const mem = getUint8ArrayMemory0();
|
|
464
|
+
|
|
465
|
+
let offset = 0;
|
|
466
|
+
|
|
467
|
+
for (; offset < len; offset++) {
|
|
468
|
+
const code = arg.charCodeAt(offset);
|
|
469
|
+
if (code > 0x7F) break;
|
|
470
|
+
mem[ptr + offset] = code;
|
|
471
|
+
}
|
|
472
|
+
if (offset !== len) {
|
|
473
|
+
if (offset !== 0) {
|
|
474
|
+
arg = arg.slice(offset);
|
|
475
|
+
}
|
|
476
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
477
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
478
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
479
|
+
|
|
480
|
+
offset += ret.written;
|
|
481
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
WASM_VECTOR_LEN = offset;
|
|
485
|
+
return ptr;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function takeFromExternrefTable0(idx) {
|
|
489
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
490
|
+
wasm.__externref_table_dealloc(idx);
|
|
491
|
+
return value;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
495
|
+
cachedTextDecoder.decode();
|
|
496
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
497
|
+
let numBytesDecoded = 0;
|
|
498
|
+
function decodeText(ptr, len) {
|
|
499
|
+
numBytesDecoded += len;
|
|
500
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
501
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
502
|
+
cachedTextDecoder.decode();
|
|
503
|
+
numBytesDecoded = len;
|
|
504
|
+
}
|
|
505
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const cachedTextEncoder = new TextEncoder();
|
|
509
|
+
|
|
510
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
511
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
512
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
513
|
+
view.set(buf);
|
|
514
|
+
return {
|
|
515
|
+
read: arg.length,
|
|
516
|
+
written: buf.length
|
|
517
|
+
};
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
let WASM_VECTOR_LEN = 0;
|
|
522
|
+
|
|
523
|
+
let wasmModule, wasmInstance, wasm;
|
|
524
|
+
function __wbg_finalize_init(instance, module) {
|
|
525
|
+
wasmInstance = instance;
|
|
526
|
+
wasm = instance.exports;
|
|
527
|
+
wasmModule = module;
|
|
528
|
+
cachedDataViewMemory0 = null;
|
|
529
|
+
cachedUint8ArrayMemory0 = null;
|
|
530
|
+
wasm.__wbindgen_start();
|
|
531
|
+
return wasm;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
async function __wbg_load(module, imports) {
|
|
535
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
536
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
537
|
+
try {
|
|
538
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
539
|
+
} catch (e) {
|
|
540
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
541
|
+
|
|
542
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
543
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
544
|
+
|
|
545
|
+
} else { throw e; }
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const bytes = await module.arrayBuffer();
|
|
550
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
551
|
+
} else {
|
|
552
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
553
|
+
|
|
554
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
555
|
+
return { instance, module };
|
|
556
|
+
} else {
|
|
557
|
+
return instance;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function expectedResponseType(type) {
|
|
562
|
+
switch (type) {
|
|
563
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
564
|
+
}
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function initSync(module) {
|
|
570
|
+
if (wasm !== undefined) return wasm;
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
if (module !== undefined) {
|
|
574
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
575
|
+
({module} = module)
|
|
576
|
+
} else {
|
|
577
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
const imports = __wbg_get_imports();
|
|
582
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
583
|
+
module = new WebAssembly.Module(module);
|
|
584
|
+
}
|
|
585
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
586
|
+
return __wbg_finalize_init(instance, module);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
async function __wbg_init(module_or_path) {
|
|
590
|
+
if (wasm !== undefined) return wasm;
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
if (module_or_path !== undefined) {
|
|
594
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
595
|
+
({module_or_path} = module_or_path)
|
|
596
|
+
} else {
|
|
597
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
if (module_or_path === undefined) {
|
|
602
|
+
module_or_path = new URL('testdata_parser_bg.wasm', import.meta.url);
|
|
603
|
+
}
|
|
604
|
+
const imports = __wbg_get_imports();
|
|
605
|
+
|
|
606
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
607
|
+
module_or_path = fetch(module_or_path);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
611
|
+
|
|
612
|
+
return __wbg_finalize_init(instance, module);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|