securityos/contexts/fileSystem/FileSystemConfig.ts

25 lines
579 B
TypeScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
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;