Skip to content

Commit

Permalink
refactor: rename normalize-path to normalize-relative-path
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Aug 29, 2024
1 parent 6d497e1 commit c57e0c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/parse-tsconfig/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import slash from 'slash';
import type { TsConfigJson, TsConfigJsonResolved, Cache } from '../types.js';
import { normalizePath } from '../utils/normalize-path.js';
import { normalizeRelativePath } from '../utils/normalize-relative-path.js';
import { readJsonc } from '../utils/read-jsonc.js';
import { implicitBaseUrlSymbol } from '../utils/symbols.js';
import { resolveExtendsPath } from './resolve-extends-path.js';
Expand Down Expand Up @@ -164,7 +164,7 @@ const _parseTsconfig = (
const unresolvedPath = compilerOptions[property];
if (unresolvedPath) {
const resolvedBaseUrl = path.resolve(directoryPath, unresolvedPath);
const relativeBaseUrl = normalizePath(path.relative(
const relativeBaseUrl = normalizeRelativePath(path.relative(
directoryPath,
resolvedBaseUrl,
));
Expand All @@ -181,14 +181,15 @@ const _parseTsconfig = (
if (!config.exclude.includes(outDir)) {
config.exclude.push(outDir);
}
compilerOptions.outDir = normalizePath(outDir);

compilerOptions.outDir = normalizeRelativePath(outDir);
}
} else {
config.compilerOptions = {};
}

if (config.files) {
config.files = config.files.map(normalizePath);
config.files = config.files.map(normalizeRelativePath);
}

if (config.include) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import slash from 'slash';
import { isRelativePathPattern } from './is-relative-path-pattern.js';

export const normalizePath = (filePath: string) => {
export const normalizeRelativePath = (filePath: string) => {
const normalizedPath = slash(filePath);
return isRelativePathPattern.test(normalizedPath)
? normalizedPath
Expand Down

0 comments on commit c57e0c9

Please sign in to comment.