Skip to content

Commit cc14892

Browse files
committed
Add improved jsdoc
1 parent d262197 commit cc14892

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

index.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99

1010
import {convert} from 'unist-util-is'
1111

12+
/**
13+
* Find the first node in `parent` before another `node` or before an index,
14+
* that passes `test`.
15+
16+
* @param parent
17+
* Parent node.
18+
* @param index
19+
* Child of `parent`, or it’s index.
20+
* @param [test]
21+
* `unist-util-is`-compatible test.
22+
* @returns
23+
*
24+
*/
1225
export const findBefore =
1326
/**
1427
* @type {(
@@ -18,9 +31,9 @@ export const findBefore =
1831
*/
1932
(
2033
/**
21-
* @param {Parent} parent Parent node
22-
* @param {Node|number} index Child of `parent`, or it’s index
23-
* @param {null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything>} [test] is-compatible test (such as a type)
34+
* @param {Parent} parent
35+
* @param {Node|number} index
36+
* @param {null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything>} [test]
2437
* @returns {Node|null}
2538
*/
2639
function (parent, index, test) {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ There is no default export.
9292

9393
### `findBefore(parent, node|index[, test])`
9494

95-
Find the first node in `parent` ([`Parent`][parent]) before another node
95+
Find the first node in `parent` ([`Parent`][parent]) before another `node`
9696
([`Node`][node]) or before an index, that passes `test` (`Test` from
9797
[`unist-util-is`][test]).
9898

0 commit comments

Comments
 (0)