Skip to content

Commit 9b01e09

Browse files
committed
remove redundant conversions between strings and MagicStrings
1 parent c0011ad commit 9b01e09

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,10 @@ export default function afterEffectsJsx(options = { wrap: false }) {
107107
},
108108
});
109109

110+
// wrap entire code in get() method
110111
magicString
111-
.prepend('function get() {\n')
112+
.prepend('get() {\n')
112113
.append(`\nreturn {${exports.join(',\n\t')}}\n}`);
113-
114-
const asString = magicString
115-
.toString()
116-
.replace(`function get() {`, `get() {`);
117-
118-
magicString = new MagicString(asString);
119114
} else {
120115
// Remove non exported nodes and convert
121116
// to object property style compatible syntax

0 commit comments

Comments
 (0)