diff options
author | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-01-19 21:55:47 -0800 |
---|---|---|
committer | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-01-19 21:55:47 -0800 |
commit | 333fa3303788479d5df7b91996b68e0f7afa4413 (patch) | |
tree | ae2b0e40563f72bee6b4ede675655c7c61bfc211 /src/database.ts | |
parent | c40fa02fccd04c63e58102ad0729dba2edd8397d (diff) |
Handle root node case
Diffstat (limited to 'src/database.ts')
-rw-r--r-- | src/database.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/database.ts b/src/database.ts index 4e85057..70aecf4 100644 --- a/src/database.ts +++ b/src/database.ts @@ -46,6 +46,8 @@ export class Database implements DatabaseInterface { // but only because we hold the entire DB in memory // (which obviously becomes a bad idea at some point) async read(path: string): Promise<Object> { + // root node case + if (path === "/") return this.buff; const pathParts = splitPath(path); return this.resolve(pathParts); } |