Update src/compiler/sys.ts

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
Sheetal Nandi 2019-08-09 13:57:47 -07:00 committed by GitHub
parent 8cf8eb1720
commit 8d902ad75f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1033,7 +1033,12 @@ namespace ts {
function fsWatch(fileOrDirectory: string, entryKind: FileSystemEntryKind.File | FileSystemEntryKind.Directory, callback: FsWatchCallback, recursive: boolean, fallbackPollingWatchFile: HostWatchFile, pollingInterval?: number): FileWatcher {
let options: any;
const lastDirectoryPartWithDirectorySeparator = isLinuxOrMacOs ?
let lastDirectoryPartWithDirectorySeparator: string | undefined;
let lastDirectoryPart: string | undefined;
if (isLinuxOrMacOs) {
lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substr(fileOrDirectory.lastIndexOf(directorySeparator));
lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(directorySeparator.length);
}
fileOrDirectory.substr(fileOrDirectory.lastIndexOf(directorySeparator)) :
undefined;
const lastDirectoryPart = isLinuxOrMacOs ?