// The entry for every host but Node (the "default" export condition): browsers, workers, // service workers, Deno, workerd. Engines load with fetch, compiling as the bytes arrive, // so the server must send build/*.wasm as application/wasm. There is no synchronous // fetch, so `transformSync` and `engine` work only once `transform` has compiled that // mode's engine; before then they throw. import { bind, defaultUrl } from "./core.js"; const fatal = new TextDecoder("utf-8", { fatal: true }); export const { transform, transformSync, engine } = bind({ url: defaultUrl, compileSync() { throw new Error("typestrip: this host can't load the engine synchronously; await transform() once before calling transformSync()"); }, compile: (url) => WebAssembly.compileStreaming(fetch(url)), isUtf8(bytes) { try { fatal.decode(bytes); return true; } catch { return false; } }, isAscii(bytes) { for (let i = 0; i < bytes.length; i++) if (bytes[i] > 0x7f) return false; return true; }, }); export { UnsupportedSyntaxError } from "./core.js";