1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-17 13:38:37 +01:00

update docs on Node.ancestors/levels and Path.ancestors (#4987)

This commit is contained in:
Haakon Borch 2022-05-18 01:23:47 +02:00 committed by GitHub
parent 863357f994
commit f5ccab241c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -19,7 +19,7 @@ type Path = number[]
Get a list of ancestor paths for a given path.
The paths are sorted from deepest to shallowest ancestor. However, if the `reverse: true` option is passed, they are reversed.
The paths are sorted from shallowest to deepest ancestor. However, if the `reverse: true` option is passed, they are reversed.
#### `Path.common(path: Path, another: Path) => Path`

View File

@ -15,7 +15,7 @@ Get the node at a specific `path`, asserting that it is an ancestor node. If the
#### `Node.ancestors(root: Node, path: Path, options?) => Generator<NodeEntry<Ancestor>>`
Return a generator of all the ancestor nodes above a specific path. By default, the order is bottom-up, from lowest to highest ancestor in the tree, but you can pass the `reverse: true` option to go top-down.
Return a generator of all the ancestor nodes above a specific path. By default, the order is top-down, from highest to lowest ancestor in the tree, but you can pass the `reverse: true` option to go bottom-up.
Options: `{reverse?: boolean}`
@ -71,7 +71,7 @@ Get the node at a specific `path`, ensuring it's a leaf text node. If the node i
#### `Node.levels(root: Node, path: Path, options?) => Generator<NodeEntry>`
Return a generator of the nodes in a branch of the tree, from a specific `path`. By default, the order is top-down, from the lowest to the highest node in the tree, but you can pass the `reverse: true` option to go bottom-up.
Return a generator of the nodes in a branch of the tree, from a specific `path`. By default, the order is top-down, from the highest to the lowest node in the tree, but you can pass the `reverse: true` option to go bottom-up.
Options: `{reverse?: boolean}`

View File

@ -122,8 +122,8 @@ export const Node: NodeInterface = {
/**
* Return a generator of all the ancestor nodes above a specific path.
*
* By default the order is bottom-up, from lowest to highest ancestor in
* the tree, but you can pass the `reverse: true` option to go top-down.
* By default the order is top-down, from highest to lowest ancestor in
* the tree, but you can pass the `reverse: true` option to go bottom-up.
*/
*ancestors(
@ -438,7 +438,7 @@ export const Node: NodeInterface = {
/**
* Return a generator of the in a branch of the tree, from a specific path.
*
* By default the order is top-down, from lowest to highest node in the tree,
* By default the order is top-down, from highest to lowest node in the tree,
* but you can pass the `reverse: true` option to go bottom-up.
*/

View File

@ -57,7 +57,7 @@ export const Path: PathInterface = {
/**
* Get a list of ancestor paths for a given path.
*
* The paths are sorted from deepest to shallowest ancestor. However, if the
* The paths are sorted from shallowest to deepest ancestor. However, if the
* `reverse: true` option is passed, they are reversed.
*/