Skip to content

Commit 716d8c7

Browse files
committed
Add improved jsdoc
1 parent a89db46 commit 716d8c7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

index.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1+
/**
2+
* @typedef {import('unist').Node} Node
3+
* @typedef {import('unist').Position} Position
4+
* @typedef {import('vfile').VFile} VFile
5+
* @typedef {import('vfile').VFileValue} VFileValue
6+
*/
7+
18
import {location} from 'vfile-location'
29

310
const search = /\r?\n|\r/g
411

512
/**
6-
* @param {import('unist').Node|import('unist').Position} value Value to get
7-
* @param {import('vfile').VFile|import('vfile').VFileValue} file File in which `value` exists
13+
* Get the source of a node or at a position.
14+
*
15+
* @param {Node|Position} value
16+
* Value to get.
17+
* @param {VFile|VFileValue} file
18+
* File in which `value` exists.
819
* @returns {string|null}
20+
* Source of a node.
921
*/
1022
export function source(value, file) {
1123
const doc = String(file)

0 commit comments

Comments
 (0)