@wasm-fmt/web_fmt 0.1.4-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +28 -0
- package/package.json +44 -0
- package/web_fmt.d.ts +115 -0
- package/web_fmt.js +627 -0
- package/web_fmt_bg.wasm +0 -0
- package/web_fmt_bg.wasm.d.ts +12 -0
- package/web_fmt_node.js +10 -0
- package/web_fmt_vite.js +8 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 wasm-fmt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/@wasm-fmt/web_fmt)
|
|
2
|
+
|
|
3
|
+
# Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @wasm-fmt/web_fmt
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
# Usage
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
import init, { format } from "@wasm-fmt/web_fmt";
|
|
13
|
+
|
|
14
|
+
await init();
|
|
15
|
+
|
|
16
|
+
const input = `function foo() {console.log("Hello, world!")}`;
|
|
17
|
+
|
|
18
|
+
const formatted = format(input, "index.js");
|
|
19
|
+
console.log(formatted);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For Vite users:
|
|
23
|
+
|
|
24
|
+
```JavaScript
|
|
25
|
+
import init, { format } from "@wasm-fmt/web_fmt/vite";
|
|
26
|
+
|
|
27
|
+
// ...
|
|
28
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wasm-fmt/web_fmt",
|
|
3
|
+
"collaborators": [
|
|
4
|
+
"magic-akari <akari.ccino@gmail.com>"
|
|
5
|
+
],
|
|
6
|
+
"description": "a formatter for web development powered by wasm",
|
|
7
|
+
"version": "0.1.4-alpha.2",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/wasm-fmt/web_fmt"
|
|
12
|
+
},
|
|
13
|
+
"module": "web_fmt.js",
|
|
14
|
+
"homepage": "https://github.com/wasm-fmt/web_fmt",
|
|
15
|
+
"types": "web_fmt.d.ts",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"./snippets/*"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"wasm",
|
|
21
|
+
"formatter",
|
|
22
|
+
"html",
|
|
23
|
+
"css",
|
|
24
|
+
"javascript"
|
|
25
|
+
],
|
|
26
|
+
"main": "web_fmt.js",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./web_fmt.d.ts",
|
|
34
|
+
"node": "./web_fmt_node.js",
|
|
35
|
+
"default": "./web_fmt.js"
|
|
36
|
+
},
|
|
37
|
+
"./vite": {
|
|
38
|
+
"types": "./web_fmt.d.ts",
|
|
39
|
+
"default": "./web_fmt_vite.js"
|
|
40
|
+
},
|
|
41
|
+
"./package.json": "./package.json",
|
|
42
|
+
"./*": "./*"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/web_fmt.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {string} src
|
|
5
|
+
* @param {string} filename
|
|
6
|
+
* @param {ScriptConfig | undefined} [config]
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
export function format_script(src: string, filename: string, config?: ScriptConfig): string;
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} src
|
|
12
|
+
* @param {string} filename
|
|
13
|
+
* @param {MarkupConfig | undefined} [config]
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export function format_markup(src: string, filename: string, config?: MarkupConfig): string;
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} src
|
|
19
|
+
* @param {string} filename
|
|
20
|
+
* @param {Config | undefined} [config]
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
export function format(src: string, filename: string, config?: Config): string;
|
|
24
|
+
/**
|
|
25
|
+
* @param {string} src
|
|
26
|
+
* @param {string} filename
|
|
27
|
+
* @param {StyleConfig | undefined} [config]
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
export function format_style(src: string, filename: string, config?: StyleConfig): string;
|
|
31
|
+
|
|
32
|
+
export interface ScriptConfig {
|
|
33
|
+
indent_style?: "tab" | "space";
|
|
34
|
+
indent_width?: number;
|
|
35
|
+
line_ending?: "lf" | "crlf" | "cr";
|
|
36
|
+
line_width?: number;
|
|
37
|
+
quote_style?: "double" | "single";
|
|
38
|
+
jsx_quote_style?: "double" | "single";
|
|
39
|
+
quote_properties?: "preserve" | "as-needed";
|
|
40
|
+
trailing_comma?: "es5" | "all" | "none";
|
|
41
|
+
semicolons?: "always" | "as-needed";
|
|
42
|
+
arrow_parentheses?: "always" | "as-needed";
|
|
43
|
+
bracket_spacing?: boolean;
|
|
44
|
+
bracket_same_line?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export interface MarkupConfig {
|
|
49
|
+
indent_style?: "tab" | "space";
|
|
50
|
+
indent_width?: number;
|
|
51
|
+
line_width?: number;
|
|
52
|
+
/**
|
|
53
|
+
* See {@link https://github.com/g-plane/markup_fmt/blob/main/docs/config.md}
|
|
54
|
+
*/
|
|
55
|
+
[other: string]: any;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export interface StyleConfig {
|
|
60
|
+
indent_style?: "tab" | "space";
|
|
61
|
+
indent_width?: number;
|
|
62
|
+
line_width?: number;
|
|
63
|
+
|
|
64
|
+
markup?: MarkupConfig;
|
|
65
|
+
script?: ScriptConfig;
|
|
66
|
+
style: StyleConfig;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
export interface StyleConfig {
|
|
71
|
+
indent_style?: "tab" | "space";
|
|
72
|
+
indent_width?: number;
|
|
73
|
+
line_width?: number;
|
|
74
|
+
/**
|
|
75
|
+
* See {@link https://github.com/g-plane/malva/blob/main/docs/config.md}
|
|
76
|
+
*/
|
|
77
|
+
[other: string]: any;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
82
|
+
|
|
83
|
+
export interface InitOutput {
|
|
84
|
+
readonly memory: WebAssembly.Memory;
|
|
85
|
+
readonly format_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
86
|
+
readonly format_markup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
87
|
+
readonly format: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
88
|
+
readonly format_style: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
89
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
90
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
91
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
92
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
93
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
97
|
+
/**
|
|
98
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
99
|
+
* a precompiled `WebAssembly.Module`.
|
|
100
|
+
*
|
|
101
|
+
* @param {SyncInitInput} module
|
|
102
|
+
*
|
|
103
|
+
* @returns {InitOutput}
|
|
104
|
+
*/
|
|
105
|
+
export function initSync(module: SyncInitInput): InitOutput;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
109
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
110
|
+
*
|
|
111
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
112
|
+
*
|
|
113
|
+
* @returns {Promise<InitOutput>}
|
|
114
|
+
*/
|
|
115
|
+
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/web_fmt.js
ADDED
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
const heap = new Array(128).fill(undefined);
|
|
4
|
+
|
|
5
|
+
heap.push(undefined, null, true, false);
|
|
6
|
+
|
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
|
8
|
+
|
|
9
|
+
let heap_next = heap.length;
|
|
10
|
+
|
|
11
|
+
function dropObject(idx) {
|
|
12
|
+
if (idx < 132) return;
|
|
13
|
+
heap[idx] = heap_next;
|
|
14
|
+
heap_next = idx;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function takeObject(idx) {
|
|
18
|
+
const ret = getObject(idx);
|
|
19
|
+
dropObject(idx);
|
|
20
|
+
return ret;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isLikeNone(x) {
|
|
24
|
+
return x === undefined || x === null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let cachedFloat64Memory0 = null;
|
|
28
|
+
|
|
29
|
+
function getFloat64Memory0() {
|
|
30
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
31
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
32
|
+
}
|
|
33
|
+
return cachedFloat64Memory0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let cachedInt32Memory0 = null;
|
|
37
|
+
|
|
38
|
+
function getInt32Memory0() {
|
|
39
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
40
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
41
|
+
}
|
|
42
|
+
return cachedInt32Memory0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function addHeapObject(obj) {
|
|
46
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
|
+
const idx = heap_next;
|
|
48
|
+
heap_next = heap[idx];
|
|
49
|
+
|
|
50
|
+
heap[idx] = obj;
|
|
51
|
+
return idx;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let WASM_VECTOR_LEN = 0;
|
|
55
|
+
|
|
56
|
+
let cachedUint8Memory0 = null;
|
|
57
|
+
|
|
58
|
+
function getUint8Memory0() {
|
|
59
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
60
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
61
|
+
}
|
|
62
|
+
return cachedUint8Memory0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
66
|
+
|
|
67
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
68
|
+
? function (arg, view) {
|
|
69
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
70
|
+
}
|
|
71
|
+
: function (arg, view) {
|
|
72
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
73
|
+
view.set(buf);
|
|
74
|
+
return {
|
|
75
|
+
read: arg.length,
|
|
76
|
+
written: buf.length
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
81
|
+
|
|
82
|
+
if (realloc === undefined) {
|
|
83
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
84
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
85
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
86
|
+
WASM_VECTOR_LEN = buf.length;
|
|
87
|
+
return ptr;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let len = arg.length;
|
|
91
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
92
|
+
|
|
93
|
+
const mem = getUint8Memory0();
|
|
94
|
+
|
|
95
|
+
let offset = 0;
|
|
96
|
+
|
|
97
|
+
for (; offset < len; offset++) {
|
|
98
|
+
const code = arg.charCodeAt(offset);
|
|
99
|
+
if (code > 0x7F) break;
|
|
100
|
+
mem[ptr + offset] = code;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (offset !== len) {
|
|
104
|
+
if (offset !== 0) {
|
|
105
|
+
arg = arg.slice(offset);
|
|
106
|
+
}
|
|
107
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
108
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
109
|
+
const ret = encodeString(arg, view);
|
|
110
|
+
|
|
111
|
+
offset += ret.written;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
WASM_VECTOR_LEN = offset;
|
|
115
|
+
return ptr;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
119
|
+
|
|
120
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
121
|
+
|
|
122
|
+
function getStringFromWasm0(ptr, len) {
|
|
123
|
+
ptr = ptr >>> 0;
|
|
124
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let cachedBigInt64Memory0 = null;
|
|
128
|
+
|
|
129
|
+
function getBigInt64Memory0() {
|
|
130
|
+
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
|
|
131
|
+
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
|
|
132
|
+
}
|
|
133
|
+
return cachedBigInt64Memory0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function debugString(val) {
|
|
137
|
+
// primitive types
|
|
138
|
+
const type = typeof val;
|
|
139
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
140
|
+
return `${val}`;
|
|
141
|
+
}
|
|
142
|
+
if (type == 'string') {
|
|
143
|
+
return `"${val}"`;
|
|
144
|
+
}
|
|
145
|
+
if (type == 'symbol') {
|
|
146
|
+
const description = val.description;
|
|
147
|
+
if (description == null) {
|
|
148
|
+
return 'Symbol';
|
|
149
|
+
} else {
|
|
150
|
+
return `Symbol(${description})`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (type == 'function') {
|
|
154
|
+
const name = val.name;
|
|
155
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
156
|
+
return `Function(${name})`;
|
|
157
|
+
} else {
|
|
158
|
+
return 'Function';
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// objects
|
|
162
|
+
if (Array.isArray(val)) {
|
|
163
|
+
const length = val.length;
|
|
164
|
+
let debug = '[';
|
|
165
|
+
if (length > 0) {
|
|
166
|
+
debug += debugString(val[0]);
|
|
167
|
+
}
|
|
168
|
+
for(let i = 1; i < length; i++) {
|
|
169
|
+
debug += ', ' + debugString(val[i]);
|
|
170
|
+
}
|
|
171
|
+
debug += ']';
|
|
172
|
+
return debug;
|
|
173
|
+
}
|
|
174
|
+
// Test for built-in
|
|
175
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
176
|
+
let className;
|
|
177
|
+
if (builtInMatches.length > 1) {
|
|
178
|
+
className = builtInMatches[1];
|
|
179
|
+
} else {
|
|
180
|
+
// Failed to match the standard '[object ClassName]'
|
|
181
|
+
return toString.call(val);
|
|
182
|
+
}
|
|
183
|
+
if (className == 'Object') {
|
|
184
|
+
// we're a user defined class or Object
|
|
185
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
186
|
+
// easier than looping through ownProperties of `val`.
|
|
187
|
+
try {
|
|
188
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
189
|
+
} catch (_) {
|
|
190
|
+
return 'Object';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// errors
|
|
194
|
+
if (val instanceof Error) {
|
|
195
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
196
|
+
}
|
|
197
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
198
|
+
return className;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @param {string} src
|
|
202
|
+
* @param {string} filename
|
|
203
|
+
* @param {ScriptConfig | undefined} [config]
|
|
204
|
+
* @returns {string}
|
|
205
|
+
*/
|
|
206
|
+
export function format_script(src, filename, config) {
|
|
207
|
+
let deferred4_0;
|
|
208
|
+
let deferred4_1;
|
|
209
|
+
try {
|
|
210
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
211
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
212
|
+
const len0 = WASM_VECTOR_LEN;
|
|
213
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
214
|
+
const len1 = WASM_VECTOR_LEN;
|
|
215
|
+
wasm.format_script(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
216
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
217
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
218
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
219
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
220
|
+
var ptr3 = r0;
|
|
221
|
+
var len3 = r1;
|
|
222
|
+
if (r3) {
|
|
223
|
+
ptr3 = 0; len3 = 0;
|
|
224
|
+
throw takeObject(r2);
|
|
225
|
+
}
|
|
226
|
+
deferred4_0 = ptr3;
|
|
227
|
+
deferred4_1 = len3;
|
|
228
|
+
return getStringFromWasm0(ptr3, len3);
|
|
229
|
+
} finally {
|
|
230
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
231
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @param {string} src
|
|
237
|
+
* @param {string} filename
|
|
238
|
+
* @param {MarkupConfig | undefined} [config]
|
|
239
|
+
* @returns {string}
|
|
240
|
+
*/
|
|
241
|
+
export function format_markup(src, filename, config) {
|
|
242
|
+
let deferred4_0;
|
|
243
|
+
let deferred4_1;
|
|
244
|
+
try {
|
|
245
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
246
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
247
|
+
const len0 = WASM_VECTOR_LEN;
|
|
248
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
249
|
+
const len1 = WASM_VECTOR_LEN;
|
|
250
|
+
wasm.format_markup(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
251
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
252
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
253
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
254
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
255
|
+
var ptr3 = r0;
|
|
256
|
+
var len3 = r1;
|
|
257
|
+
if (r3) {
|
|
258
|
+
ptr3 = 0; len3 = 0;
|
|
259
|
+
throw takeObject(r2);
|
|
260
|
+
}
|
|
261
|
+
deferred4_0 = ptr3;
|
|
262
|
+
deferred4_1 = len3;
|
|
263
|
+
return getStringFromWasm0(ptr3, len3);
|
|
264
|
+
} finally {
|
|
265
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
266
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @param {string} src
|
|
272
|
+
* @param {string} filename
|
|
273
|
+
* @param {Config | undefined} [config]
|
|
274
|
+
* @returns {string}
|
|
275
|
+
*/
|
|
276
|
+
export function format(src, filename, config) {
|
|
277
|
+
let deferred4_0;
|
|
278
|
+
let deferred4_1;
|
|
279
|
+
try {
|
|
280
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
281
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
282
|
+
const len0 = WASM_VECTOR_LEN;
|
|
283
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
284
|
+
const len1 = WASM_VECTOR_LEN;
|
|
285
|
+
wasm.format(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
286
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
287
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
288
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
289
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
290
|
+
var ptr3 = r0;
|
|
291
|
+
var len3 = r1;
|
|
292
|
+
if (r3) {
|
|
293
|
+
ptr3 = 0; len3 = 0;
|
|
294
|
+
throw takeObject(r2);
|
|
295
|
+
}
|
|
296
|
+
deferred4_0 = ptr3;
|
|
297
|
+
deferred4_1 = len3;
|
|
298
|
+
return getStringFromWasm0(ptr3, len3);
|
|
299
|
+
} finally {
|
|
300
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
301
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @param {string} src
|
|
307
|
+
* @param {string} filename
|
|
308
|
+
* @param {StyleConfig | undefined} [config]
|
|
309
|
+
* @returns {string}
|
|
310
|
+
*/
|
|
311
|
+
export function format_style(src, filename, config) {
|
|
312
|
+
let deferred4_0;
|
|
313
|
+
let deferred4_1;
|
|
314
|
+
try {
|
|
315
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
316
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
317
|
+
const len0 = WASM_VECTOR_LEN;
|
|
318
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
319
|
+
const len1 = WASM_VECTOR_LEN;
|
|
320
|
+
wasm.format_style(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
321
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
322
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
323
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
324
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
325
|
+
var ptr3 = r0;
|
|
326
|
+
var len3 = r1;
|
|
327
|
+
if (r3) {
|
|
328
|
+
ptr3 = 0; len3 = 0;
|
|
329
|
+
throw takeObject(r2);
|
|
330
|
+
}
|
|
331
|
+
deferred4_0 = ptr3;
|
|
332
|
+
deferred4_1 = len3;
|
|
333
|
+
return getStringFromWasm0(ptr3, len3);
|
|
334
|
+
} finally {
|
|
335
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
336
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function handleError(f, args) {
|
|
341
|
+
try {
|
|
342
|
+
return f.apply(this, args);
|
|
343
|
+
} catch (e) {
|
|
344
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
async function __wbg_load(module, imports) {
|
|
349
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
350
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
351
|
+
try {
|
|
352
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
353
|
+
|
|
354
|
+
} catch (e) {
|
|
355
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
356
|
+
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);
|
|
357
|
+
|
|
358
|
+
} else {
|
|
359
|
+
throw e;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const bytes = await module.arrayBuffer();
|
|
365
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
366
|
+
|
|
367
|
+
} else {
|
|
368
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
369
|
+
|
|
370
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
371
|
+
return { instance, module };
|
|
372
|
+
|
|
373
|
+
} else {
|
|
374
|
+
return instance;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function __wbg_get_imports() {
|
|
380
|
+
const imports = {};
|
|
381
|
+
imports.wbg = {};
|
|
382
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
383
|
+
takeObject(arg0);
|
|
384
|
+
};
|
|
385
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
386
|
+
const ret = getObject(arg0) === undefined;
|
|
387
|
+
return ret;
|
|
388
|
+
};
|
|
389
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
390
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
391
|
+
return ret;
|
|
392
|
+
};
|
|
393
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
394
|
+
const v = getObject(arg0);
|
|
395
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
396
|
+
return ret;
|
|
397
|
+
};
|
|
398
|
+
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
399
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
400
|
+
return ret;
|
|
401
|
+
};
|
|
402
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
403
|
+
const obj = getObject(arg1);
|
|
404
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
405
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
406
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
407
|
+
};
|
|
408
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
409
|
+
const ret = arg0;
|
|
410
|
+
return addHeapObject(ret);
|
|
411
|
+
};
|
|
412
|
+
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
413
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
414
|
+
return ret;
|
|
415
|
+
};
|
|
416
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
417
|
+
const obj = getObject(arg1);
|
|
418
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
419
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
420
|
+
var len1 = WASM_VECTOR_LEN;
|
|
421
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
422
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
423
|
+
};
|
|
424
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
425
|
+
const val = getObject(arg0);
|
|
426
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
427
|
+
return ret;
|
|
428
|
+
};
|
|
429
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
430
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
431
|
+
return addHeapObject(ret);
|
|
432
|
+
};
|
|
433
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
434
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
435
|
+
return ret;
|
|
436
|
+
};
|
|
437
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
438
|
+
const ret = getObject(arg0);
|
|
439
|
+
return addHeapObject(ret);
|
|
440
|
+
};
|
|
441
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
442
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
443
|
+
return addHeapObject(ret);
|
|
444
|
+
};
|
|
445
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
446
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
447
|
+
return addHeapObject(ret);
|
|
448
|
+
};
|
|
449
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
450
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
451
|
+
return ret;
|
|
452
|
+
};
|
|
453
|
+
imports.wbg.__wbg_String_917f38a1211cf44b = function(arg0, arg1) {
|
|
454
|
+
const ret = String(getObject(arg1));
|
|
455
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
456
|
+
const len1 = WASM_VECTOR_LEN;
|
|
457
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
458
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
459
|
+
};
|
|
460
|
+
imports.wbg.__wbg_getwithrefkey_3b3c46ba20582127 = function(arg0, arg1) {
|
|
461
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
462
|
+
return addHeapObject(ret);
|
|
463
|
+
};
|
|
464
|
+
imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
|
|
465
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
466
|
+
return addHeapObject(ret);
|
|
467
|
+
};
|
|
468
|
+
imports.wbg.__wbg_length_fff51ee6522a1a18 = function(arg0) {
|
|
469
|
+
const ret = getObject(arg0).length;
|
|
470
|
+
return ret;
|
|
471
|
+
};
|
|
472
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
473
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
474
|
+
return ret;
|
|
475
|
+
};
|
|
476
|
+
imports.wbg.__wbg_next_526fc47e980da008 = function(arg0) {
|
|
477
|
+
const ret = getObject(arg0).next;
|
|
478
|
+
return addHeapObject(ret);
|
|
479
|
+
};
|
|
480
|
+
imports.wbg.__wbg_next_ddb3312ca1c4e32a = function() { return handleError(function (arg0) {
|
|
481
|
+
const ret = getObject(arg0).next();
|
|
482
|
+
return addHeapObject(ret);
|
|
483
|
+
}, arguments) };
|
|
484
|
+
imports.wbg.__wbg_done_5c1f01fb660d73b5 = function(arg0) {
|
|
485
|
+
const ret = getObject(arg0).done;
|
|
486
|
+
return ret;
|
|
487
|
+
};
|
|
488
|
+
imports.wbg.__wbg_value_1695675138684bd5 = function(arg0) {
|
|
489
|
+
const ret = getObject(arg0).value;
|
|
490
|
+
return addHeapObject(ret);
|
|
491
|
+
};
|
|
492
|
+
imports.wbg.__wbg_iterator_97f0c81209c6c35a = function() {
|
|
493
|
+
const ret = Symbol.iterator;
|
|
494
|
+
return addHeapObject(ret);
|
|
495
|
+
};
|
|
496
|
+
imports.wbg.__wbg_get_97b561fb56f034b5 = function() { return handleError(function (arg0, arg1) {
|
|
497
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
498
|
+
return addHeapObject(ret);
|
|
499
|
+
}, arguments) };
|
|
500
|
+
imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
|
|
501
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
502
|
+
return addHeapObject(ret);
|
|
503
|
+
}, arguments) };
|
|
504
|
+
imports.wbg.__wbg_isArray_4c24b343cb13cfb1 = function(arg0) {
|
|
505
|
+
const ret = Array.isArray(getObject(arg0));
|
|
506
|
+
return ret;
|
|
507
|
+
};
|
|
508
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function(arg0) {
|
|
509
|
+
let result;
|
|
510
|
+
try {
|
|
511
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
512
|
+
} catch (_) {
|
|
513
|
+
result = false;
|
|
514
|
+
}
|
|
515
|
+
const ret = result;
|
|
516
|
+
return ret;
|
|
517
|
+
};
|
|
518
|
+
imports.wbg.__wbg_isSafeInteger_bb8e18dd21c97288 = function(arg0) {
|
|
519
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
520
|
+
return ret;
|
|
521
|
+
};
|
|
522
|
+
imports.wbg.__wbg_entries_e51f29c7bba0c054 = function(arg0) {
|
|
523
|
+
const ret = Object.entries(getObject(arg0));
|
|
524
|
+
return addHeapObject(ret);
|
|
525
|
+
};
|
|
526
|
+
imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
|
|
527
|
+
const ret = getObject(arg0).buffer;
|
|
528
|
+
return addHeapObject(ret);
|
|
529
|
+
};
|
|
530
|
+
imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
|
|
531
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
532
|
+
return addHeapObject(ret);
|
|
533
|
+
};
|
|
534
|
+
imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
|
|
535
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
536
|
+
};
|
|
537
|
+
imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
|
|
538
|
+
const ret = getObject(arg0).length;
|
|
539
|
+
return ret;
|
|
540
|
+
};
|
|
541
|
+
imports.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4 = function(arg0) {
|
|
542
|
+
let result;
|
|
543
|
+
try {
|
|
544
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
545
|
+
} catch (_) {
|
|
546
|
+
result = false;
|
|
547
|
+
}
|
|
548
|
+
const ret = result;
|
|
549
|
+
return ret;
|
|
550
|
+
};
|
|
551
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
552
|
+
const v = getObject(arg1);
|
|
553
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
554
|
+
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
|
|
555
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
556
|
+
};
|
|
557
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
558
|
+
const ret = debugString(getObject(arg1));
|
|
559
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
|
+
const len1 = WASM_VECTOR_LEN;
|
|
561
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
562
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
563
|
+
};
|
|
564
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
565
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
566
|
+
};
|
|
567
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
568
|
+
const ret = wasm.memory;
|
|
569
|
+
return addHeapObject(ret);
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
return imports;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
576
|
+
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function __wbg_finalize_init(instance, module) {
|
|
580
|
+
wasm = instance.exports;
|
|
581
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
582
|
+
cachedBigInt64Memory0 = null;
|
|
583
|
+
cachedFloat64Memory0 = null;
|
|
584
|
+
cachedInt32Memory0 = null;
|
|
585
|
+
cachedUint8Memory0 = null;
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
return wasm;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function initSync(module) {
|
|
592
|
+
if (wasm !== undefined) return wasm;
|
|
593
|
+
|
|
594
|
+
const imports = __wbg_get_imports();
|
|
595
|
+
|
|
596
|
+
__wbg_init_memory(imports);
|
|
597
|
+
|
|
598
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
599
|
+
module = new WebAssembly.Module(module);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
603
|
+
|
|
604
|
+
return __wbg_finalize_init(instance, module);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
async function __wbg_init(input) {
|
|
608
|
+
if (wasm !== undefined) return wasm;
|
|
609
|
+
|
|
610
|
+
if (typeof input === 'undefined') {
|
|
611
|
+
input = new URL('web_fmt_bg.wasm', import.meta.url);
|
|
612
|
+
}
|
|
613
|
+
const imports = __wbg_get_imports();
|
|
614
|
+
|
|
615
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
616
|
+
input = fetch(input);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
__wbg_init_memory(imports);
|
|
620
|
+
|
|
621
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
622
|
+
|
|
623
|
+
return __wbg_finalize_init(instance, module);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export { initSync }
|
|
627
|
+
export default __wbg_init;
|
package/web_fmt_bg.wasm
ADDED
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function format_script(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
5
|
+
export function format_markup(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
6
|
+
export function format(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
7
|
+
export function format_style(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
8
|
+
export function __wbindgen_malloc(a: number, b: number): number;
|
|
9
|
+
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
|
|
10
|
+
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
11
|
+
export function __wbindgen_free(a: number, b: number, c: number): void;
|
|
12
|
+
export function __wbindgen_exn_store(a: number): void;
|
package/web_fmt_node.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import initAsync from "./web_fmt.js";
|
|
3
|
+
|
|
4
|
+
const wasm = new URL("./web_fmt_bg.wasm", import.meta.url);
|
|
5
|
+
|
|
6
|
+
export default function __wbg_init(init = fs.readFile(wasm)) {
|
|
7
|
+
return initAsync(init);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export * from "./web_fmt.js";
|