Respond to PR comments

This commit is contained in:
Andy Hanson
2016-10-24 06:48:05 -07:00
parent 9b2e6a33cf
commit 7157692191
2 changed files with 6 additions and 8 deletions

View File

@@ -1295,12 +1295,10 @@ namespace ts {
flags: watchRecursivePattern.test(spec) ? WatchDirectoryFlags.Recursive : WatchDirectoryFlags.None
};
}
else if (isImplicitGlob(spec)) {
if (isImplicitGlob(spec)) {
return { key: spec, flags: WatchDirectoryFlags.Recursive };
}
else {
return undefined;
}
return undefined;
}
/**

View File

@@ -1515,7 +1515,9 @@ namespace ts {
return undefined;
}
return "^(" + pattern + (usage === "exclude" ? ")($|/)" : ")$");
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
const terminator = usage === "exclude" ? "($|/)" : "$";
return `^(${pattern})${terminator}`;
}
/**
@@ -1711,9 +1713,7 @@ namespace ts {
? absolute
: removeTrailingDirectorySeparator(getDirectoryPath(absolute));
}
else {
return absolute.substring(0, absolute.lastIndexOf(directorySeparator, wildcardOffset));
}
return absolute.substring(0, absolute.lastIndexOf(directorySeparator, wildcardOffset));
}
export function ensureScriptKind(fileName: string, scriptKind?: ScriptKind): ScriptKind {