securityos/node_modules/wasi-js/dist/bindings/browser.js

25 lines
893 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const randomfill_1 = require("randomfill");
const path_browserify_1 = __importDefault(require("path-browserify"));
const browser_hrtime_1 = __importDefault(require("./browser-hrtime"));
const types_1 = require("../types");
const bindings = {
hrtime: browser_hrtime_1.default.bigint,
exit: (code) => {
throw new types_1.WASIExitError(code);
},
kill: (signal) => {
throw new types_1.WASIKillError(signal);
},
randomFillSync: randomfill_1.randomFillSync,
isTTY: () => true,
path: path_browserify_1.default,
// Let the user attach the fs at runtime
fs: null,
};
exports.default = bindings;
//# sourceMappingURL=browser.js.map