Merge pull request #27035 from Microsoft/fixTypesVersionTests

Sanitize module resolution logs for typesVersions entries
This commit is contained in:
Ron Buckton
2018-09-11 14:45:39 -07:00
committed by GitHub
3 changed files with 25 additions and 1 deletions

View File

@@ -7671,6 +7671,15 @@ namespace ts {
// It may be inefficient (we could just match (/[-[\]{}()*+?.,\\^$|#\s]/g), but this is future
// proof.
const reservedCharacterPattern = /[^\w\s\/]/g;
export function regExpEscape(text: string) {
return text.replace(reservedCharacterPattern, escapeRegExpCharacter);
}
function escapeRegExpCharacter(match: string) {
return "\\" + match;
}
const wildcardCharCodes = [CharacterCodes.asterisk, CharacterCodes.question];
export function hasExtension(fileName: string): boolean {