[firestore][js] fix issue with parent() incorrectly returning a 'parent' Path on a root level Path
This commit is contained in:
parent
94afa546ae
commit
0a828aae40
|
@ -34,7 +34,7 @@ export default class Path {
|
||||||
}
|
}
|
||||||
|
|
||||||
parent(): Path | null {
|
parent(): Path | null {
|
||||||
return this._parts.length
|
return this._parts.length > 1
|
||||||
? new Path(this._parts.slice(0, this._parts.length - 1))
|
? new Path(this._parts.slice(0, this._parts.length - 1))
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue