[firestore][js] fix issue with parent() incorrectly returning a 'parent' Path on a root level Path

This commit is contained in:
Salakar 2018-04-22 00:25:36 +01:00
parent 94afa546ae
commit 0a828aae40
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ export default class Path {
}
parent(): Path | null {
return this._parts.length
return this._parts.length > 1
? new Path(this._parts.slice(0, this._parts.length - 1))
: null;
}