diff --git a/src/utils/get-import-declaration-path.ts b/src/utils/get-import-declaration-path.ts index 019ee28..903b126 100644 --- a/src/utils/get-import-declaration-path.ts +++ b/src/utils/get-import-declaration-path.ts @@ -19,8 +19,8 @@ function cleanTsConfig(content: string) { function resolveTSAlias(tsconfigpath: string, to: string, cwd: string) { const tsconfig = readFileSync(tsconfigpath, "utf-8"); - const aliases = JSON.parse(cleanTsConfig(tsconfig)).compilerOptions - .paths as Record; + const aliases = (JSON.parse(cleanTsConfig(tsconfig)).compilerOptions + .paths ?? {}) as Record; let res = Object.entries(aliases) // sorting by longest - most qualified - alias