File tree 3 files changed +8
-13
lines changed 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,11 @@ const max = 6
17
17
* Make sure that there is only one top-level heading in the document by
18
18
* adjusting headings depths accordingly.
19
19
*
20
- * @template {Node} Tree
21
- * Node type.
22
- * @param {Tree } tree
20
+ * @param {Node } tree
23
21
* Tree to change.
24
- * @returns {Tree }
25
- * Given, modified, `tree` .
22
+ * @returns {undefined }
23
+ * Nothing .
26
24
*/
27
- // To do: next major: don’t return `tree`.
28
25
export function normalizeHeadings ( tree ) {
29
26
/** @type {Array<Heading> } */
30
27
const all = [ ]
@@ -66,6 +63,4 @@ export function normalizeHeadings(tree) {
66
63
}
67
64
}
68
65
}
69
-
70
- return tree
71
66
}
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ headings depths accordingly.
111
111
112
112
###### Returns
113
113
114
- Given, modified, ` tree ` ( [ ` Node ` ] [ node ] ).
114
+ Nothing ( ` undefined ` ).
115
115
116
116
## Types
117
117
Original file line number Diff line number Diff line change @@ -36,12 +36,12 @@ test('normalizeHeadings', async function (t) {
36
36
)
37
37
const actual = fromMarkdown ( input )
38
38
const expected = fromMarkdown ( output )
39
+
39
40
normalizeHeadings ( actual )
41
+ removePosition ( actual , true )
42
+ removePosition ( expected , true )
40
43
41
- assert . deepEqual (
42
- removePosition ( actual , true ) ,
43
- removePosition ( expected , true )
44
- )
44
+ assert . deepEqual ( actual , expected )
45
45
} )
46
46
}
47
47
} )
You can’t perform that action at this time.
0 commit comments