MCPcopy Index your code
hub / github.com/jvilk/BrowserFS / rmdir

Method rmdir

src/generic/key_value_filesystem.ts:912–923  ·  view source on GitHub ↗
(p: string, cb: BFSOneArgCallback)

Source from the content-addressed store, hash-verified

910 }
911
912 public rmdir(p: string, cb: BFSOneArgCallback): void {
913 // Check first if directory is empty.
914 this.readdir(p, (err, files?) => {
915 if (err) {
916 cb(err);
917 } else if (files!.length > 0) {
918 cb(ApiError.ENOTEMPTY(p));
919 } else {
920 this.removeEntry(p, true, cb);
921 }
922 });
923 }
924
925 public mkdir(p: string, mode: number, cb: BFSOneArgCallback): void {
926 const tx = this.store.beginTransaction('readwrite'),

Callers

nothing calls this directly

Calls 4

readdirMethod · 0.95
removeEntryMethod · 0.95
cbFunction · 0.85
ENOTEMPTYMethod · 0.80

Tested by

no test coverage detected