Skip to content

Commit 13da6ad

Browse files
committed
Change to yield undefined
1 parent c54dd65 commit 13da6ad

File tree

3 files changed

+845
-809
lines changed

3 files changed

+845
-809
lines changed

lib/index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,13 @@ const regex = /@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g
112112
* which throws by default in Babel or can be turned on with `throwIfNamespace`
113113
* * no `useSpread`, `useBuiltIns`, or `filter` options
114114
*
115-
* @template {Node} Tree
116-
* Node type.
117-
* @param {Tree} tree
115+
* @param {Node} tree
118116
* Tree to transform (typically `Program`).
119117
* @param {Options | null | undefined} [options]
120118
* Configuration (optional).
121-
* @returns {Tree}
122-
* Given, modified, `tree`.
119+
* @returns {undefined}
120+
* Nothing.
123121
*/
124-
// To do next major: do not return the given Node.
125122
export function buildJsx(tree, options) {
126123
const config = options || {}
127124
let automatic = config.runtime === 'automatic'
@@ -480,8 +477,6 @@ export function buildJsx(tree, options) {
480477
this.replace(call)
481478
}
482479
})
483-
484-
return tree
485480
}
486481

487482
/**

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* [Install](#install)
1818
* [Use](#use)
1919
* [API](#api)
20-
* [`buildJsx(tree, options?)`](#buildjsxtree-options)
20+
* [`buildJsx(tree[, options])`](#buildjsxtree-options)
2121
* [`Options`](#options)
2222
* [`Runtime`](#runtime-1)
2323
* [Examples](#examples)
@@ -126,7 +126,7 @@ console.log(x(null, null, 1 + 1, x("self-closing"), x("x", Object.assign({
126126
This package exports the identifier [`buildJsx`][build-jsx].
127127
There is no default export.
128128

129-
### `buildJsx(tree, options?)`
129+
### `buildJsx(tree[, options])`
130130

131131
Turn JSX in `tree` into function calls: `<x />` -> `h('x')`!
132132

@@ -152,7 +152,7 @@ Some differences:
152152

153153
###### Returns
154154

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

157157
### `Options`
158158

0 commit comments

Comments
 (0)