@uruhalushia/rule-converter-wasm 0.1.3 → 0.2.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 +67 -10
- package/package.json +1 -1
- package/rule_converter_wasm.d.ts +18 -2
- package/rule_converter_wasm.js +1 -1
- package/rule_converter_wasm_bg.js +303 -4
- package/rule_converter_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -33,12 +33,12 @@ Create an HTML file outside `pkg`, then import the generated module by relative
|
|
|
33
33
|
<meta charset="utf-8" />
|
|
34
34
|
<button id="convert">convert</button>
|
|
35
35
|
<script type="module">
|
|
36
|
-
import init, {
|
|
36
|
+
import init, { strToBuf } from './wasm/pkg/rule_converter_wasm.js'
|
|
37
37
|
|
|
38
38
|
await init()
|
|
39
39
|
|
|
40
40
|
document.querySelector('#convert').addEventListener('click', () => {
|
|
41
|
-
const result =
|
|
41
|
+
const result = strToBuf(
|
|
42
42
|
`payload:\n - DOMAIN,example.com\n - DOMAIN-SUFFIX,example.net\n`,
|
|
43
43
|
{
|
|
44
44
|
inputTarget: 'mihomo',
|
|
@@ -50,8 +50,8 @@ Create an HTML file outside `pkg`, then import the generated module by relative
|
|
|
50
50
|
},
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
-
const
|
|
54
|
-
console.log(
|
|
53
|
+
const bytes = result.outputs.domain
|
|
54
|
+
console.log(result.info.domain.behavior, result.info.domain.format, result.info.domain.count, bytes)
|
|
55
55
|
})
|
|
56
56
|
</script>
|
|
57
57
|
```
|
|
@@ -80,11 +80,11 @@ pnpm add file:/home/atri/git/xishang/rule-converter/wasm/pkg
|
|
|
80
80
|
Use it from app code:
|
|
81
81
|
|
|
82
82
|
```js
|
|
83
|
-
import init, {
|
|
83
|
+
import init, { strToBuf } from '@uruhalushia/rule-converter-wasm'
|
|
84
84
|
|
|
85
85
|
await init()
|
|
86
86
|
|
|
87
|
-
const result =
|
|
87
|
+
const result = strToBuf(
|
|
88
88
|
`payload:\n - DOMAIN,example.com\n - DOMAIN-SUFFIX,example.net\n`,
|
|
89
89
|
{
|
|
90
90
|
inputTarget: 'mihomo',
|
|
@@ -96,19 +96,76 @@ const result = convertPayloadString(
|
|
|
96
96
|
},
|
|
97
97
|
)
|
|
98
98
|
|
|
99
|
-
for (const
|
|
100
|
-
console.log(
|
|
99
|
+
for (const [name, bytes] of Object.entries(result.outputs)) {
|
|
100
|
+
console.log(name, result.info[name].behavior, result.info[name].format, result.info[name].count, bytes)
|
|
101
101
|
}
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
The returned `bytes` value is a `Uint8Array`, so it can be downloaded, uploaded, or stored in IndexedDB directly.
|
|
105
105
|
|
|
106
|
+
MMDB list APIs also accept uploaded file bytes:
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
import init, { listAsnNumbers, listGeoipCountries, listGeoipDatCountries, listGeositeCodes } from '@uruhalushia/rule-converter-wasm'
|
|
110
|
+
|
|
111
|
+
await init()
|
|
112
|
+
|
|
113
|
+
const bytes = new Uint8Array(await file.arrayBuffer())
|
|
114
|
+
console.log(listGeoipCountries(bytes))
|
|
115
|
+
console.log(listAsnNumbers(bytes))
|
|
116
|
+
console.log(listGeoipDatCountries(geoipDatBytes))
|
|
117
|
+
console.log(listGeositeCodes(geositeDatBytes))
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
DB conversions use the same `bufToBuf` / `bufToStr` functions. For example:
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
const db = new Uint8Array(await mmdbFile.arrayBuffer())
|
|
124
|
+
const cn = bufToStr(db, {
|
|
125
|
+
inputTarget: 'geoip',
|
|
126
|
+
inputFormat: 'mmdb',
|
|
127
|
+
outputTarget: 'general',
|
|
128
|
+
outputFormat: 'ipset',
|
|
129
|
+
countries: ['cn'],
|
|
130
|
+
split: false,
|
|
131
|
+
})
|
|
132
|
+
const dat = bufToBuf(db, {
|
|
133
|
+
inputTarget: 'geoip',
|
|
134
|
+
inputFormat: 'mmdb',
|
|
135
|
+
outputTarget: 'geoip',
|
|
136
|
+
outputFormat: 'dat',
|
|
137
|
+
})
|
|
138
|
+
const geositeRules = bufToStr(geositeDatBytes, {
|
|
139
|
+
inputTarget: 'geosite',
|
|
140
|
+
inputFormat: 'dat',
|
|
141
|
+
outputTarget: 'general',
|
|
142
|
+
outputFormat: 'ruleset',
|
|
143
|
+
codes: ['cn'],
|
|
144
|
+
split: false,
|
|
145
|
+
})
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
Rule matching uses the same input options as conversion. Mihomo config input is supported when providers use local `path`/`file://` references supplied by the host application; browser HTTP provider downloads should be handled by the caller before matching:
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
import init, { matchStr } from '@uruhalushia/rule-converter-wasm'
|
|
153
|
+
|
|
154
|
+
await init()
|
|
155
|
+
const result = matchStr('DOMAIN-SUFFIX,example.com\n', 'ads.example.com', {
|
|
156
|
+
inputTarget: 'general',
|
|
157
|
+
inputFormat: 'text',
|
|
158
|
+
inputBehavior: 'classical',
|
|
159
|
+
})
|
|
160
|
+
console.log(result.matched, result.rules)
|
|
161
|
+
```
|
|
162
|
+
|
|
106
163
|
Options use the same names as the N-API package:
|
|
107
164
|
|
|
108
165
|
```ts
|
|
109
166
|
type RuleTarget = 'mihomo' | 'general' | 'egern' | 'sing-box'
|
|
110
|
-
type InputFormat = 'yaml' | 'mrs' | 'text' | 'json' | 'srs'
|
|
111
|
-
type OutputFormat = 'mrs' | 'text' | 'yaml' | 'json' | 'srs' | 'domainset' | 'ruleset' | 'ipset'
|
|
167
|
+
type InputFormat = 'yaml' | 'mrs' | 'text' | 'json' | 'srs' | 'domainset' | 'ruleset' | 'ipset' | 'mmdb' | 'sing-db' | 'metadb' | 'dat'
|
|
168
|
+
type OutputFormat = 'mrs' | 'text' | 'yaml' | 'json' | 'srs' | 'domainset' | 'ruleset' | 'ipset' | 'mmdb' | 'sing-db' | 'metadb' | 'dat'
|
|
112
169
|
type InputBehavior = 'auto' | 'domain' | 'ip' | 'classical'
|
|
113
170
|
type OutputBehavior = 'domain' | 'ip' | 'classical'
|
|
114
171
|
```
|
package/package.json
CHANGED
package/rule_converter_wasm.d.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
-
export function
|
|
4
|
+
export function bufToBuf(payload: Uint8Array, options: any): any;
|
|
5
5
|
|
|
6
|
-
export function
|
|
6
|
+
export function bufToStr(payload: Uint8Array, options: any): any;
|
|
7
|
+
|
|
8
|
+
export function listAsnNumbers(payload: Uint8Array): any;
|
|
9
|
+
|
|
10
|
+
export function listGeoipCountries(payload: Uint8Array): any;
|
|
11
|
+
|
|
12
|
+
export function listGeoipDatCountries(payload: Uint8Array): any;
|
|
13
|
+
|
|
14
|
+
export function listGeositeCodes(payload: Uint8Array): any;
|
|
15
|
+
|
|
16
|
+
export function matchBuf(payload: Uint8Array, query: string, options: any): any;
|
|
17
|
+
|
|
18
|
+
export function matchStr(payload: string, query: string, options: any): any;
|
|
19
|
+
|
|
20
|
+
export function strToBuf(payload: string, options: any): any;
|
|
21
|
+
|
|
22
|
+
export function strToStr(payload: string, options: any): any;
|
package/rule_converter_wasm.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./rule_converter_wasm_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
bufToBuf, bufToStr, listAsnNumbers, listGeoipCountries, listGeoipDatCountries, listGeositeCodes, matchBuf, matchStr, strToBuf, strToStr
|
|
9
9
|
} from "./rule_converter_wasm_bg.js";
|
|
@@ -3,12 +3,175 @@
|
|
|
3
3
|
* @param {any} options
|
|
4
4
|
* @returns {any}
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function bufToBuf(payload, options) {
|
|
7
7
|
try {
|
|
8
8
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
9
9
|
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
10
10
|
const len0 = WASM_VECTOR_LEN;
|
|
11
|
-
wasm.
|
|
11
|
+
wasm.bufToBuf(retptr, ptr0, len0, addHeapObject(options));
|
|
12
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
13
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
14
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
15
|
+
if (r2) {
|
|
16
|
+
throw takeObject(r1);
|
|
17
|
+
}
|
|
18
|
+
return takeObject(r0);
|
|
19
|
+
} finally {
|
|
20
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {Uint8Array} payload
|
|
26
|
+
* @param {any} options
|
|
27
|
+
* @returns {any}
|
|
28
|
+
*/
|
|
29
|
+
export function bufToStr(payload, options) {
|
|
30
|
+
try {
|
|
31
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
32
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
33
|
+
const len0 = WASM_VECTOR_LEN;
|
|
34
|
+
wasm.bufToStr(retptr, ptr0, len0, addHeapObject(options));
|
|
35
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
36
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
37
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
38
|
+
if (r2) {
|
|
39
|
+
throw takeObject(r1);
|
|
40
|
+
}
|
|
41
|
+
return takeObject(r0);
|
|
42
|
+
} finally {
|
|
43
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @param {Uint8Array} payload
|
|
49
|
+
* @returns {any}
|
|
50
|
+
*/
|
|
51
|
+
export function listAsnNumbers(payload) {
|
|
52
|
+
try {
|
|
53
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
54
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
55
|
+
const len0 = WASM_VECTOR_LEN;
|
|
56
|
+
wasm.listAsnNumbers(retptr, ptr0, len0);
|
|
57
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
58
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
59
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
60
|
+
if (r2) {
|
|
61
|
+
throw takeObject(r1);
|
|
62
|
+
}
|
|
63
|
+
return takeObject(r0);
|
|
64
|
+
} finally {
|
|
65
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {Uint8Array} payload
|
|
71
|
+
* @returns {any}
|
|
72
|
+
*/
|
|
73
|
+
export function listGeoipCountries(payload) {
|
|
74
|
+
try {
|
|
75
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
76
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
77
|
+
const len0 = WASM_VECTOR_LEN;
|
|
78
|
+
wasm.listGeoipCountries(retptr, ptr0, len0);
|
|
79
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
80
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
81
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
82
|
+
if (r2) {
|
|
83
|
+
throw takeObject(r1);
|
|
84
|
+
}
|
|
85
|
+
return takeObject(r0);
|
|
86
|
+
} finally {
|
|
87
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param {Uint8Array} payload
|
|
93
|
+
* @returns {any}
|
|
94
|
+
*/
|
|
95
|
+
export function listGeoipDatCountries(payload) {
|
|
96
|
+
try {
|
|
97
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
98
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
99
|
+
const len0 = WASM_VECTOR_LEN;
|
|
100
|
+
wasm.listGeoipDatCountries(retptr, ptr0, len0);
|
|
101
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
102
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
103
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
104
|
+
if (r2) {
|
|
105
|
+
throw takeObject(r1);
|
|
106
|
+
}
|
|
107
|
+
return takeObject(r0);
|
|
108
|
+
} finally {
|
|
109
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @param {Uint8Array} payload
|
|
115
|
+
* @returns {any}
|
|
116
|
+
*/
|
|
117
|
+
export function listGeositeCodes(payload) {
|
|
118
|
+
try {
|
|
119
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
120
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
121
|
+
const len0 = WASM_VECTOR_LEN;
|
|
122
|
+
wasm.listGeositeCodes(retptr, ptr0, len0);
|
|
123
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
124
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
125
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
126
|
+
if (r2) {
|
|
127
|
+
throw takeObject(r1);
|
|
128
|
+
}
|
|
129
|
+
return takeObject(r0);
|
|
130
|
+
} finally {
|
|
131
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @param {Uint8Array} payload
|
|
137
|
+
* @param {string} query
|
|
138
|
+
* @param {any} options
|
|
139
|
+
* @returns {any}
|
|
140
|
+
*/
|
|
141
|
+
export function matchBuf(payload, query, options) {
|
|
142
|
+
try {
|
|
143
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
144
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
145
|
+
const len0 = WASM_VECTOR_LEN;
|
|
146
|
+
const ptr1 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
147
|
+
const len1 = WASM_VECTOR_LEN;
|
|
148
|
+
wasm.matchBuf(retptr, ptr0, len0, ptr1, len1, addHeapObject(options));
|
|
149
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
150
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
151
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
152
|
+
if (r2) {
|
|
153
|
+
throw takeObject(r1);
|
|
154
|
+
}
|
|
155
|
+
return takeObject(r0);
|
|
156
|
+
} finally {
|
|
157
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @param {string} payload
|
|
163
|
+
* @param {string} query
|
|
164
|
+
* @param {any} options
|
|
165
|
+
* @returns {any}
|
|
166
|
+
*/
|
|
167
|
+
export function matchStr(payload, query, options) {
|
|
168
|
+
try {
|
|
169
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
170
|
+
const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
171
|
+
const len0 = WASM_VECTOR_LEN;
|
|
172
|
+
const ptr1 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
173
|
+
const len1 = WASM_VECTOR_LEN;
|
|
174
|
+
wasm.matchStr(retptr, ptr0, len0, ptr1, len1, addHeapObject(options));
|
|
12
175
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
13
176
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
14
177
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -26,12 +189,35 @@ export function convertPayload(payload, options) {
|
|
|
26
189
|
* @param {any} options
|
|
27
190
|
* @returns {any}
|
|
28
191
|
*/
|
|
29
|
-
export function
|
|
192
|
+
export function strToBuf(payload, options) {
|
|
30
193
|
try {
|
|
31
194
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
32
195
|
const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
33
196
|
const len0 = WASM_VECTOR_LEN;
|
|
34
|
-
wasm.
|
|
197
|
+
wasm.strToBuf(retptr, ptr0, len0, addHeapObject(options));
|
|
198
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
199
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
200
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
201
|
+
if (r2) {
|
|
202
|
+
throw takeObject(r1);
|
|
203
|
+
}
|
|
204
|
+
return takeObject(r0);
|
|
205
|
+
} finally {
|
|
206
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* @param {string} payload
|
|
212
|
+
* @param {any} options
|
|
213
|
+
* @returns {any}
|
|
214
|
+
*/
|
|
215
|
+
export function strToStr(payload, options) {
|
|
216
|
+
try {
|
|
217
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
218
|
+
const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
219
|
+
const len0 = WASM_VECTOR_LEN;
|
|
220
|
+
wasm.strToStr(retptr, ptr0, len0, addHeapObject(options));
|
|
35
221
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
36
222
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
37
223
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -47,6 +233,10 @@ export function __wbg_Error_bce6d499ff0a4aff(arg0, arg1) {
|
|
|
47
233
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
48
234
|
return addHeapObject(ret);
|
|
49
235
|
}
|
|
236
|
+
export function __wbg_Number_b7972a139bfbfdf0(arg0) {
|
|
237
|
+
const ret = Number(getObject(arg0));
|
|
238
|
+
return ret;
|
|
239
|
+
}
|
|
50
240
|
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
51
241
|
const ret = String(getObject(arg1));
|
|
52
242
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -54,6 +244,12 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
|
54
244
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
55
245
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
56
246
|
}
|
|
247
|
+
export function __wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83(arg0, arg1) {
|
|
248
|
+
const v = getObject(arg1);
|
|
249
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
250
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
251
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
252
|
+
}
|
|
57
253
|
export function __wbg___wbindgen_boolean_get_2304fb8c853028c8(arg0) {
|
|
58
254
|
const v = getObject(arg0);
|
|
59
255
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
@@ -70,6 +266,14 @@ export function __wbg___wbindgen_in_07056af4f902c445(arg0, arg1) {
|
|
|
70
266
|
const ret = getObject(arg0) in getObject(arg1);
|
|
71
267
|
return ret;
|
|
72
268
|
}
|
|
269
|
+
export function __wbg___wbindgen_is_bigint_aeae3893f30ed54e(arg0) {
|
|
270
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
271
|
+
return ret;
|
|
272
|
+
}
|
|
273
|
+
export function __wbg___wbindgen_is_function_5cd60d5cf78b4eef(arg0) {
|
|
274
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
275
|
+
return ret;
|
|
276
|
+
}
|
|
73
277
|
export function __wbg___wbindgen_is_null_2042690d351e14f0(arg0) {
|
|
74
278
|
const ret = getObject(arg0) === null;
|
|
75
279
|
return ret;
|
|
@@ -79,10 +283,18 @@ export function __wbg___wbindgen_is_object_b4593df85baada48(arg0) {
|
|
|
79
283
|
const ret = typeof(val) === 'object' && val !== null;
|
|
80
284
|
return ret;
|
|
81
285
|
}
|
|
286
|
+
export function __wbg___wbindgen_is_string_dde0fd9020db4434(arg0) {
|
|
287
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
288
|
+
return ret;
|
|
289
|
+
}
|
|
82
290
|
export function __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5(arg0) {
|
|
83
291
|
const ret = getObject(arg0) === undefined;
|
|
84
292
|
return ret;
|
|
85
293
|
}
|
|
294
|
+
export function __wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9(arg0, arg1) {
|
|
295
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
296
|
+
return ret;
|
|
297
|
+
}
|
|
86
298
|
export function __wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c(arg0, arg1) {
|
|
87
299
|
const ret = getObject(arg0) == getObject(arg1);
|
|
88
300
|
return ret;
|
|
@@ -104,6 +316,34 @@ export function __wbg___wbindgen_string_get_d109740c0d18f4d7(arg0, arg1) {
|
|
|
104
316
|
export function __wbg___wbindgen_throw_9c31b086c2b26051(arg0, arg1) {
|
|
105
317
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
106
318
|
}
|
|
319
|
+
export function __wbg_call_13665d9f14390edc() { return handleError(function (arg0, arg1) {
|
|
320
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
321
|
+
return addHeapObject(ret);
|
|
322
|
+
}, arguments); }
|
|
323
|
+
export function __wbg_done_54b8da57023b7ed2(arg0) {
|
|
324
|
+
const ret = getObject(arg0).done;
|
|
325
|
+
return ret;
|
|
326
|
+
}
|
|
327
|
+
export function __wbg_entries_564a7e8b1e54ede5(arg0) {
|
|
328
|
+
const ret = Object.entries(getObject(arg0));
|
|
329
|
+
return addHeapObject(ret);
|
|
330
|
+
}
|
|
331
|
+
export function __wbg_get_3e9a707ab7d352eb() { return handleError(function (arg0, arg1) {
|
|
332
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
333
|
+
return addHeapObject(ret);
|
|
334
|
+
}, arguments); }
|
|
335
|
+
export function __wbg_get_98fdf51d029a75eb(arg0, arg1) {
|
|
336
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
337
|
+
return addHeapObject(ret);
|
|
338
|
+
}
|
|
339
|
+
export function __wbg_get_dcf82ab8aad1a593() { return handleError(function (arg0, arg1) {
|
|
340
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
341
|
+
return addHeapObject(ret);
|
|
342
|
+
}, arguments); }
|
|
343
|
+
export function __wbg_get_unchecked_1dfe6d05ad91d9b7(arg0, arg1) {
|
|
344
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
345
|
+
return addHeapObject(ret);
|
|
346
|
+
}
|
|
107
347
|
export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
|
|
108
348
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
109
349
|
return addHeapObject(ret);
|
|
@@ -128,6 +368,26 @@ export function __wbg_instanceof_Uint8Array_abd07d4bd221d50b(arg0) {
|
|
|
128
368
|
const ret = result;
|
|
129
369
|
return ret;
|
|
130
370
|
}
|
|
371
|
+
export function __wbg_isArray_94898ed3aad6947b(arg0) {
|
|
372
|
+
const ret = Array.isArray(getObject(arg0));
|
|
373
|
+
return ret;
|
|
374
|
+
}
|
|
375
|
+
export function __wbg_isSafeInteger_01e964d144ad3a55(arg0) {
|
|
376
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
377
|
+
return ret;
|
|
378
|
+
}
|
|
379
|
+
export function __wbg_iterator_1441b47f341dc34f() {
|
|
380
|
+
const ret = Symbol.iterator;
|
|
381
|
+
return addHeapObject(ret);
|
|
382
|
+
}
|
|
383
|
+
export function __wbg_keys_682010b680c9b1f8(arg0) {
|
|
384
|
+
const ret = Object.keys(getObject(arg0));
|
|
385
|
+
return addHeapObject(ret);
|
|
386
|
+
}
|
|
387
|
+
export function __wbg_length_2591a0f4f659a55c(arg0) {
|
|
388
|
+
const ret = getObject(arg0).length;
|
|
389
|
+
return ret;
|
|
390
|
+
}
|
|
131
391
|
export function __wbg_length_56fcd3e2b7e0299d(arg0) {
|
|
132
392
|
const ret = getObject(arg0).length;
|
|
133
393
|
return ret;
|
|
@@ -136,6 +396,10 @@ export function __wbg_new_02d162bc6cf02f60() {
|
|
|
136
396
|
const ret = new Object();
|
|
137
397
|
return addHeapObject(ret);
|
|
138
398
|
}
|
|
399
|
+
export function __wbg_new_070df68d66325372() {
|
|
400
|
+
const ret = new Map();
|
|
401
|
+
return addHeapObject(ret);
|
|
402
|
+
}
|
|
139
403
|
export function __wbg_new_1f236d63ba0c4784(arg0, arg1) {
|
|
140
404
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
141
405
|
return addHeapObject(ret);
|
|
@@ -148,15 +412,42 @@ export function __wbg_new_7ddec6de44ff8f5d(arg0) {
|
|
|
148
412
|
const ret = new Uint8Array(getObject(arg0));
|
|
149
413
|
return addHeapObject(ret);
|
|
150
414
|
}
|
|
415
|
+
export function __wbg_new_with_length_99887c91eae4abab(arg0) {
|
|
416
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
417
|
+
return addHeapObject(ret);
|
|
418
|
+
}
|
|
419
|
+
export function __wbg_next_2a4e19f4f5083b0f(arg0) {
|
|
420
|
+
const ret = getObject(arg0).next;
|
|
421
|
+
return addHeapObject(ret);
|
|
422
|
+
}
|
|
423
|
+
export function __wbg_next_6429a146bf756f93() { return handleError(function (arg0) {
|
|
424
|
+
const ret = getObject(arg0).next();
|
|
425
|
+
return addHeapObject(ret);
|
|
426
|
+
}, arguments); }
|
|
151
427
|
export function __wbg_prototypesetcall_5f9bdc8d75e07276(arg0, arg1, arg2) {
|
|
152
428
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
153
429
|
}
|
|
430
|
+
export function __wbg_set_24d0fa9e104112f9(arg0, arg1, arg2) {
|
|
431
|
+
getObject(arg0).set(getArrayU8FromWasm0(arg1, arg2));
|
|
432
|
+
}
|
|
154
433
|
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
155
434
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
156
435
|
}
|
|
157
436
|
export function __wbg_set_78ea6a19f4818587(arg0, arg1, arg2) {
|
|
158
437
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
159
438
|
}
|
|
439
|
+
export function __wbg_set_a0e911be3da02782() { return handleError(function (arg0, arg1, arg2) {
|
|
440
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
441
|
+
return ret;
|
|
442
|
+
}, arguments); }
|
|
443
|
+
export function __wbg_set_facb7a5914e0fa39(arg0, arg1, arg2) {
|
|
444
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
445
|
+
return addHeapObject(ret);
|
|
446
|
+
}
|
|
447
|
+
export function __wbg_value_9cc0518af87a489c(arg0) {
|
|
448
|
+
const ret = getObject(arg0).value;
|
|
449
|
+
return addHeapObject(ret);
|
|
450
|
+
}
|
|
160
451
|
export function __wbindgen_cast_0000000000000001(arg0) {
|
|
161
452
|
// Cast intrinsic for `F64 -> Externref`.
|
|
162
453
|
const ret = arg0;
|
|
@@ -286,6 +577,14 @@ function getUint8ArrayMemory0() {
|
|
|
286
577
|
|
|
287
578
|
function getObject(idx) { return heap[idx]; }
|
|
288
579
|
|
|
580
|
+
function handleError(f, args) {
|
|
581
|
+
try {
|
|
582
|
+
return f.apply(this, args);
|
|
583
|
+
} catch (e) {
|
|
584
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
289
588
|
let heap = new Array(1024).fill(undefined);
|
|
290
589
|
heap.push(undefined, null, true, false);
|
|
291
590
|
|
|
Binary file
|