Skip to content

Commit e7a971b

Browse files
authored
fix: update line when removing declare statements (#9252)
1 parent e891920 commit e7a971b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

release/core/publish/steps/generate-tarballs.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ async function convertFileToModule(fileData: string, relativePath: string, pkgNa
173173
const moduleName = maybeModuleName.endsWith('/index') ? maybeModuleName.slice(0, -6) : maybeModuleName;
174174

175175
for (let i = 0; i < lines.length; i++) {
176-
const line = lines[i].replace(/^declare /, '').replaceAll(' declare ', '');
176+
lines[i] = lines[i].replace(/^declare /, '').replaceAll(' declare ', ' ');
177+
const line = lines[i];
178+
177179
if (line.startsWith('import ')) {
178180
if (!line.includes(`'`)) {
179181
throw new Error(`Unhandled import in ${relativePath}`);

0 commit comments

Comments
 (0)