Skip to content

Commit 646ba34

Browse files
fix: harden type qualifier keywords
1 parent 902f243 commit 646ba34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patch-ts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ for (const file of files) {
77
const cts = file.replace('.d.ts', '.d.cts')
88

99
// Add type qualifiers in annotations
10-
shell.sed('-i', /(import|export )*\s+(?!type\b)/, '$1 type ', file)
10+
shell.sed('-i', /(import|export)\s+(?!(type|enum|interface|class|function|const)\b)/, '$1 type ', file)
1111
// Remove .js extensions
1212
shell.sed('-i', /from '(\.[^.]+)\.js'/, "from '$1'", file)
1313

0 commit comments

Comments
 (0)