forked from tools/josh
1
0
Fork 0

Remove unnecessary new method

This commit is contained in:
Florine W. Dekker 2020-09-30 16:25:18 +02:00
parent 0a422e6777
commit 1f471acce2
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 4 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{
"name": "fwdekker.com",
"version": "0.38.2",
"version": "0.38.3",
"description": "The source code of [my personal website](https://fwdekker.com/).",
"author": "Felix W. Dekker",
"browser": "dist/bundle.js",

View File

@ -90,7 +90,9 @@ export class FileSystem {
"password.txt": new File("root: g9PjKu"),
}),
});
(this.get(new Path("home", "felix")) as Directory).addAll(FileSystem.navRoot);
const home = this.get(new Path("home", "felix")) as Directory;
Object.keys(FileSystem.navRoot.nodes).forEach(name => home.add(name, FileSystem.navRoot.get(name)!));
}
@ -577,15 +579,6 @@ export class Directory extends Node {
this._nodes[name] = node;
}
/**
* Adds (references to) all files in the given directory to this directory.
*
* @param directory the directory of which to add the children to this directory
*/
addAll(directory: Directory): void {
Object.keys(directory.nodes).forEach(name => this.add(name, directory.get(name)!));
}
/**
* Removes the node with the given name.
*