Respond to PR comments

This commit is contained in:
Andy Hanson 2016-10-12 10:08:43 -07:00
parent 2f77a54ea4
commit 9b2e6a33cf
2 changed files with 13 additions and 9 deletions

View File

@ -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;
}
}
/**

View File

@ -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 {