Skip to content

Commit 35ec155

Browse files
committed
moved getCanonicalName to 'core'
1 parent 56f29e0 commit 35ec155

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/compiler/core.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,12 @@ module ts {
464464
return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension;
465465
}
466466

467+
export function getCanonicalFileName(fileName: string): string {
468+
// if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form.
469+
// otherwise use toLowerCase as a canonical form.
470+
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
471+
}
472+
467473
export interface ObjectAllocator {
468474
getNodeConstructor(kind: SyntaxKind): new () => Node;
469475
getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;

src/compiler/sys.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,4 @@ var sys: System = (function () {
222222
else {
223223
return undefined; // Unsupported host
224224
}
225-
})();
226-
227-
function getCanonicalFileName(fileName: string): string {
228-
// if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form.
229-
// otherwise use toLowerCase as a canonical form.
230-
return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
231-
}
225+
})();

0 commit comments

Comments
 (0)