Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (indexLimit > 0) {
wasiArgs = [wasiArgs[0], ...wasiArgs.splice(indexLimit + 1)];
}
const wasi = new WASI({
args: wasiArgs,
bindings: {
...nodeBindings,
fs
},
env: {},
preopens
});
const wasmBytes = fs.readFileSync(args.file);
const transformedBytes = await lowerI64Imports(wasmBytes);
const { instance } = await WebAssembly.instantiate(transformedBytes, {
wasi_unstable: wasi.wasiImport
});
wasi.start(instance);
}
}
} else {
return customCommand;
}
} else {
wasmBinary = await fetchCommandFromWAPM(
commandName,
commandArgs,
envEntries
);
}
if (!didInitWasmTransformer) {
didInitWasmTransformer = true;
}
return await lowerI64Imports(wasmBinary);
};