UNPKG

@sebastianwessel/quickjs

Version:

A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox

9 lines (8 loc) 339 B
import { Volume } from 'memfs'; import { createVirtualFileSystem } from '../createVirtualFileSystem.js'; export const setupFileSystem = (runtimeOptions) => { if (runtimeOptions.mountFs && runtimeOptions.mountFs instanceof Volume) { return runtimeOptions.mountFs; } return createVirtualFileSystem(runtimeOptions).fs; };