Skip to content

Commit 9df3a7c

Browse files
committed
improve comments
1 parent 9b01e09 commit 9df3a7c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ export default function afterEffectsJsx(options = { wrap: false }) {
8080
});
8181

8282
if (wrap) {
83+
// Remove expression globals and unsupported code
84+
// then wrap in get() method. Less work is needed in this case
85+
// everything is wrapped in a single function
8386
walk(ast, {
8487
enter(node, parent) {
8588
Object.defineProperty(node, 'parent', {
@@ -92,8 +95,9 @@ export default function afterEffectsJsx(options = { wrap: false }) {
9295
const variableName = node.declarations.map(
9396
(declaration) => declaration.id.name
9497
)[0];
98+
9599
if (expressionGlobals.includes(variableName)) {
96-
// Remove variables that aren't exported
100+
// Remove temporary expression global declarations
97101
remove(node.start, node.end);
98102
}
99103
// don't process child nodes

0 commit comments

Comments
 (0)