Skip to content

Commit 2fb1afb

Browse files
committed
refactor: more precise isRoot
1 parent f78a5be commit 2fb1afb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class TreeNode {
271271
*
272272
* @returns true if the node is the root node
273273
*/
274-
isRoot() {
274+
isRoot(): this is PrefixTree {
275275
return (
276276
!this.parent && this.value.fullPath === '/' && !this.value.components.size
277277
)

0 commit comments

Comments
 (0)