securityos/contexts/fileSystem/FileSystemConfig.ts

25 lines
579 B
TypeScript

import type { FileSystemConfiguration } from "browserfs";
import { fs9pToBfs } from "contexts/fileSystem/functions";
const index = fs9pToBfs();
const FileSystemConfig = (writeToMemory = false): FileSystemConfiguration => ({
fs: "MountableFileSystem",
options: {
"/": {
fs: "OverlayFS",
options: {
readable: {
fs: "HTTPRequest",
options: { index },
},
writable: {
fs: writeToMemory ? "InMemory" : "IndexedDB",
},
},
},
},
});
export default FileSystemConfig;