Remove unnecessary new method
This commit is contained in:
parent
0a422e6777
commit
1f471acce2
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "fwdekker.com",
|
"name": "fwdekker.com",
|
||||||
"version": "0.38.2",
|
"version": "0.38.3",
|
||||||
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
||||||
"author": "Felix W. Dekker",
|
"author": "Felix W. Dekker",
|
||||||
"browser": "dist/bundle.js",
|
"browser": "dist/bundle.js",
|
||||||
|
|
|
@ -90,7 +90,9 @@ export class FileSystem {
|
||||||
"password.txt": new File("root: g9PjKu"),
|
"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;
|
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.
|
* Removes the node with the given name.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue