From 9b2e6a33cfe0348fc59e89050fa14e911ae3f8ec Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 12 Oct 2016 10:08:43 -0700 Subject: [PATCH] Respond to PR comments --- src/compiler/commandLineParser.ts | 16 ++++++++++------ src/compiler/core.ts | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 135cec842e0..8ffae3b8680 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1289,14 +1289,18 @@ namespace ts { function getWildcardDirectoryFromSpec(spec: string, useCaseSensitiveFileNames: boolean): { key: string, flags: WatchDirectoryFlags } | undefined { const match = wildcardDirectoryPattern.exec(spec); - return match - ? { + if (match) { + return { key: useCaseSensitiveFileNames ? match[0] : match[0].toLowerCase(), flags: watchRecursivePattern.test(spec) ? WatchDirectoryFlags.Recursive : WatchDirectoryFlags.None - } - : isImplicitGlob(spec) - ? { key: spec, flags: WatchDirectoryFlags.Recursive } - : undefined; + }; + } + else if (isImplicitGlob(spec)) { + return { key: spec, flags: WatchDirectoryFlags.Recursive }; + } + else { + return undefined; + } } /** diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 81662af91cf..0164d0f4333 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1182,13 +1182,13 @@ namespace ts { */ export function getDirectoryPath(path: Path): Path; export function getDirectoryPath(path: string): string; - export function getDirectoryPath(path: string): any { + export function getDirectoryPath(path: string): string { return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(directorySeparator))); } function getBasename(path: Path): Path; function getBasename(path: string): string; - function getBasename(path: string): any { + function getBasename(path: string): string { return path.substr(Math.max(getRootLength(path), path.lastIndexOf(directorySeparator))); } @@ -1519,7 +1519,7 @@ namespace ts { } /** - * An "includes" path "foo" is implicitly a glob "foo\**\*" (replace \ with /) if its last component has no extension, + * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, * and does not contain any glob characters itself. */ export function isImplicitGlob(lastPathComponent: string): boolean {