Skip to content

Commit

Permalink
Update denoFs.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxodin committed Apr 4, 2023
1 parent f37b041 commit 3c5a879
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/denoFs.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,22 @@ class FsItem extends AsyncItem {
return list;
}
}
// async loadItems() { // if directory, load all children, todo
// for await (const dirEntry of Deno.readDir(this.fsPath)) {
// this.item(dirEntry.name);
// // this.item(dirEntry.name).type = dirEntry.isDirectory ? 'directory' : 'file';
// }
// }

createSetter(value) {
if (typeof value === 'string') { // if string its a file
return Deno.writeTextFile(this.fsPath, value);
}

for (const key in value) {
this.item(key).value = value[key];
}
// todo, await all children setters?
return Promise.resolve({});
}
// async loadItems() { // if directory, load all children, todo
// for await (const dirEntry of Deno.readDir(this.fsPath)) {
// this.item(dirEntry.name);
// // this.item(dirEntry.name).type = dirEntry.isDirectory ? 'directory' : 'file';
// }
// }
get fsPath() {
if (this.parent == null) return this.fsRootPath;
return this.parent.fsPath + '/' + this.pathKeys.join('/');
Expand Down

0 comments on commit 3c5a879

Please sign in to comment.