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

Method empty

src/generic/key_value_filesystem.ts:742–749  ·  view source on GitHub ↗

* Delete all contents stored in the file system.

(cb: BFSOneArgCallback)

Source from the content-addressed store, hash-verified

740 * Delete all contents stored in the file system.
741 */
742 public empty(cb: BFSOneArgCallback): void {
743 this.store.clear((e?) => {
744 if (noError(e, cb)) {
745 // INVARIANT: Root always exists.
746 this.makeRootDirectory(cb);
747 }
748 });
749 }
750
751 public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {
752 const tx = this.store.beginTransaction('readwrite');

Callers

nothing calls this directly

Calls 3

makeRootDirectoryMethod · 0.95
noErrorFunction · 0.85
clearMethod · 0.65

Tested by

no test coverage detected