Skip to content

Commit d75f5b7

Browse files
committed
refactor: move removeImports to utils
1 parent 0f0e288 commit d75f5b7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/transpile.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { transpile as tsTranspile } from "typescript";
2-
3-
function removeImports(code: string) {
4-
return code.replace(/^import\s.+\sfrom\s.+;?$/gm, "").trim();
5-
}
2+
import removeImports from "~/utils/removeImports";
63

74
function fixExports(code: string) {
85
const validMethods = ["GET", "POST", "PUT", "PATCH", "DELETE"];

src/utils/removeImports.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function removeImports(code: string) {
2+
return code.replace(/^import\s.+\sfrom\s.+;?$/gm, "").trim();
3+
}

0 commit comments

Comments
 (0)