MCPcopy
hub / github.com/jvilk/BrowserFS / HTML5FSFactory

Function HTML5FSFactory

test/harness/factories/html5fs_factory.ts:4–23  ·  view source on GitHub ↗
(cb: (name: string, obj: FileSystem[]) => void)

Source from the content-addressed store, hash-verified

2import {FileSystem} from '../../../src/core/file_system';
3
4export default function HTML5FSFactory(cb: (name: string, obj: FileSystem[]) => void): void {
5 if (HTML5FS.isAvailable()) {
6 HTML5FS.Create({
7 size: 10,
8 type: window.TEMPORARY
9 }, (e, fs?) => {
10 if (e) {
11 throw e;
12 }
13 fs.empty((e?) => {
14 if (e) {
15 throw e;
16 }
17 cb('HTML5FS', [fs]);
18 });
19 });
20 } else {
21 cb('HTML5FS', []);
22 }
23}

Callers

nothing calls this directly

Calls 4

cbFunction · 0.85
isAvailableMethod · 0.65
CreateMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected