From f5ccab241c49eae694072d9a61fa571857d1db66 Mon Sep 17 00:00:00 2001 From: Haakon Borch Date: Wed, 18 May 2022 01:23:47 +0200 Subject: [PATCH] update docs on Node.ancestors/levels and Path.ancestors (#4987) --- docs/api/locations/path.md | 2 +- docs/api/nodes/node.md | 4 ++-- packages/slate/src/interfaces/node.ts | 6 +++--- packages/slate/src/interfaces/path.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/api/locations/path.md b/docs/api/locations/path.md index f13a8f008..ee6a5b888 100644 --- a/docs/api/locations/path.md +++ b/docs/api/locations/path.md @@ -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` diff --git a/docs/api/nodes/node.md b/docs/api/nodes/node.md index 32955d246..927e4e470 100644 --- a/docs/api/nodes/node.md +++ b/docs/api/nodes/node.md @@ -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>` -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` -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}` diff --git a/packages/slate/src/interfaces/node.ts b/packages/slate/src/interfaces/node.ts index d78339f1a..7489b094a 100644 --- a/packages/slate/src/interfaces/node.ts +++ b/packages/slate/src/interfaces/node.ts @@ -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. */ diff --git a/packages/slate/src/interfaces/path.ts b/packages/slate/src/interfaces/path.ts index 085508671..0c1303cbf 100644 --- a/packages/slate/src/interfaces/path.ts +++ b/packages/slate/src/interfaces/path.ts @@ -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. */