Skip to content

Commit 2dfb604

Browse files
authoredAug 2, 2024··
Merge pull request #3 from fiddleplum/fiddleplum-2
fix: Fixed undefined error in resolveTSAliases when compilerOptions.paths is absent.
2 parents 0572b35 + c29fbad commit 2dfb604

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/utils/get-import-declaration-path.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function cleanTsConfig(content: string) {
1919

2020
function resolveTSAlias(tsconfigpath: string, to: string, cwd: string) {
2121
const tsconfig = readFileSync(tsconfigpath, "utf-8");
22-
const aliases = JSON.parse(cleanTsConfig(tsconfig)).compilerOptions
23-
.paths as Record<string, string[]>;
22+
const aliases = (JSON.parse(cleanTsConfig(tsconfig)).compilerOptions
23+
.paths ?? {}) as Record<string, string[]>;
2424

2525
let res = Object.entries(aliases)
2626
// sorting by longest - most qualified - alias

0 commit comments

Comments
 (0)
Please sign in to comment.