-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parseTsconfig): handle absolute baseUrl (#51)
- Loading branch information
1 parent
ea1b356
commit 136acf4
Showing
5 changed files
with
127 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
// Only works on POSIX paths. Apply `slash` first. | ||
export const isRelativePathPattern = /^\.{1,2}(\/.*)?$/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import slash from 'slash'; | ||
import { isRelativePathPattern } from './is-relative-path-pattern.js'; | ||
|
||
export const normalizePath = (filePath: string) => slash( | ||
isRelativePathPattern.test(filePath) | ||
? filePath | ||
: `./${filePath}`, | ||
); | ||
export const normalizePath = (filePath: string) => { | ||
const normalizedPath = slash(filePath); | ||
return isRelativePathPattern.test(normalizedPath) | ||
? normalizedPath | ||
: `./${normalizedPath}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters