We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a89db46 commit 716d8c7Copy full SHA for 716d8c7
index.js
@@ -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
+
8
import {location} from 'vfile-location'
9
10
const search = /\r?\n|\r/g
11
12
/**
- * @param {import('unist').Node|import('unist').Position} value Value to get
- * @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.
19
* @returns {string|null}
20
+ * Source of a node.
21
*/
22
export function source(value, file) {
23
const doc = String(file)
0 commit comments