From 402b93ecc1d9ba6d10270ce46347b71cfc1424ad Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Sun, 6 Jun 2021 12:40:05 -0700 Subject: [PATCH] docs: Expand on Path.parent that it throws an Error if at the root --- docs/api/locations/path.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/locations/path.md b/docs/api/locations/path.md index dffeb9b02..d9bf51661 100644 --- a/docs/api/locations/path.md +++ b/docs/api/locations/path.md @@ -33,7 +33,7 @@ Note: Two paths of unequal length can still receive a `0` result if one is direc #### `Path.levels(path: Path, options?): Path[]` -Get a list of paths at every level down to a path. Note: this is the same as `Path.ancestors`, but including the path itself. +Get a list of paths at every level down to a path. Note: this is the same as `Path.ancestors`, but includes the path itself. The paths are sorted from shallowest to deepest. However, if the `reverse: true` option is passed, they are reversed. @@ -45,7 +45,7 @@ Given a path, gets the path to the next sibling node. The method does not ensure #### `Path.parent(path: Path): Path` -Given a path, return a new path referring to the parent node above it. +Given a path, return a new path referring to the parent node above it. If the `path` argument is equal to `[]`, throws an error. #### `Path.previous(path: Path): Path`