| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,10 +66,10 @@ export function simple<TState>( | |||
| 66 | 66 | ||
| 67 | 67 | /** | |
| 68 | 68 | * does a 'simple' walk over a tree, building up an array of ancestor nodes (including the current node) and passing the array to the callbacks as a third parameter. | |
| 69 | - * @param node | ||
| 70 | - * @param visitors | ||
| 71 | - * @param base | ||
| 72 | - * @param state | ||
| 69 | + * @param node | ||
| 70 | + * @param visitors | ||
| 71 | + * @param base | ||
| 72 | + * @param state | ||
| 73 | 73 | */ | |
| 74 | 74 | export function ancestor<TState>( | |
| 75 | 75 | node: acorn.Node, | |
@@ -79,8 +79,8 @@ export function ancestor<TState>( | |||
| 79 | 79 | ): void | |
| 80 | 80 | ||
| 81 | 81 | /** | |
| 82 | - * does a 'recursive' walk, where the walker functions are responsible for continuing the walk on the child nodes of their target node. | ||
| 83 | - * @param node | ||
| 82 | + * does a 'recursive' walk, where the walker functions are responsible for continuing the walk on the child nodes of their target node. | ||
| 83 | + * @param node | ||
| 84 | 84 | * @param state the start state | |
| 85 | 85 | * @param functions contain an object that maps node types to walker functions | |
| 86 | 86 | * @param base provides the fallback walker functions for node types that aren't handled in the {@link functions} object. If not given, the default walkers will be used. | |
@@ -94,10 +94,10 @@ export function recursive<TState>( | |||
| 94 | 94 | ||
| 95 | 95 | /** | |
| 96 | 96 | * does a 'full' walk over a tree, calling the {@link callback} with the arguments (node, state, type) for each node | |
| 97 | - * @param node | ||
| 98 | - * @param callback | ||
| 99 | - * @param base | ||
| 100 | - * @param state | ||
| 97 | + * @param node | ||
| 98 | + * @param callback | ||
| 99 | + * @param base | ||
| 100 | + * @param state | ||
| 101 | 101 | */ | |
| 102 | 102 | export function full<TState>( | |
| 103 | 103 | node: acorn.Node, | |
@@ -108,10 +108,10 @@ export function full<TState>( | |||
| 108 | 108 | ||
| 109 | 109 | /** | |
| 110 | 110 | * does a 'full' walk over a tree, building up an array of ancestor nodes (including the current node) and passing the array to the callbacks as a third parameter. | |
| 111 | - * @param node | ||
| 112 | - * @param callback | ||
| 113 | - * @param base | ||
| 114 | - * @param state | ||
| 111 | + * @param node | ||
| 112 | + * @param callback | ||
| 113 | + * @param base | ||
| 114 | + * @param state | ||
| 115 | 115 | */ | |
| 116 | 116 | export function fullAncestor<TState>( | |
| 117 | 117 | node: acorn.Node, | |
@@ -122,8 +122,8 @@ export function fullAncestor<TState>( | |||
| 122 | 122 | ||
| 123 | 123 | /** | |
| 124 | 124 | * builds a new walker object by using the walker functions in {@link functions} and filling in the missing ones by taking defaults from {@link base}. | |
| 125 | - * @param functions | ||
| 126 | - * @param base | ||
| 125 | + * @param functions | ||
| 126 | + * @param base | ||
| 127 | 127 | */ | |
| 128 | 128 | export function make<TState>( | |
| 129 | 129 | functions: RecursiveVisitors<TState>, | |
@@ -132,12 +132,12 @@ export function make<TState>( | |||
| 132 | 132 | ||
| 133 | 133 | /** | |
| 134 | 134 | * tries to locate a node in a tree at the given start and/or end offsets, which satisfies the predicate test. {@link start} and {@link end} can be either `null` (as wildcard) or a `number`. {@link test} may be a string (indicating a node type) or a function that takes (nodeType, node) arguments and returns a boolean indicating whether this node is interesting. {@link base} and {@link state} are optional, and can be used to specify a custom walker. Nodes are tested from inner to outer, so if two nodes match the boundaries, the inner one will be preferred. | |
| 135 | - * @param node | ||
| 136 | - * @param start | ||
| 137 | - * @param end | ||
| 138 | - * @param type | ||
| 139 | - * @param base | ||
| 140 | - * @param state | ||
| 135 | + * @param node | ||
| 136 | + * @param start | ||
| 137 | + * @param end | ||
| 138 | + * @param type | ||
| 139 | + * @param base | ||
| 140 | + * @param state | ||
| 141 | 141 | */ | |
| 142 | 142 | export function findNodeAt<TState>( | |
| 143 | 143 | node: acorn.Node, | |
@@ -150,11 +150,11 @@ export function findNodeAt<TState>( | |||
| 150 | 150 | ||
| 151 | 151 | /** | |
| 152 | 152 | * like {@link findNodeAt}, but will match any node that exists 'around' (spanning) the given position. | |
| 153 | - * @param node | ||
| 154 | - * @param start | ||
| 155 | - * @param type | ||
| 156 | - * @param base | ||
| 157 | - * @param state | ||
| 153 | + * @param node | ||
| 154 | + * @param start | ||
| 155 | + * @param type | ||
| 156 | + * @param base | ||
| 157 | + * @param state | ||
| 158 | 158 | */ | |
| 159 | 159 | export function findNodeAround<TState>( | |
| 160 | 160 | node: acorn.Node, | |
@@ -165,8 +165,13 @@ export function findNodeAround<TState>( | |||
| 165 | 165 | ): Found<TState> | undefined | |
| 166 | 166 | ||
| 167 | 167 | /** | |
| 168 | - * similar to {@link findNodeAround}, but will match all nodes after the given position (testing outer nodes before inner nodes). | ||
| 168 | + * Find the outermost matching node after a given position. | ||
| 169 | 169 | */ | |
| 170 | 170 | export const findNodeAfter: typeof findNodeAround | |
| 171 | 171 | ||
| 172 | + /** | ||
| 173 | + * Find the outermost matching node before a given position. | ||
| 174 | + */ | ||
| 175 | + export const findNodeBefore: typeof findNodeAround | ||
| 176 | + | ||
| 172 | 177 | export const base: RecursiveVisitors<any> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,10 +66,10 @@ export function simple<TState>( | |||
| 66 | 66 | ||
| 67 | 67 | /** | |
| 68 | 68 | * does a 'simple' walk over a tree, building up an array of ancestor nodes (including the current node) and passing the array to the callbacks as a third parameter. | |
| 69 | - * @param node | ||
| 70 | - * @param visitors | ||
| 71 | - * @param base | ||
| 72 | - * @param state | ||
| 69 | + * @param node | ||
| 70 | + * @param visitors | ||
| 71 | + * @param base | ||
| 72 | + * @param state | ||
| 73 | 73 | */ | |
| 74 | 74 | export function ancestor<TState>( | |
| 75 | 75 | node: acorn.Node, | |
@@ -79,8 +79,8 @@ export function ancestor<TState>( | |||
| 79 | 79 | ): void | |
| 80 | 80 | ||
| 81 | 81 | /** | |
| 82 | - * does a 'recursive' walk, where the walker functions are responsible for continuing the walk on the child nodes of their target node. | ||
| 83 | - * @param node | ||
| 82 | + * does a 'recursive' walk, where the walker functions are responsible for continuing the walk on the child nodes of their target node. | ||
| 83 | + * @param node | ||
| 84 | 84 | * @param state the start state | |
| 85 | 85 | * @param functions contain an object that maps node types to walker functions | |
| 86 | 86 | * @param base provides the fallback walker functions for node types that aren't handled in the {@link functions} object. If not given, the default walkers will be used. | |
@@ -94,10 +94,10 @@ export function recursive<TState>( | |||
| 94 | 94 | ||
| 95 | 95 | /** | |
| 96 | 96 | * does a 'full' walk over a tree, calling the {@link callback} with the arguments (node, state, type) for each node | |
| 97 | - * @param node | ||
| 98 | - * @param callback | ||
| 99 | - * @param base | ||
| 100 | - * @param state | ||
| 97 | + * @param node | ||
| 98 | + * @param callback | ||
| 99 | + * @param base | ||
| 100 | + * @param state | ||
| 101 | 101 | */ | |
| 102 | 102 | export function full<TState>( | |
| 103 | 103 | node: acorn.Node, | |
@@ -108,10 +108,10 @@ export function full<TState>( | |||
| 108 | 108 | ||
| 109 | 109 | /** | |
| 110 | 110 | * does a 'full' walk over a tree, building up an array of ancestor nodes (including the current node) and passing the array to the callbacks as a third parameter. | |
| 111 | - * @param node | ||
| 112 | - * @param callback | ||
| 113 | - * @param base | ||
| 114 | - * @param state | ||
| 111 | + * @param node | ||
| 112 | + * @param callback | ||
| 113 | + * @param base | ||
| 114 | + * @param state | ||
| 115 | 115 | */ | |
| 116 | 116 | export function fullAncestor<TState>( | |
| 117 | 117 | node: acorn.Node, | |
@@ -122,8 +122,8 @@ export function fullAncestor<TState>( | |||
| 122 | 122 | ||
| 123 | 123 | /** | |
| 124 | 124 | * builds a new walker object by using the walker functions in {@link functions} and filling in the missing ones by taking defaults from {@link base}. | |
| 125 | - * @param functions | ||
| 126 | - * @param base | ||
| 125 | + * @param functions | ||
| 126 | + * @param base | ||
| 127 | 127 | */ | |
| 128 | 128 | export function make<TState>( | |
| 129 | 129 | functions: RecursiveVisitors<TState>, | |
@@ -132,12 +132,12 @@ export function make<TState>( | |||
| 132 | 132 | ||
| 133 | 133 | /** | |
| 134 | 134 | * tries to locate a node in a tree at the given start and/or end offsets, which satisfies the predicate test. {@link start} and {@link end} can be either `null` (as wildcard) or a `number`. {@link test} may be a string (indicating a node type) or a function that takes (nodeType, node) arguments and returns a boolean indicating whether this node is interesting. {@link base} and {@link state} are optional, and can be used to specify a custom walker. Nodes are tested from inner to outer, so if two nodes match the boundaries, the inner one will be preferred. | |
| 135 | - * @param node | ||
| 136 | - * @param start | ||
| 137 | - * @param end | ||
| 138 | - * @param type | ||
| 139 | - * @param base | ||
| 140 | - * @param state | ||
| 135 | + * @param node | ||
| 136 | + * @param start | ||
| 137 | + * @param end | ||
| 138 | + * @param type | ||
| 139 | + * @param base | ||
| 140 | + * @param state | ||
| 141 | 141 | */ | |
| 142 | 142 | export function findNodeAt<TState>( | |
| 143 | 143 | node: acorn.Node, | |
@@ -150,11 +150,11 @@ export function findNodeAt<TState>( | |||
| 150 | 150 | ||
| 151 | 151 | /** | |
| 152 | 152 | * like {@link findNodeAt}, but will match any node that exists 'around' (spanning) the given position. | |
| 153 | - * @param node | ||
| 154 | - * @param start | ||
| 155 | - * @param type | ||
| 156 | - * @param base | ||
| 157 | - * @param state | ||
| 153 | + * @param node | ||
| 154 | + * @param start | ||
| 155 | + * @param type | ||
| 156 | + * @param base | ||
| 157 | + * @param state | ||
| 158 | 158 | */ | |
| 159 | 159 | export function findNodeAround<TState>( | |
| 160 | 160 | node: acorn.Node, | |
@@ -165,8 +165,13 @@ export function findNodeAround<TState>( | |||
| 165 | 165 | ): Found<TState> | undefined | |
| 166 | 166 | ||
| 167 | 167 | /** | |
| 168 | - * similar to {@link findNodeAround}, but will match all nodes after the given position (testing outer nodes before inner nodes). | ||
| 168 | + * Find the outermost matching node after a given position. | ||
| 169 | 169 | */ | |
| 170 | 170 | export const findNodeAfter: typeof findNodeAround | |
| 171 | 171 | ||
| 172 | + /** | ||
| 173 | + * Find the outermost matching node before a given position. | ||
| 174 | + */ | ||
| 175 | + export const findNodeBefore: typeof findNodeAround | ||
| 176 | + | ||
| 172 | 177 | export const base: RecursiveVisitors<any> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | ], | |
| 17 | 17 | "./package.json": "./package.json" | |
| 18 | 18 | }, | |
| 19 | - "version": "8.3.1", | ||
| 19 | + "version": "8.3.2", | ||
| 20 | 20 | "engines": { | |
| 21 | 21 | "node": ">=0.4.0" | |
| 22 | 22 | }, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments