mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
deps: update amaro to 1.3.0
PR-URL: https://github.com/nodejs/node/pull/66144 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
1 parent
1b070ffad6
commit
830948153c
20 files changed
+1731
-646
No files matched your search
Vendored
+18
-6
@@ -1,12 +1,26 @@
|
||||
# Amaro
|
||||
|
||||
Amaro is a wrapper around `@swc/wasm-typescript`, a WebAssembly port of the SWC TypeScript parser.
|
||||
Amaro is a Node.js wrapper around the [SWC](https://swc.rs) TypeScript parser and type stripper. Its Rust core in `crates/amaro` depends on the published SWC crates and is compiled to WebAssembly.
|
||||
It's used as an internal in Node.js for [Type Stripping](https://nodejs.org/api/typescript.html#type-stripping) but can also be used as a standalone package.
|
||||
|
||||
> Amaro means "bitter" in Italian. It's a reference to [Mount Amaro](https://en.wikipedia.org/wiki/Monte_Amaro_(Abruzzo)) on whose slopes this package was conceived.
|
||||
|
||||
This package provides a stable API for the TypeScript parser and allows users to upgrade to the latest version of TypeScript transpiler independently from the one used internally in Node.js.
|
||||
|
||||
## Building from source
|
||||
|
||||
The WebAssembly module is not checked in. Building it requires Docker, which
|
||||
runs the Rust build inside the [Node.js wasm-builder](https://github.com/nodejs/wasm-builder)
|
||||
container:
|
||||
|
||||
```bash
|
||||
npm run build:wasm
|
||||
npm run build
|
||||
npm test
|
||||
```
|
||||
|
||||
Releases build the module in CI before publishing.
|
||||
|
||||
## How to Install
|
||||
|
||||
To install Amaro, run:
|
||||
@@ -47,15 +61,13 @@ node --enable-source-maps --import="amaro/transform" file.ts
|
||||
> Note that the `amaro/transform` loader should be used with `--enable-source-maps`
|
||||
> to preserve accurate source-mapped stack traces.
|
||||
|
||||
#### Programmatic registration with `module.register()`
|
||||
#### Programmatic registration with `module.registerHooks()`
|
||||
|
||||
If you want TypeScript to "just work" in an existing codebase without passing `--import` every time, create a small bootstrap file and register Amaro once before loading your TS entrypoint.
|
||||
Amaro's `strip` and `transform` entry points use `module.registerHooks()` to register synchronous hooks on Node.js versions that provide it, and fall back to `module.register()` on older versions. If you want TypeScript to "just work" in an existing codebase without passing `--import` every time, create a small bootstrap file that imports Amaro before loading your TS entrypoint.
|
||||
|
||||
```mjs
|
||||
// bootstrap.mjs
|
||||
import { register } from "node:module";
|
||||
|
||||
register("amaro/strip", import.meta.url);
|
||||
import "amaro/strip";
|
||||
await import("./src/index.ts");
|
||||
```
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -198,4 +198,4 @@ Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
limitations under the License.
|
||||
Vendored
+30
-2
@@ -1,8 +1,31 @@
|
||||
"use strict";
|
||||
export function isSwcError(error) {
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var errors_exports = {};
|
||||
__export(errors_exports, {
|
||||
isSwcError: () => isSwcError,
|
||||
wrapAndReThrowSwcError: () => wrapAndReThrowSwcError
|
||||
});
|
||||
module.exports = __toCommonJS(errors_exports);
|
||||
function isSwcError(error) {
|
||||
return error.code !== void 0;
|
||||
}
|
||||
export function wrapAndReThrowSwcError(error) {
|
||||
function wrapAndReThrowSwcError(error) {
|
||||
const errorHints = `${error.filename}:${error.startLine}
|
||||
${error.snippet}
|
||||
`;
|
||||
@@ -22,3 +45,8 @@ ${error.snippet}
|
||||
throw new Error(error.message);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
isSwcError,
|
||||
wrapAndReThrowSwcError
|
||||
});
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
export { transformSync } from "./transform.ts";
|
||||
export { transformSync } from "./internal.js";
|
||||
Vendored
+2
-560
@@ -1,13 +1,8 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
@@ -20,566 +15,13 @@ var __copyProps = (to, from, except, desc) => {
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// lib/wasm.js
|
||||
var require_wasm = __commonJS({
|
||||
"lib/wasm.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var imports = {};
|
||||
imports["__wbindgen_placeholder__"] = module2.exports;
|
||||
var wasm;
|
||||
var { TextDecoder, TextEncoder } = require("util");
|
||||
var heap = new Array(128).fill(void 0);
|
||||
heap.push(void 0, null, true, false);
|
||||
function getObject(idx) {
|
||||
return heap[idx];
|
||||
}
|
||||
var heap_next = heap.length;
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
heap_next = heap[idx];
|
||||
heap[idx] = obj;
|
||||
return idx;
|
||||
}
|
||||
function handleError(f, args) {
|
||||
try {
|
||||
return f.apply(this, args);
|
||||
} catch (e) {
|
||||
wasm.__wbindgen_export_0(addHeapObject(e));
|
||||
}
|
||||
}
|
||||
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
||||
cachedTextDecoder.decode();
|
||||
var cachedUint8ArrayMemory0 = null;
|
||||
function getUint8ArrayMemory0() {
|
||||
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
||||
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachedUint8ArrayMemory0;
|
||||
}
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
ptr = ptr >>> 0;
|
||||
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
function getCachedStringFromWasm0(ptr, len) {
|
||||
if (ptr === 0) {
|
||||
return getObject(len);
|
||||
} else {
|
||||
return getStringFromWasm0(ptr, len);
|
||||
}
|
||||
}
|
||||
function dropObject(idx) {
|
||||
if (idx < 132) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
function isLikeNone(x) {
|
||||
return x === void 0 || x === null;
|
||||
}
|
||||
var cachedDataViewMemory0 = null;
|
||||
function getDataViewMemory0() {
|
||||
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
||||
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
||||
}
|
||||
return cachedDataViewMemory0;
|
||||
}
|
||||
var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
||||
}, unregister: () => {
|
||||
} } : new FinalizationRegistry((state) => {
|
||||
wasm.__wbindgen_export_1.get(state.dtor)(state.a, state.b);
|
||||
});
|
||||
function makeMutClosure(arg0, arg1, dtor, f) {
|
||||
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
||||
const real = (...args) => {
|
||||
state.cnt++;
|
||||
const a = state.a;
|
||||
state.a = 0;
|
||||
try {
|
||||
return f(a, state.b, ...args);
|
||||
} finally {
|
||||
if (--state.cnt === 0) {
|
||||
wasm.__wbindgen_export_1.get(state.dtor)(a, state.b);
|
||||
CLOSURE_DTORS.unregister(state);
|
||||
} else {
|
||||
state.a = a;
|
||||
}
|
||||
}
|
||||
};
|
||||
real.original = state;
|
||||
CLOSURE_DTORS.register(real, state, state);
|
||||
return real;
|
||||
}
|
||||
function debugString(val) {
|
||||
const type = typeof val;
|
||||
if (type == "number" || type == "boolean" || val == null) {
|
||||
return `${val}`;
|
||||
}
|
||||
if (type == "string") {
|
||||
return `"${val}"`;
|
||||
}
|
||||
if (type == "symbol") {
|
||||
const description = val.description;
|
||||
if (description == null) {
|
||||
return "Symbol";
|
||||
} else {
|
||||
return `Symbol(${description})`;
|
||||
}
|
||||
}
|
||||
if (type == "function") {
|
||||
const name = val.name;
|
||||
if (typeof name == "string" && name.length > 0) {
|
||||
return `Function(${name})`;
|
||||
} else {
|
||||
return "Function";
|
||||
}
|
||||
}
|
||||
if (Array.isArray(val)) {
|
||||
const length = val.length;
|
||||
let debug = "[";
|
||||
if (length > 0) {
|
||||
debug += debugString(val[0]);
|
||||
}
|
||||
for (let i = 1; i < length; i++) {
|
||||
debug += ", " + debugString(val[i]);
|
||||
}
|
||||
debug += "]";
|
||||
return debug;
|
||||
}
|
||||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
||||
let className;
|
||||
if (builtInMatches && builtInMatches.length > 1) {
|
||||
className = builtInMatches[1];
|
||||
} else {
|
||||
return toString.call(val);
|
||||
}
|
||||
if (className == "Object") {
|
||||
try {
|
||||
return "Object(" + JSON.stringify(val) + ")";
|
||||
} catch (_) {
|
||||
return "Object";
|
||||
}
|
||||
}
|
||||
if (val instanceof Error) {
|
||||
return `${val.name}: ${val.message}
|
||||
${val.stack}`;
|
||||
}
|
||||
return className;
|
||||
}
|
||||
var WASM_VECTOR_LEN = 0;
|
||||
var cachedTextEncoder = new TextEncoder("utf-8");
|
||||
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
||||
return cachedTextEncoder.encodeInto(arg, view);
|
||||
} : function(arg, view) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
view.set(buf);
|
||||
return {
|
||||
read: arg.length,
|
||||
written: buf.length
|
||||
};
|
||||
};
|
||||
function passStringToWasm0(arg, malloc, realloc) {
|
||||
if (realloc === void 0) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr2 = malloc(buf.length, 1) >>> 0;
|
||||
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr2;
|
||||
}
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len, 1) >>> 0;
|
||||
const mem = getUint8ArrayMemory0();
|
||||
let offset = 0;
|
||||
for (; offset < len; offset++) {
|
||||
const code = arg.charCodeAt(offset);
|
||||
if (code > 127) break;
|
||||
mem[ptr + offset] = code;
|
||||
}
|
||||
if (offset !== len) {
|
||||
if (offset !== 0) {
|
||||
arg = arg.slice(offset);
|
||||
}
|
||||
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
||||
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
offset += ret.written;
|
||||
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
||||
}
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
module2.exports.transform = function(input, options) {
|
||||
const ret = wasm.transform(addHeapObject(input), addHeapObject(options));
|
||||
return takeObject(ret);
|
||||
};
|
||||
module2.exports.transformSync = function(input, options) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.transformSync(retptr, addHeapObject(input), addHeapObject(options));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
function __wbg_adapter_50(arg0, arg1, arg2) {
|
||||
wasm.__wbindgen_export_4(arg0, arg1, addHeapObject(arg2));
|
||||
}
|
||||
function __wbg_adapter_79(arg0, arg1, arg2, arg3) {
|
||||
wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
||||
}
|
||||
module2.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
||||
const ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_call_672a4d21634d4a24 = function() {
|
||||
return handleError(function(arg0, arg1) {
|
||||
const ret = getObject(arg0).call(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_call_7cccdd69e0791ae2 = function() {
|
||||
return handleError(function(arg0, arg1, arg2) {
|
||||
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
||||
const ret = getObject(arg0).done;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
|
||||
const ret = Object.entries(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_get_67b2ba62fc30de12 = function() {
|
||||
return handleError(function(arg0, arg1) {
|
||||
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
||||
const ret = getObject(arg0)[arg1 >>> 0];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
||||
const ret = getObject(arg0)[getObject(arg1)];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof ArrayBuffer;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Map;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Uint8Array;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
||||
const ret = Array.isArray(getObject(arg0));
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
||||
const ret = Number.isSafeInteger(getObject(arg0));
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
||||
const ret = Symbol.iterator;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
||||
try {
|
||||
var state0 = { a: arg0, b: arg1 };
|
||||
var cb0 = (arg02, arg12) => {
|
||||
const a = state0.a;
|
||||
state0.a = 0;
|
||||
try {
|
||||
return __wbg_adapter_79(a, state0.b, arg02, arg12);
|
||||
} finally {
|
||||
state0.a = a;
|
||||
}
|
||||
};
|
||||
const ret = new Promise(cb0);
|
||||
return addHeapObject(ret);
|
||||
} finally {
|
||||
state0.a = state0.b = 0;
|
||||
}
|
||||
};
|
||||
module2.exports.__wbg_new_405e22f390576ce2 = function() {
|
||||
const ret = new Object();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_new_78feb108b6472713 = function() {
|
||||
const ret = new Array();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
||||
const ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
||||
var v0 = getCachedStringFromWasm0(arg0, arg1);
|
||||
const ret = new Function(v0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
||||
const ret = getObject(arg0).next;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_next_6574e1a8a62d1055 = function() {
|
||||
return handleError(function(arg0) {
|
||||
const ret = getObject(arg0).next();
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
||||
queueMicrotask(getObject(arg0));
|
||||
};
|
||||
module2.exports.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
||||
const ret = getObject(arg0).queueMicrotask;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
||||
const ret = Promise.resolve(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
||||
};
|
||||
module2.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
||||
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
||||
};
|
||||
module2.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
||||
const ret = typeof global === "undefined" ? null : global;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
||||
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
||||
const ret = typeof self === "undefined" ? null : self;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
||||
const ret = typeof window === "undefined" ? null : window;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
||||
const ret = getObject(arg0).then(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_toString_5285597960676b7b = function(arg0) {
|
||||
const ret = getObject(arg0).toString();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
||||
const ret = getObject(arg0).value;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_bigint_from_i64 = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
||||
const ret = BigInt.asUintN(64, arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
||||
const v = getObject(arg1);
|
||||
const ret = typeof v === "bigint" ? v : void 0;
|
||||
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||
};
|
||||
module2.exports.__wbindgen_boolean_get = function(arg0) {
|
||||
const v = getObject(arg0);
|
||||
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_cb_drop = function(arg0) {
|
||||
const obj = takeObject(arg0).original;
|
||||
if (obj.cnt-- == 1) {
|
||||
obj.a = 0;
|
||||
return true;
|
||||
}
|
||||
const ret = false;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_closure_wrapper5465 = function(arg0, arg1, arg2) {
|
||||
const ret = makeMutClosure(arg0, arg1, 900, __wbg_adapter_50);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
||||
const ret = debugString(getObject(arg1));
|
||||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||
};
|
||||
module2.exports.__wbindgen_error_new = function(arg0, arg1) {
|
||||
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_in = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) in getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_bigint = function(arg0) {
|
||||
const ret = typeof getObject(arg0) === "bigint";
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_falsy = function(arg0) {
|
||||
const ret = !getObject(arg0);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_function = function(arg0) {
|
||||
const ret = typeof getObject(arg0) === "function";
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_object = function(arg0) {
|
||||
const val = getObject(arg0);
|
||||
const ret = typeof val === "object" && val !== null;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_string = function(arg0) {
|
||||
const ret = typeof getObject(arg0) === "string";
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_undefined = function(arg0) {
|
||||
const ret = getObject(arg0) === void 0;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) === getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) == getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_memory = function() {
|
||||
const ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_number_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = typeof obj === "number" ? obj : void 0;
|
||||
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||
};
|
||||
module2.exports.__wbindgen_number_new = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_object_clone_ref = function(arg0) {
|
||||
const ret = getObject(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
module2.exports.__wbindgen_string_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = typeof obj === "string" ? obj : void 0;
|
||||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
|
||||
var len1 = WASM_VECTOR_LEN;
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||
};
|
||||
module2.exports.__wbindgen_string_new = function(arg0, arg1) {
|
||||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
var { Buffer: Buffer2 } = require("node:buffer");
|
||||
var bytes = Buffer2.from("AGFzbQEAAAAB+wRQYAAAYAABf2AAAX5gAX8AYAF/AX9gAX8BfmABfwF8YAJ/fwBgAn9/AX9gAn9/AX5gAn9/AXxgA39/fwBgA39/fwF/YAN/f38BfmAEf39/fwBgBH9/f38Bf2AEf39/fwF+YAV/f39/fwBgBX9/f39/AX9gBn9/f39/fwBgBn9/f39/fwF/YAd/f39/f39/AGAHf39/f39/fwF/YAh/f39/f39/fwBgCH9/f39/f39/AX9gC39/f39/f39/f39/AX9gDX9/f39/f39/f39/f38AYA5/f39/f39/f39/f39/fwF/YA9/f39/f39/f39/f39/f38Bf2ATf39/f39/f39/f39/f39/f39/fwF/YBd/f39/f39/f39/f39/f39/f39/f39/fwF/YAl/f39/f39+fn4AYAV/f39/fgBgBn9/f39+fwBgBH9/f34AYAZ/f39+f38AYAN/f34Bf2AEf39+fwBgBH9/fn8Bf2AFf39+f38AYAZ/f35/fn8AYAV/f31/fwBgBX9/fH9/AGACf34AYAJ/fgF/YAN/fn8AYAN/fn8Bf2AEf35/fwBgBH9+f34BfmADf35+AGAEf35+fwBgBX9+fn5/AGAFf35+fn4AYAR/fX9/AGACf3wAYAN/fH8AYAN/fH8Bf2AEf3x/fwBgBH98f38Bf2ABfgBgAX4Bf2ABfgF+YAJ+fwBgAn5/AX5gA35/fwF/YAN+f34BfmAEfn9+fwF/YAJ+fgBgAn5+AX9gAn5+AX5gA35+fwBgBH5+f38BfmAEfn5+fwF+YAd+fn5/f39/AX5gAXwBf2ABfAF8YAJ8fwF/YAJ8fwF8YAJ8fAF8YAN8fHwBfALLGj0YX193YmluZGdlbl9wbGFjZWhvbGRlcl9fFF9fd2JpbmRnZW5fZXJyb3JfbmV3AAgYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fFF9fd2JpbmRnZW5faXNfYmlnaW50AAQYX193YmluZGdlbl9wbGFjZWhvbGRlcl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zY1NzRlMWE4YTYyZDEwNTUABBhfX3diaW5kZ2VuX3BsYWNlaG9sZGVyX18bX193YmdfZG9uZV83NjllNWVkZTRiMzFjNjdiAAQYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fHF9fd2JnX3ZhbHVlX2NkMWZmYTdiMWFiNzk0ZjEABBhfX3diaW5kZ2VuX3BsYWNlaG9sZGVyX18sX193YmdfaW5zdGFuY2VvZl9VaW50OEFycmF5XzE3MTU2YmNmMTE4MDg2YTkABBhfX3diaW5kZ2VuX3BsYWNlaG9sZGVyX18ZX193YmluZGdlbl9qc3ZhbF9sb29zZV9lcQAIGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXy1fX3diZ19pbnN0YW5jZW9mX0FycmF5QnVmZmVyX2UxNDU4NTQzMmUzNzM3ZmMABBhfX3diaW5kZ2VuX3BsYWNlaG9sZGVyX18eX193YmdfZW50cmllc18zMjY1ZDQxNThiMzNlNWRjAAQYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fEF9fd2JpbmRnZW5fdGhyb3cABxhfX3diaW5kZ2VuX3BsYWNlaG9sZGVyX18cX193YmluZGdlbl9iaWdpbnRfZ2V0X2FzX2k2NAAHGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXxdfX3diaW5kZ2VuX2RlYnVnX3N0cmluZwAHGF9fd2JpbmRnZW5fcGxhY2Vob2xkZLine truncated
|
||||
var wasmModule = new WebAssembly.Module(bytes);
|
||||
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
wasm = wasmInstance.exports;
|
||||
module2.exports.__wasm = wasm;
|
||||
}
|
||||
});
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
transformSync: () => transformSync
|
||||
transformSync: () => import_internal.transformSync
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// src/transform.ts
|
||||
var import_wasm = __toESM(require_wasm());
|
||||
var DEFAULT_OPTIONS = {
|
||||
mode: "strip-only",
|
||||
deprecatedTsModuleAsError: true,
|
||||
// default transform will only work when mode is "transform"
|
||||
transform: {
|
||||
verbatimModuleSyntax: true,
|
||||
nativeClassProperties: true,
|
||||
noEmptyExport: true,
|
||||
importNotUsedAsValues: "preserve"
|
||||
}
|
||||
};
|
||||
function transformSync(source, options) {
|
||||
const input = `${source ?? ""}`;
|
||||
return import_wasm.default.transformSync(input, {
|
||||
...DEFAULT_OPTIONS,
|
||||
...options
|
||||
});
|
||||
}
|
||||
var import_internal = require("./internal.js");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
transformSync
|
||||
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
import type { ModuleSyntaxTransformOutput, Options, Token, TokenKind, TopLevelAwaitLocation, TransformOutput } from "../lib/wasm";
|
||||
export type { Token, TokenKind, TopLevelAwaitLocation };
|
||||
export declare function transformSync(source: string, options?: Options): TransformOutput;
|
||||
export declare function transformModuleSyntax(source: string): ModuleSyntaxTransformOutput;
|
||||
export declare function getFirstExpression(source: string, startColumn: number): string;
|
||||
export declare function isValidSyntax(source: string): boolean;
|
||||
export declare function isRecoverableError(source: string): boolean;
|
||||
export declare function tokenize(source: string): Token[];
|
||||
export declare function findTopLevelAwaits(source: string): TopLevelAwaitLocation[];
|
||||
Vendored
+706
@@ -0,0 +1,706 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// lib/wasm.js
|
||||
var require_wasm = __commonJS({
|
||||
"lib/wasm.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var imports = {};
|
||||
imports["__wbindgen_placeholder__"] = module2.exports;
|
||||
var wasm;
|
||||
var { TextDecoder, TextEncoder } = require("util");
|
||||
var heap = new Array(128).fill(void 0);
|
||||
heap.push(void 0, null, true, false);
|
||||
function getObject(idx) {
|
||||
return heap[idx];
|
||||
}
|
||||
var heap_next = heap.length;
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
heap_next = heap[idx];
|
||||
heap[idx] = obj;
|
||||
return idx;
|
||||
}
|
||||
function handleError(f, args) {
|
||||
try {
|
||||
return f.apply(this, args);
|
||||
} catch (e) {
|
||||
wasm.__wbindgen_export_0(addHeapObject(e));
|
||||
}
|
||||
}
|
||||
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
||||
cachedTextDecoder.decode();
|
||||
var cachedUint8ArrayMemory0 = null;
|
||||
function getUint8ArrayMemory0() {
|
||||
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
||||
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachedUint8ArrayMemory0;
|
||||
}
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
ptr = ptr >>> 0;
|
||||
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
function getCachedStringFromWasm0(ptr, len) {
|
||||
if (ptr === 0) {
|
||||
return getObject(len);
|
||||
} else {
|
||||
return getStringFromWasm0(ptr, len);
|
||||
}
|
||||
}
|
||||
function dropObject(idx) {
|
||||
if (idx < 132) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
function isLikeNone(x) {
|
||||
return x === void 0 || x === null;
|
||||
}
|
||||
var cachedDataViewMemory0 = null;
|
||||
function getDataViewMemory0() {
|
||||
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
||||
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
||||
}
|
||||
return cachedDataViewMemory0;
|
||||
}
|
||||
var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
||||
}, unregister: () => {
|
||||
} } : new FinalizationRegistry((state) => {
|
||||
wasm.__wbindgen_export_1.get(state.dtor)(state.a, state.b);
|
||||
});
|
||||
function makeMutClosure(arg0, arg1, dtor, f) {
|
||||
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
||||
const real = (...args) => {
|
||||
state.cnt++;
|
||||
const a = state.a;
|
||||
state.a = 0;
|
||||
try {
|
||||
return f(a, state.b, ...args);
|
||||
} finally {
|
||||
if (--state.cnt === 0) {
|
||||
wasm.__wbindgen_export_1.get(state.dtor)(a, state.b);
|
||||
CLOSURE_DTORS.unregister(state);
|
||||
} else {
|
||||
state.a = a;
|
||||
}
|
||||
}
|
||||
};
|
||||
real.original = state;
|
||||
CLOSURE_DTORS.register(real, state, state);
|
||||
return real;
|
||||
}
|
||||
function debugString(val) {
|
||||
const type = typeof val;
|
||||
if (type == "number" || type == "boolean" || val == null) {
|
||||
return `${val}`;
|
||||
}
|
||||
if (type == "string") {
|
||||
return `"${val}"`;
|
||||
}
|
||||
if (type == "symbol") {
|
||||
const description = val.description;
|
||||
if (description == null) {
|
||||
return "Symbol";
|
||||
} else {
|
||||
return `Symbol(${description})`;
|
||||
}
|
||||
}
|
||||
if (type == "function") {
|
||||
const name = val.name;
|
||||
if (typeof name == "string" && name.length > 0) {
|
||||
return `Function(${name})`;
|
||||
} else {
|
||||
return "Function";
|
||||
}
|
||||
}
|
||||
if (Array.isArray(val)) {
|
||||
const length = val.length;
|
||||
let debug = "[";
|
||||
if (length > 0) {
|
||||
debug += debugString(val[0]);
|
||||
}
|
||||
for (let i = 1; i < length; i++) {
|
||||
debug += ", " + debugString(val[i]);
|
||||
}
|
||||
debug += "]";
|
||||
return debug;
|
||||
}
|
||||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
||||
let className;
|
||||
if (builtInMatches && builtInMatches.length > 1) {
|
||||
className = builtInMatches[1];
|
||||
} else {
|
||||
return toString.call(val);
|
||||
}
|
||||
if (className == "Object") {
|
||||
try {
|
||||
return "Object(" + JSON.stringify(val) + ")";
|
||||
} catch (_) {
|
||||
return "Object";
|
||||
}
|
||||
}
|
||||
if (val instanceof Error) {
|
||||
return `${val.name}: ${val.message}
|
||||
${val.stack}`;
|
||||
}
|
||||
return className;
|
||||
}
|
||||
var WASM_VECTOR_LEN = 0;
|
||||
var cachedTextEncoder = new TextEncoder("utf-8");
|
||||
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
||||
return cachedTextEncoder.encodeInto(arg, view);
|
||||
} : function(arg, view) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
view.set(buf);
|
||||
return {
|
||||
read: arg.length,
|
||||
written: buf.length
|
||||
};
|
||||
};
|
||||
function passStringToWasm0(arg, malloc, realloc) {
|
||||
if (realloc === void 0) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr2 = malloc(buf.length, 1) >>> 0;
|
||||
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr2;
|
||||
}
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len, 1) >>> 0;
|
||||
const mem = getUint8ArrayMemory0();
|
||||
let offset = 0;
|
||||
for (; offset < len; offset++) {
|
||||
const code = arg.charCodeAt(offset);
|
||||
if (code > 127) break;
|
||||
mem[ptr + offset] = code;
|
||||
}
|
||||
if (offset !== len) {
|
||||
if (offset !== 0) {
|
||||
arg = arg.slice(offset);
|
||||
}
|
||||
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
||||
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
offset += ret.written;
|
||||
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
||||
}
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
module2.exports.transform = function(input, options) {
|
||||
const ret = wasm.transform(addHeapObject(input), addHeapObject(options));
|
||||
return takeObject(ret);
|
||||
};
|
||||
module2.exports.transformSync = function(input, options) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.transformSync(retptr, addHeapObject(input), addHeapObject(options));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
module2.exports.transformModuleSyntax = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.transformModuleSyntax(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
module2.exports.getFirstExpression = function(input, start_column) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.getFirstExpression(retptr, addHeapObject(input), start_column);
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
||||
if (r3) {
|
||||
throw takeObject(r2);
|
||||
}
|
||||
var v1 = getCachedStringFromWasm0(r0, r1);
|
||||
if (r0 !== 0) {
|
||||
wasm.__wbindgen_export_4(r0, r1, 1);
|
||||
}
|
||||
return v1;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
module2.exports.isValidSyntax = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.isValidSyntax(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return r0 !== 0;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
module2.exports.isRecoverableError = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.isRecoverableError(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return r0 !== 0;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
module2.exports.tokenize = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.tokenize(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
module2.exports.findTopLevelAwaits = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.findTopLevelAwaits(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
function __wbg_adapter_50(arg0, arg1, arg2) {
|
||||
wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
|
||||
}
|
||||
function __wbg_adapter_83(arg0, arg1, arg2, arg3) {
|
||||
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
||||
}
|
||||
module2.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
||||
const ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_call_672a4d21634d4a24 = function() {
|
||||
return handleError(function(arg0, arg1) {
|
||||
const ret = getObject(arg0).call(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_call_7cccdd69e0791ae2 = function() {
|
||||
return handleError(function(arg0, arg1, arg2) {
|
||||
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
||||
const ret = getObject(arg0).done;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
|
||||
const ret = Object.entries(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_get_67b2ba62fc30de12 = function() {
|
||||
return handleError(function(arg0, arg1) {
|
||||
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
||||
const ret = getObject(arg0)[arg1 >>> 0];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
||||
const ret = getObject(arg0)[getObject(arg1)];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof ArrayBuffer;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Map;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Uint8Array;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
||||
const ret = Array.isArray(getObject(arg0));
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
||||
const ret = Number.isSafeInteger(getObject(arg0));
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
||||
const ret = Symbol.iterator;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
||||
try {
|
||||
var state0 = { a: arg0, b: arg1 };
|
||||
var cb0 = (arg02, arg12) => {
|
||||
const a = state0.a;
|
||||
state0.a = 0;
|
||||
try {
|
||||
return __wbg_adapter_83(a, state0.b, arg02, arg12);
|
||||
} finally {
|
||||
state0.a = a;
|
||||
}
|
||||
};
|
||||
const ret = new Promise(cb0);
|
||||
return addHeapObject(ret);
|
||||
} finally {
|
||||
state0.a = state0.b = 0;
|
||||
}
|
||||
};
|
||||
module2.exports.__wbg_new_405e22f390576ce2 = function() {
|
||||
const ret = new Object();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_new_78feb108b6472713 = function() {
|
||||
const ret = new Array();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
||||
const ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
||||
var v0 = getCachedStringFromWasm0(arg0, arg1);
|
||||
const ret = new Function(v0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
||||
const ret = getObject(arg0).next;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_next_6574e1a8a62d1055 = function() {
|
||||
return handleError(function(arg0) {
|
||||
const ret = getObject(arg0).next();
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
module2.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
||||
queueMicrotask(getObject(arg0));
|
||||
};
|
||||
module2.exports.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
||||
const ret = getObject(arg0).queueMicrotask;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
||||
const ret = Promise.resolve(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
||||
};
|
||||
module2.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
||||
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
||||
};
|
||||
module2.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
||||
const ret = typeof global === "undefined" ? null : global;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
||||
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
||||
const ret = typeof self === "undefined" ? null : self;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
||||
const ret = typeof window === "undefined" ? null : window;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
||||
const ret = getObject(arg0).then(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
||||
const ret = getObject(arg0).value;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_bigint_from_i64 = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
||||
const ret = BigInt.asUintN(64, arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
||||
const v = getObject(arg1);
|
||||
const ret = typeof v === "bigint" ? v : void 0;
|
||||
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||
};
|
||||
module2.exports.__wbindgen_boolean_get = function(arg0) {
|
||||
const v = getObject(arg0);
|
||||
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_cb_drop = function(arg0) {
|
||||
const obj = takeObject(arg0).original;
|
||||
if (obj.cnt-- == 1) {
|
||||
obj.a = 0;
|
||||
return true;
|
||||
}
|
||||
const ret = false;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_closure_wrapper6775 = function(arg0, arg1, arg2) {
|
||||
const ret = makeMutClosure(arg0, arg1, 923, __wbg_adapter_50);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
||||
const ret = debugString(getObject(arg1));
|
||||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||
};
|
||||
module2.exports.__wbindgen_error_new = function(arg0, arg1) {
|
||||
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_in = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) in getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_bigint = function(arg0) {
|
||||
const ret = typeof getObject(arg0) === "bigint";
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_falsy = function(arg0) {
|
||||
const ret = !getObject(arg0);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_function = function(arg0) {
|
||||
const ret = typeof getObject(arg0) === "function";
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_object = function(arg0) {
|
||||
const val = getObject(arg0);
|
||||
const ret = typeof val === "object" && val !== null;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_string = function(arg0) {
|
||||
const ret = typeof getObject(arg0) === "string";
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_is_undefined = function(arg0) {
|
||||
const ret = getObject(arg0) === void 0;
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) === getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) == getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
module2.exports.__wbindgen_memory = function() {
|
||||
const ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_number_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = typeof obj === "number" ? obj : void 0;
|
||||
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||
};
|
||||
module2.exports.__wbindgen_number_new = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_object_clone_ref = function(arg0) {
|
||||
const ret = getObject(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
module2.exports.__wbindgen_string_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = typeof obj === "string" ? obj : void 0;
|
||||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
|
||||
var len1 = WASM_VECTOR_LEN;
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||
};
|
||||
module2.exports.__wbindgen_string_new = function(arg0, arg1) {
|
||||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
module2.exports.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
var { Buffer: Buffer2 } = require("node:buffer");
|
||||
var bytes = Buffer2.from("AGFzbQEAAAAB/ARRYAAAYAABf2AAAX5gAX8AYAF/AX9gAX8BfmABfwF8YAJ/fwBgAn9/AX9gAn9/AX5gAn9/AXxgA39/fwBgA39/fwF/YAN/f38BfmAEf39/fwBgBH9/f38Bf2AEf39/fwF+YAV/f39/fwBgBX9/f39/AX9gBn9/f39/fwBgBn9/f39/fwF/YAd/f39/f39/AGAHf39/f39/fwF/YAh/f39/f39/fwBgCH9/f39/f39/AX9gC39/f39/f39/f39/AX9gDX9/f39/f39/f39/f38AYA5/f39/f39/f39/f39/fwF/YA9/f39/f39/f39/f39/f38Bf2ATf39/f39/f39/f39/f39/f39/fwF/YBd/f39/f39/f39/f39/f39/f39/f39/fwF/YAl/f39/f39+fn4AYAV/f39/fgBgBn9/f39+fwBgBH9/f34AYAZ/f39+f38AYAR/f398AGADf39+AGADf39+AX9gBH9/fn8AYAR/f35/AX9gBX9/fn9/AGAGf39+f35/AGAFf399f38AYAN/f3wAYAV/f3x/fwBgAn9+AGACf34Bf2ADf35/AGADf35/AX9gBH9+f38AYAR/fn9+AX5gA39+fgBgBH9+fn8AYAR/fn5+AGAFf35+fn8AYAV/fn5+fgBgBH99f38AYAN/fH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X3diZ190aLine truncated
|
||||
var wasmModule = new WebAssembly.Module(bytes);
|
||||
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
wasm = wasmInstance.exports;
|
||||
module2.exports.__wasm = wasm;
|
||||
}
|
||||
});
|
||||
|
||||
// src/internal.ts
|
||||
var internal_exports = {};
|
||||
__export(internal_exports, {
|
||||
findTopLevelAwaits: () => findTopLevelAwaits,
|
||||
getFirstExpression: () => getFirstExpression,
|
||||
isRecoverableError: () => isRecoverableError,
|
||||
isValidSyntax: () => isValidSyntax,
|
||||
tokenize: () => tokenize,
|
||||
transformModuleSyntax: () => transformModuleSyntax,
|
||||
transformSync: () => transformSync
|
||||
});
|
||||
module.exports = __toCommonJS(internal_exports);
|
||||
var import_wasm = __toESM(require_wasm());
|
||||
var DEFAULT_OPTIONS = {
|
||||
mode: "strip-only",
|
||||
deprecatedTsModuleAsError: true
|
||||
};
|
||||
var DEFAULT_TRANSFORM_OPTIONS = {
|
||||
mode: "transform",
|
||||
deprecatedTsModuleAsError: true,
|
||||
transform: {
|
||||
verbatimModuleSyntax: true,
|
||||
nativeClassProperties: true,
|
||||
noEmptyExport: true,
|
||||
importNotUsedAsValues: "preserve"
|
||||
}
|
||||
};
|
||||
function transformSync(source, options) {
|
||||
const input = `${source ?? ""}`;
|
||||
const defaults = options?.mode === "transform" ? DEFAULT_TRANSFORM_OPTIONS : DEFAULT_OPTIONS;
|
||||
return import_wasm.default.transformSync(input, { ...defaults, ...options });
|
||||
}
|
||||
function transformModuleSyntax(source) {
|
||||
return import_wasm.default.transformModuleSyntax(`${source ?? ""}`);
|
||||
}
|
||||
function getFirstExpression(source, startColumn) {
|
||||
return import_wasm.default.getFirstExpression(`${source ?? ""}`, startColumn);
|
||||
}
|
||||
function isValidSyntax(source) {
|
||||
return import_wasm.default.isValidSyntax(`${source ?? ""}`);
|
||||
}
|
||||
function isRecoverableError(source) {
|
||||
return import_wasm.default.isRecoverableError(`${source ?? ""}`);
|
||||
}
|
||||
function tokenize(source) {
|
||||
return import_wasm.default.tokenize(`${source ?? ""}`);
|
||||
}
|
||||
function findTopLevelAwaits(source) {
|
||||
return import_wasm.default.findTopLevelAwaits(`${source ?? ""}`);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
findTopLevelAwaits,
|
||||
getFirstExpression,
|
||||
isRecoverableError,
|
||||
isValidSyntax,
|
||||
tokenize,
|
||||
transformModuleSyntax,
|
||||
transformSync
|
||||
});
|
||||
Vendored
+5
-8
@@ -1,14 +1,11 @@
|
||||
{
|
||||
"name": "@swc/wasm-typescript",
|
||||
"collaborators": [
|
||||
"강동윤 <kdy1997.dev@gmail.com>"
|
||||
],
|
||||
"description": "wasm module for swc",
|
||||
"version": "1.15.43",
|
||||
"name": "amaro",
|
||||
"description": "Node.js TypeScript and REPL helpers built on SWC, compiled to WebAssembly",
|
||||
"version": "1.2.0",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/swc-project/swc.git"
|
||||
"url": "https://github.com/nodejs/amaro.git"
|
||||
},
|
||||
"files": [
|
||||
"wasm.js",
|
||||
@@ -16,4 +13,4 @@
|
||||
],
|
||||
"main": "wasm.js",
|
||||
"types": "wasm.d.ts"
|
||||
}
|
||||
}
|
||||
Vendored
+8
-2
@@ -1,3 +1,9 @@
|
||||
import { register } from "node:module";
|
||||
import module from "node:module";
|
||||
|
||||
register("./strip-loader.js", import.meta.url);
|
||||
if (typeof module.registerHooks === "function") {
|
||||
const { default: loader } = await import("./strip-loader.js");
|
||||
module.registerHooks({ load: loader.loadSync });
|
||||
} else {
|
||||
// Node.js versions without `module.registerHooks()`.
|
||||
module.register("./strip-loader.js", import.meta.url);
|
||||
}
|
||||
+8
-2
@@ -1,4 +1,4 @@
|
||||
import { register } from "node:module";
|
||||
import module from "node:module";
|
||||
import { emitWarning, env, execArgv } from "node:process";
|
||||
|
||||
const hasSourceMaps =
|
||||
@@ -9,4 +9,10 @@ if (!hasSourceMaps) {
|
||||
emitWarning("Source maps are disabled, stack traces will not be accurate");
|
||||
}
|
||||
|
||||
register("./transform-loader.js", import.meta.url);
|
||||
if (typeof module.registerHooks === "function") {
|
||||
const { default: loader } = await import("./transform-loader.js");
|
||||
module.registerHooks({ load: loader.loadSync });
|
||||
} else {
|
||||
// Node.js versions without `module.registerHooks()`.
|
||||
module.register("./transform-loader.js", import.meta.url);
|
||||
}
|
||||
Vendored
+10
-1
@@ -1,2 +1,11 @@
|
||||
import type { LoadFnOutput, LoadHookContext } from "node:module";
|
||||
export declare function load(url: string, context: LoadHookContext, nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>): Promise<LoadFnOutput>;
|
||||
type NextLoad = (url: string, context?: Partial<LoadHookContext>) => LoadFnOutput;
|
||||
export declare function loadSync(url: string, context: LoadHookContext, nextLoad: NextLoad): LoadFnOutput | {
|
||||
format: string;
|
||||
source: string;
|
||||
};
|
||||
export declare function load(url: string, context: LoadHookContext, nextLoad: (url: string, context?: Partial<LoadHookContext>) => LoadFnOutput | Promise<LoadFnOutput>): Promise<LoadFnOutput | {
|
||||
format: string;
|
||||
source: string;
|
||||
}>;
|
||||
export {};
|
||||
Vendored
+63
-27
@@ -1,34 +1,70 @@
|
||||
"use strict";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { isSwcError, wrapAndReThrowSwcError } from "./errors.js";
|
||||
import { transformSync } from "./index.js";
|
||||
export async function load(url, context, nextLoad) {
|
||||
const { format } = context;
|
||||
if (format?.endsWith("-typescript")) {
|
||||
try {
|
||||
const { source } = await nextLoad(url, {
|
||||
...context,
|
||||
format
|
||||
});
|
||||
const { code } = transformSync(source.toString(), {
|
||||
mode: "strip-only",
|
||||
filename: fileURLToPath(url)
|
||||
});
|
||||
return {
|
||||
format: format.replace("-typescript", ""),
|
||||
// Source map is not necessary in strip-only mode. However, to map the source
|
||||
// file in debuggers to the original TypeScript source, add a sourceURL magic
|
||||
// comment to hint that it is a generated source.
|
||||
source: `${code}
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var strip_loader_exports = {};
|
||||
__export(strip_loader_exports, {
|
||||
load: () => load,
|
||||
loadSync: () => loadSync
|
||||
});
|
||||
module.exports = __toCommonJS(strip_loader_exports);
|
||||
var import_node_url = require("node:url");
|
||||
var import_errors = require("./errors.js");
|
||||
var import_index = require("./index.js");
|
||||
function strip(url, format, source) {
|
||||
try {
|
||||
const { code } = (0, import_index.transformSync)(source.toString(), {
|
||||
mode: "strip-only",
|
||||
filename: (0, import_node_url.fileURLToPath)(url)
|
||||
});
|
||||
return {
|
||||
format: format.replace("-typescript", ""),
|
||||
// Source map is not necessary in strip-only mode. However, to map the source
|
||||
// file in debuggers to the original TypeScript source, add a sourceURL magic
|
||||
// comment to hint that it is a generated source.
|
||||
source: `${code}
|
||||
|
||||
//# sourceURL=${url}`
|
||||
};
|
||||
} catch (error) {
|
||||
if (isSwcError(error)) {
|
||||
wrapAndReThrowSwcError(error);
|
||||
}
|
||||
throw error;
|
||||
};
|
||||
} catch (error) {
|
||||
if ((0, import_errors.isSwcError)(error)) {
|
||||
(0, import_errors.wrapAndReThrowSwcError)(error);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
function loadSync(url, context, nextLoad) {
|
||||
const { format } = context;
|
||||
if (format?.endsWith("-typescript")) {
|
||||
const { source } = nextLoad(url, { ...context, format });
|
||||
return strip(url, format, source);
|
||||
}
|
||||
return nextLoad(url, context);
|
||||
}
|
||||
async function load(url, context, nextLoad) {
|
||||
const { format } = context;
|
||||
if (format?.endsWith("-typescript")) {
|
||||
const { source } = await nextLoad(url, { ...context, format });
|
||||
return strip(url, format, source);
|
||||
}
|
||||
return nextLoad(url, context);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
load,
|
||||
loadSync
|
||||
});
|
||||
+10
-1
@@ -1,2 +1,11 @@
|
||||
import type { LoadFnOutput, LoadHookContext } from "node:module";
|
||||
export declare function load(url: string, context: LoadHookContext, nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>): Promise<LoadFnOutput>;
|
||||
type NextLoad = (url: string, context?: Partial<LoadHookContext>) => LoadFnOutput;
|
||||
export declare function loadSync(url: string, context: LoadHookContext, nextLoad: NextLoad): LoadFnOutput | {
|
||||
format: string;
|
||||
source: string;
|
||||
};
|
||||
export declare function load(url: string, context: LoadHookContext, nextLoad: (url: string, context?: Partial<LoadHookContext>) => LoadFnOutput | Promise<LoadFnOutput>): Promise<LoadFnOutput | {
|
||||
format: string;
|
||||
source: string;
|
||||
}>;
|
||||
export {};
|
||||
Vendored
+66
-30
@@ -1,39 +1,75 @@
|
||||
"use strict";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { isSwcError, wrapAndReThrowSwcError } from "./errors.js";
|
||||
import { transformSync } from "./index.js";
|
||||
export async function load(url, context, nextLoad) {
|
||||
const { format } = context;
|
||||
if (format?.endsWith("-typescript")) {
|
||||
try {
|
||||
const { source } = await nextLoad(url, {
|
||||
...context,
|
||||
format
|
||||
});
|
||||
const { code, map } = transformSync(source.toString(), {
|
||||
mode: "transform",
|
||||
sourceMap: true,
|
||||
filename: fileURLToPath(url)
|
||||
});
|
||||
let output = code;
|
||||
if (map) {
|
||||
const base64SourceMap = Buffer.from(map).toString("base64");
|
||||
output = `${code}
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var transform_loader_exports = {};
|
||||
__export(transform_loader_exports, {
|
||||
load: () => load,
|
||||
loadSync: () => loadSync
|
||||
});
|
||||
module.exports = __toCommonJS(transform_loader_exports);
|
||||
var import_node_url = require("node:url");
|
||||
var import_errors = require("./errors.js");
|
||||
var import_index = require("./index.js");
|
||||
function transform(url, format, source) {
|
||||
try {
|
||||
const { code, map } = (0, import_index.transformSync)(source.toString(), {
|
||||
mode: "transform",
|
||||
sourceMap: true,
|
||||
filename: (0, import_node_url.fileURLToPath)(url)
|
||||
});
|
||||
let output = code;
|
||||
if (map) {
|
||||
const base64SourceMap = Buffer.from(map).toString("base64");
|
||||
output = `${code}
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,${base64SourceMap}`;
|
||||
}
|
||||
return {
|
||||
format: format.replace("-typescript", ""),
|
||||
source: `${output}
|
||||
}
|
||||
return {
|
||||
format: format.replace("-typescript", ""),
|
||||
source: `${output}
|
||||
|
||||
//# sourceURL=${url}`
|
||||
};
|
||||
} catch (error) {
|
||||
if (isSwcError(error)) {
|
||||
wrapAndReThrowSwcError(error);
|
||||
}
|
||||
throw error;
|
||||
};
|
||||
} catch (error) {
|
||||
if ((0, import_errors.isSwcError)(error)) {
|
||||
(0, import_errors.wrapAndReThrowSwcError)(error);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
function loadSync(url, context, nextLoad) {
|
||||
const { format } = context;
|
||||
if (format?.endsWith("-typescript")) {
|
||||
const { source } = nextLoad(url, { ...context, format });
|
||||
return transform(url, format, source);
|
||||
}
|
||||
return nextLoad(url, context);
|
||||
}
|
||||
async function load(url, context, nextLoad) {
|
||||
const { format } = context;
|
||||
if (format?.endsWith("-typescript")) {
|
||||
const { source } = await nextLoad(url, { ...context, format });
|
||||
return transform(url, format, source);
|
||||
}
|
||||
return nextLoad(url, context);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
load,
|
||||
loadSync
|
||||
});
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
import type { Options, TransformOutput } from "../lib/wasm";
|
||||
export declare function transformSync(source: string, options?: Options): TransformOutput;
|
||||
Vendored
+28
@@ -3,8 +3,36 @@
|
||||
|
||||
export declare function transform(src: string | Uint8Array, opts?: Options): Promise<TransformOutput>;
|
||||
export declare function transformSync(src: string | Uint8Array, opts?: Options): TransformOutput;
|
||||
export declare function transformModuleSyntax(src: string | Uint8Array): ModuleSyntaxTransformOutput;
|
||||
export declare function getFirstExpression(src: string | Uint8Array, startColumn: number): string;
|
||||
export declare function isValidSyntax(src: string | Uint8Array): boolean;
|
||||
export declare function isRecoverableError(src: string | Uint8Array): boolean;
|
||||
export declare function tokenize(src: string | Uint8Array): Token[];
|
||||
export declare function findTopLevelAwaits(src: string | Uint8Array): TopLevelAwaitLocation[];
|
||||
export type { Options, TransformOutput };
|
||||
|
||||
export type TokenKind = "keyword" | "identifier" | "number" | "bigint" | "string" | "template" | "regexp" | "comment" | "punctuator";
|
||||
|
||||
export interface Token {
|
||||
kind: TokenKind;
|
||||
/** Zero-based UTF-16 offset, inclusive. */
|
||||
start: number;
|
||||
/** Zero-based UTF-16 offset, exclusive. */
|
||||
end: number;
|
||||
}
|
||||
|
||||
export interface TopLevelAwaitLocation {
|
||||
/** One-based line number. */
|
||||
line: number;
|
||||
/** Zero-based UTF-16 column. */
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface ModuleSyntaxTransformOutput {
|
||||
code: string;
|
||||
hadModuleSyntax: boolean;
|
||||
}
|
||||
|
||||
|
||||
|
||||
interface Options {
|
||||
|
||||
Vendored
+755
@@ -0,0 +1,755 @@
|
||||
|
||||
let imports = {};
|
||||
imports['__wbindgen_placeholder__'] = module.exports;
|
||||
let wasm;
|
||||
const { TextDecoder, TextEncoder } = require(`util`);
|
||||
|
||||
const heap = new Array(128).fill(undefined);
|
||||
|
||||
heap.push(undefined, null, true, false);
|
||||
|
||||
function getObject(idx) { return heap[idx]; }
|
||||
|
||||
let heap_next = heap.length;
|
||||
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
heap_next = heap[idx];
|
||||
|
||||
heap[idx] = obj;
|
||||
return idx;
|
||||
}
|
||||
|
||||
function handleError(f, args) {
|
||||
try {
|
||||
return f.apply(this, args);
|
||||
} catch (e) {
|
||||
wasm.__wbindgen_export_0(addHeapObject(e));
|
||||
}
|
||||
}
|
||||
|
||||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
||||
|
||||
cachedTextDecoder.decode();
|
||||
|
||||
let cachedUint8ArrayMemory0 = null;
|
||||
|
||||
function getUint8ArrayMemory0() {
|
||||
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
||||
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachedUint8ArrayMemory0;
|
||||
}
|
||||
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
ptr = ptr >>> 0;
|
||||
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
|
||||
function getCachedStringFromWasm0(ptr, len) {
|
||||
if (ptr === 0) {
|
||||
return getObject(len);
|
||||
} else {
|
||||
return getStringFromWasm0(ptr, len);
|
||||
}
|
||||
}
|
||||
|
||||
function dropObject(idx) {
|
||||
if (idx < 132) return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
function isLikeNone(x) {
|
||||
return x === undefined || x === null;
|
||||
}
|
||||
|
||||
let cachedDataViewMemory0 = null;
|
||||
|
||||
function getDataViewMemory0() {
|
||||
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
||||
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
||||
}
|
||||
return cachedDataViewMemory0;
|
||||
}
|
||||
|
||||
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
||||
? { register: () => {}, unregister: () => {} }
|
||||
: new FinalizationRegistry(state => {
|
||||
wasm.__wbindgen_export_1.get(state.dtor)(state.a, state.b)
|
||||
});
|
||||
|
||||
function makeMutClosure(arg0, arg1, dtor, f) {
|
||||
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
||||
const real = (...args) => {
|
||||
// First up with a closure we increment the internal reference
|
||||
// count. This ensures that the Rust closure environment won't
|
||||
// be deallocated while we're invoking it.
|
||||
state.cnt++;
|
||||
const a = state.a;
|
||||
state.a = 0;
|
||||
try {
|
||||
return f(a, state.b, ...args);
|
||||
} finally {
|
||||
if (--state.cnt === 0) {
|
||||
wasm.__wbindgen_export_1.get(state.dtor)(a, state.b);
|
||||
CLOSURE_DTORS.unregister(state);
|
||||
} else {
|
||||
state.a = a;
|
||||
}
|
||||
}
|
||||
};
|
||||
real.original = state;
|
||||
CLOSURE_DTORS.register(real, state, state);
|
||||
return real;
|
||||
}
|
||||
|
||||
function debugString(val) {
|
||||
// primitive types
|
||||
const type = typeof val;
|
||||
if (type == 'number' || type == 'boolean' || val == null) {
|
||||
return `${val}`;
|
||||
}
|
||||
if (type == 'string') {
|
||||
return `"${val}"`;
|
||||
}
|
||||
if (type == 'symbol') {
|
||||
const description = val.description;
|
||||
if (description == null) {
|
||||
return 'Symbol';
|
||||
} else {
|
||||
return `Symbol(${description})`;
|
||||
}
|
||||
}
|
||||
if (type == 'function') {
|
||||
const name = val.name;
|
||||
if (typeof name == 'string' && name.length > 0) {
|
||||
return `Function(${name})`;
|
||||
} else {
|
||||
return 'Function';
|
||||
}
|
||||
}
|
||||
// objects
|
||||
if (Array.isArray(val)) {
|
||||
const length = val.length;
|
||||
let debug = '[';
|
||||
if (length > 0) {
|
||||
debug += debugString(val[0]);
|
||||
}
|
||||
for(let i = 1; i < length; i++) {
|
||||
debug += ', ' + debugString(val[i]);
|
||||
}
|
||||
debug += ']';
|
||||
return debug;
|
||||
}
|
||||
// Test for built-in
|
||||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
||||
let className;
|
||||
if (builtInMatches && builtInMatches.length > 1) {
|
||||
className = builtInMatches[1];
|
||||
} else {
|
||||
// Failed to match the standard '[object ClassName]'
|
||||
return toString.call(val);
|
||||
}
|
||||
if (className == 'Object') {
|
||||
// we're a user defined class or Object
|
||||
// JSON.stringify avoids problems with cycles, and is generally much
|
||||
// easier than looping through ownProperties of `val`.
|
||||
try {
|
||||
return 'Object(' + JSON.stringify(val) + ')';
|
||||
} catch (_) {
|
||||
return 'Object';
|
||||
}
|
||||
}
|
||||
// errors
|
||||
if (val instanceof Error) {
|
||||
return `${val.name}: ${val.message}\n${val.stack}`;
|
||||
}
|
||||
// TODO we could test for more things here, like `Set`s and `Map`s.
|
||||
return className;
|
||||
}
|
||||
|
||||
let WASM_VECTOR_LEN = 0;
|
||||
|
||||
let cachedTextEncoder = new TextEncoder('utf-8');
|
||||
|
||||
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
||||
? function (arg, view) {
|
||||
return cachedTextEncoder.encodeInto(arg, view);
|
||||
}
|
||||
: function (arg, view) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
view.set(buf);
|
||||
return {
|
||||
read: arg.length,
|
||||
written: buf.length
|
||||
};
|
||||
});
|
||||
|
||||
function passStringToWasm0(arg, malloc, realloc) {
|
||||
|
||||
if (realloc === undefined) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr = malloc(buf.length, 1) >>> 0;
|
||||
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len, 1) >>> 0;
|
||||
|
||||
const mem = getUint8ArrayMemory0();
|
||||
|
||||
let offset = 0;
|
||||
|
||||
for (; offset < len; offset++) {
|
||||
const code = arg.charCodeAt(offset);
|
||||
if (code > 0x7F) break;
|
||||
mem[ptr + offset] = code;
|
||||
}
|
||||
|
||||
if (offset !== len) {
|
||||
if (offset !== 0) {
|
||||
arg = arg.slice(offset);
|
||||
}
|
||||
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
||||
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
|
||||
offset += ret.written;
|
||||
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
||||
}
|
||||
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
/**
|
||||
* @param {any} input
|
||||
* @param {any} options
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
module.exports.transform = function(input, options) {
|
||||
const ret = wasm.transform(addHeapObject(input), addHeapObject(options));
|
||||
return takeObject(ret);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {any} input
|
||||
* @param {any} options
|
||||
* @returns {any}
|
||||
*/
|
||||
module.exports.transformSync = function(input, options) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.transformSync(retptr, addHeapObject(input), addHeapObject(options));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {any} input
|
||||
* @returns {any}
|
||||
*/
|
||||
module.exports.transformModuleSyntax = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.transformModuleSyntax(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {any} input
|
||||
* @param {number} start_column
|
||||
* @returns {string}
|
||||
*/
|
||||
module.exports.getFirstExpression = function(input, start_column) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.getFirstExpression(retptr, addHeapObject(input), start_column);
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
||||
if (r3) {
|
||||
throw takeObject(r2);
|
||||
}
|
||||
var v1 = getCachedStringFromWasm0(r0, r1);
|
||||
if (r0 !== 0) { wasm.__wbindgen_export_4(r0, r1, 1); }
|
||||
return v1;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {any} input
|
||||
* @returns {boolean}
|
||||
*/
|
||||
module.exports.isValidSyntax = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.isValidSyntax(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return r0 !== 0;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {any} input
|
||||
* @returns {boolean}
|
||||
*/
|
||||
module.exports.isRecoverableError = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.isRecoverableError(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return r0 !== 0;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns compact tokens for syntax highlighting, including a partial prefix
|
||||
* when the input is incomplete or invalid.
|
||||
* @param {any} input
|
||||
* @returns {any}
|
||||
*/
|
||||
module.exports.tokenize = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.tokenize(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns module-scope await locations in source order using Acorn
|
||||
* coordinates.
|
||||
* @param {any} input
|
||||
* @returns {any}
|
||||
*/
|
||||
module.exports.findTopLevelAwaits = function(input) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.findTopLevelAwaits(retptr, addHeapObject(input));
|
||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
};
|
||||
|
||||
function __wbg_adapter_50(arg0, arg1, arg2) {
|
||||
wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
|
||||
}
|
||||
|
||||
function __wbg_adapter_83(arg0, arg1, arg2, arg3) {
|
||||
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
||||
}
|
||||
|
||||
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
||||
const ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
||||
const ret = getObject(arg0).call(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
|
||||
module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
||||
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
|
||||
module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
||||
const ret = getObject(arg0).done;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
|
||||
const ret = Object.entries(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
||||
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
|
||||
module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
||||
const ret = getObject(arg0)[arg1 >>> 0];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
||||
const ret = getObject(arg0)[getObject(arg1)];
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof ArrayBuffer;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Map;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Uint8Array;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
||||
const ret = Array.isArray(getObject(arg0));
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
||||
const ret = Number.isSafeInteger(getObject(arg0));
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
||||
const ret = Symbol.iterator;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
||||
try {
|
||||
var state0 = {a: arg0, b: arg1};
|
||||
var cb0 = (arg0, arg1) => {
|
||||
const a = state0.a;
|
||||
state0.a = 0;
|
||||
try {
|
||||
return __wbg_adapter_83(a, state0.b, arg0, arg1);
|
||||
} finally {
|
||||
state0.a = a;
|
||||
}
|
||||
};
|
||||
const ret = new Promise(cb0);
|
||||
return addHeapObject(ret);
|
||||
} finally {
|
||||
state0.a = state0.b = 0;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.__wbg_new_405e22f390576ce2 = function() {
|
||||
const ret = new Object();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_new_78feb108b6472713 = function() {
|
||||
const ret = new Array();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
||||
const ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
||||
var v0 = getCachedStringFromWasm0(arg0, arg1);
|
||||
const ret = new Function(v0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
||||
const ret = getObject(arg0).next;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
||||
const ret = getObject(arg0).next();
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
|
||||
module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
||||
queueMicrotask(getObject(arg0));
|
||||
};
|
||||
|
||||
module.exports.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
||||
const ret = getObject(arg0).queueMicrotask;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
||||
const ret = Promise.resolve(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
||||
};
|
||||
|
||||
module.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
||||
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
||||
};
|
||||
|
||||
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
|
||||
module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
||||
const ret = typeof global === 'undefined' ? null : global;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
||||
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
||||
const ret = typeof self === 'undefined' ? null : self;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
||||
const ret = typeof window === 'undefined' ? null : window;
|
||||
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
||||
const ret = getObject(arg0).then(getObject(arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
||||
const ret = getObject(arg0).value;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
||||
const ret = BigInt.asUintN(64, arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
||||
const v = getObject(arg1);
|
||||
const ret = typeof(v) === 'bigint' ? v : undefined;
|
||||
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_boolean_get = function(arg0) {
|
||||
const v = getObject(arg0);
|
||||
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_cb_drop = function(arg0) {
|
||||
const obj = takeObject(arg0).original;
|
||||
if (obj.cnt-- == 1) {
|
||||
obj.a = 0;
|
||||
return true;
|
||||
}
|
||||
const ret = false;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_closure_wrapper6775 = function(arg0, arg1, arg2) {
|
||||
const ret = makeMutClosure(arg0, arg1, 923, __wbg_adapter_50);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
||||
const ret = debugString(getObject(arg1));
|
||||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
|
||||
const len1 = WASM_VECTOR_LEN;
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
||||
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_in = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) in getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_is_bigint = function(arg0) {
|
||||
const ret = typeof(getObject(arg0)) === 'bigint';
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_is_falsy = function(arg0) {
|
||||
const ret = !getObject(arg0);
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_is_function = function(arg0) {
|
||||
const ret = typeof(getObject(arg0)) === 'function';
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_is_object = function(arg0) {
|
||||
const val = getObject(arg0);
|
||||
const ret = typeof(val) === 'object' && val !== null;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_is_string = function(arg0) {
|
||||
const ret = typeof(getObject(arg0)) === 'string';
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_is_undefined = function(arg0) {
|
||||
const ret = getObject(arg0) === undefined;
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) === getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
||||
const ret = getObject(arg0) == getObject(arg1);
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_memory = function() {
|
||||
const ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = typeof(obj) === 'number' ? obj : undefined;
|
||||
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_number_new = function(arg0) {
|
||||
const ret = arg0;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
||||
const ret = getObject(arg0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = typeof(obj) === 'string' ? obj : undefined;
|
||||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
|
||||
var len1 = WASM_VECTOR_LEN;
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
||||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
|
||||
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
|
||||
|
||||
|
||||
const { Buffer } = require('node:buffer');
|
||||
const bytes = Buffer.from('AGFzbQEAAAAB/ARRYAAAYAABf2AAAX5gAX8AYAF/AX9gAX8BfmABfwF8YAJ/fwBgAn9/AX9gAn9/AX5gAn9/AXxgA39/fwBgA39/fwF/YAN/f38BfmAEf39/fwBgBH9/f38Bf2AEf39/fwF+YAV/f39/fwBgBX9/f39/AX9gBn9/f39/fwBgBn9/f39/fwF/YAd/f39/f39/AGAHf39/f39/fwF/YAh/f39/f39/fwBgCH9/f39/f39/AX9gC39/f39/f39/f39/AX9gDX9/f39/f39/f39/f38AYA5/f39/f39/f39/f39/fwF/YA9/f39/f39/f39/f39/f38Bf2ATf39/f39/f39/f39/f39/f39/fwF/YBd/f39/f39/f39/f39/f39/f39/f39/fwF/YAl/f39/f39+fn4AYAV/f39/fgBgBn9/f39+fwBgBH9/f34AYAZ/f39+f38AYAR/f398AGADf39+AGADf39+AX9gBH9/fn8AYAR/f35/AX9gBX9/fn9/AGAGf39+f35/AGAFf399f38AYAN/f3wAYAV/f3x/fwBgAn9+AGACf34Bf2ADf35/AGADf35/AX9gBH9+f38AYAR/fn9+AX5gA39+fgBgBH9+fn8AYAR/fn5+AGAFf35+fn8AYAV/fn5+fgBgBH99f38AYAN/fH8AYAN/fH8Bf2AEf3x/fwBgBH98f38Bf2ABfgBgAX4Bf2ABfgF+YAJ+fwBgAn5/AX9gAn5/AX5gA35/fwBgA35/fwF/YAN+f34BfmAEfn9+fwF/YA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2Y5MWM3NWJlAAQYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fGl9fd2JnX3NldF82NTU5NWJkZDg2OGIzMDA5AAsYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fG19fd2JnX25leHRfNjU3NGUxYThhNjJkMTA1NQAEGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXxtfX3diZ19kb25lXzc2OWU1ZWRlNGIzMWM2N2IABBhfX3diaW5kZ2VuX3BsYWNlaG9sZGVyX18cX193YmdfdmFsdWVfY2QxZmZhN2IxYWI3OTRmMQAEGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXyxfX3diZ19pbnN0YW5jZW9mX1VpbnQ4QXJyYXlfMTcxNTZiY2YxMTgwODZhOQAEGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXxlfX3diaW5kZ2VuX2pzdmFsX2xvb3NlX2VxAAgYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fLV9fd2JnX2luc3RhbmNlb2ZfQXJyYXlCdWZmZXJfZTE0NTg1NDMyZTM3MzdmYwAEGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXx5fX3diZ19lbnRyaWVzXzMyNjVkNDE1OGIzM2U1ZGMABBhfX3diaW5kZ2VuX3BsYWNlaG9sZGVyX18QX193YmluZGdlbl90aHJvdwAHGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXxxfX3diaW5kZ2VuX2JpZ2ludF9nZXRfYXNfaTY0AAcYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fF19fd2JpbmRnZW5fZGVidWdfc3RyaW5nAAcYX193YmluZGdlbl9wbGFjZWhvbGRlcl9fEl9fd2JpbmRnZW5fY2JfZHJvcAAEGF9fd2JpbmRnZW5fcGxhY2Vob2xkZXJfXxtfX3diZ190aGVuLine truncated
|
||||
|
||||
const wasmModule = new WebAssembly.Module(bytes);
|
||||
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
||||
wasm = wasmInstance.exports;
|
||||
module.exports.__wasm = wasm;
|
||||
|
||||
Vendored
+8
-1
@@ -1,7 +1,13 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const memory: WebAssembly.Memory;
|
||||
export const findTopLevelAwaits: (a: number, b: number) => void;
|
||||
export const getFirstExpression: (a: number, b: number, c: number) => void;
|
||||
export const isRecoverableError: (a: number, b: number) => void;
|
||||
export const isValidSyntax: (a: number, b: number) => void;
|
||||
export const tokenize: (a: number, b: number) => void;
|
||||
export const transform: (a: number, b: number) => number;
|
||||
export const transformModuleSyntax: (a: number, b: number) => void;
|
||||
export const transformSync: (a: number, b: number, c: number) => void;
|
||||
export const __wbindgen_export_0: (a: number) => void;
|
||||
export const __wbindgen_export_1: WebAssembly.Table;
|
||||
@@ -9,4 +15,5 @@ export const __wbindgen_export_2: (a: number, b: number) => number;
|
||||
export const __wbindgen_export_3: (a: number, b: number, c: number, d: number) => number;
|
||||
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
||||
export const __wbindgen_export_4: (a: number, b: number, c: number) => void;
|
||||
export const __wbindgen_export_5: (a: number, b: number, c: number, d: number) => void;
|
||||
export const __wbindgen_export_5: (a: number, b: number, c: number) => void;
|
||||
export const __wbindgen_export_6: (a: number, b: number, c: number, d: number) => void;
|
||||
Vendored
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "amaro",
|
||||
"version": "1.1.11",
|
||||
"version": "1.3.0",
|
||||
"description": "Node.js TypeScript wrapper",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
@@ -49,6 +49,7 @@
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"lib/wasm.js",
|
||||
"lib/**/*.d.ts",
|
||||
"LICENSE.md"
|
||||
],
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
// Refer to tools/dep_updaters/update-amaro.sh
|
||||
#ifndef SRC_AMARO_VERSION_H_
|
||||
#define SRC_AMARO_VERSION_H_
|
||||
#define AMARO_VERSION "1.1.11"
|
||||
#define AMARO_VERSION "1.3.0"
|
||||
#endif // SRC_AMARO_VERSION_H_
|
||||
Reference in new issue
Block a user