Skip to content

Commit 890150c

Browse files
committed
Change to pass undefined, not null
1 parent 3c59a1c commit 890150c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
* Parent of the section.
123123
* @property {number} start
124124
* Index of `start` in `parent`.
125-
* @property {number | null} end
125+
* @property {number | undefined} end
126126
* Index of `end` in `parent`.
127127
*
128128
* @typedef Options
@@ -151,7 +151,6 @@
151151
import {ok as assert} from 'devlop'
152152
import {toString} from 'mdast-util-to-string'
153153

154-
// To do: next major: remove `null` in API output.
155154
// To do: next major: remove `value` parameter in `TestFunction`?
156155
// Add support for `unist-util-is`?
157156

@@ -255,7 +254,7 @@ export function headingRange(tree, options, handler) {
255254
const nodes = handler(head, from, children[end], {
256255
parent,
257256
start,
258-
end: children[end] ? end : null
257+
end: children[end] ? end : undefined
259258
})
260259

261260
if (nodes) {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Extra info (TypeScript type).
183183
— parent of the section
184184
* `start` (`number`)
185185
— index of `start` in `parent`
186-
* `end` (`number` or `null`)
186+
* `end` (`number` or `undefined`)
187187
— index of `end` in `parent`
188188

189189
### `Options`

0 commit comments

Comments
 (0)