Skip to content

Commit 45cb3fc

Browse files
committed
Change to return undefined
1 parent 45ec440 commit 45cb3fc

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

lib/index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@ const max = 6
1717
* Make sure that there is only one top-level heading in the document by
1818
* adjusting headings depths accordingly.
1919
*
20-
* @template {Node} Tree
21-
* Node type.
22-
* @param {Tree} tree
20+
* @param {Node} tree
2321
* Tree to change.
24-
* @returns {Tree}
25-
* Given, modified, `tree`.
22+
* @returns {undefined}
23+
* Nothing.
2624
*/
27-
// To do: next major: don’t return `tree`.
2825
export function normalizeHeadings(tree) {
2926
/** @type {Array<Heading>} */
3027
const all = []
@@ -66,6 +63,4 @@ export function normalizeHeadings(tree) {
6663
}
6764
}
6865
}
69-
70-
return tree
7166
}

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ headings depths accordingly.
111111

112112
###### Returns
113113

114-
Given, modified, `tree` ([`Node`][node]).
114+
Nothing (`undefined`).
115115

116116
## Types
117117

test/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ test('normalizeHeadings', async function (t) {
3636
)
3737
const actual = fromMarkdown(input)
3838
const expected = fromMarkdown(output)
39+
3940
normalizeHeadings(actual)
41+
removePosition(actual, true)
42+
removePosition(expected, true)
4043

41-
assert.deepEqual(
42-
removePosition(actual, true),
43-
removePosition(expected, true)
44-
)
44+
assert.deepEqual(actual, expected)
4545
})
4646
}
4747
})

0 commit comments

Comments
 (0)