mirror of
https://github.com/chenasraf/DefinitelyTyped-tools.git
synced 2026-05-18 01:49:03 +00:00
Handle references to nested paths that are not defined
This commit is contained in:
committed by
Andrew Branch
parent
0321ecd88e
commit
0de94cfe7d
@@ -150,6 +150,9 @@ export class InMemoryDT implements FS {
|
||||
let dir = this.curDir;
|
||||
for (const component of components) {
|
||||
const entry = component === ".." ? dir.parent : dir.get(component);
|
||||
if (entry === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (!(entry instanceof Dir)) {
|
||||
throw new Error(`No file system entry at ${this.pathToRoot}/${path}. Siblings are: ${Array.from(dir.keys())}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user