Skip to content

Commit 8669873

Browse files
committed
fix: accessing length in map
1 parent 2fbac76 commit 8669873

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ function wrapExportsInQuotes(exports, code) {
157157
}
158158

159159
function separateExportsWithCommas(exports, code) {
160-
let codeLines = code.split("\n").map((line, lineIndex) => {
160+
let codeLines = code.split("\n");
161+
const fixedLines = codeLines.map((line, lineIndex) => {
161162
let newLine = line;
162163
exports.forEach((name, exportIndex) => {
163164
if (line.startsWith(`"${name}"`)) {
@@ -172,7 +173,7 @@ function separateExportsWithCommas(exports, code) {
172173
}
173174
return newLine;
174175
});
175-
return codeLines.join("\n");
176+
return fixedLines.join("\n");
176177
}
177178

178179
function indentAllLines(code) {

0 commit comments

Comments
 (0)