Skip to content

Commit 4e9c3e6

Browse files
thomasmostpvasek
authored andcommitted
use path.sep instead of '/' for path splitting
1 parent c07e2be commit 4e9c3e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { buildFilter } from './buildFilter';
66

77
// We'll use the currentDirectoryName to trim parent fileNames
88
const currentDirectoryPath = process.cwd();
9-
const currentDirectoryParts = currentDirectoryPath.split('/');
9+
const currentDirectoryParts = currentDirectoryPath.split(path.sep);
1010
const currentDirectoryName =
1111
currentDirectoryParts[currentDirectoryParts.length - 1];
1212
export interface StringIndexedObject<T> {
@@ -717,7 +717,7 @@ function getParentType(prop: ts.Symbol): ParentType | undefined {
717717
const parentName = parent.name.text;
718718
const { fileName } = parent.getSourceFile();
719719

720-
const fileNameParts = fileName.split('/');
720+
const fileNameParts = fileName.split(path.sep);
721721
const trimmedFileNameParts = fileNameParts.slice();
722722

723723
while (trimmedFileNameParts.length) {
@@ -728,7 +728,7 @@ function getParentType(prop: ts.Symbol): ParentType | undefined {
728728
}
729729
let trimmedFileName;
730730
if (trimmedFileNameParts.length) {
731-
trimmedFileName = trimmedFileNameParts.join('/');
731+
trimmedFileName = trimmedFileNameParts.join(path.sep);
732732
} else {
733733
trimmedFileName = fileName;
734734
}

0 commit comments

Comments
 (0)