mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Merge pull request #27035 from Microsoft/fixTypesVersionTests
Sanitize module resolution logs for typesVersions entries
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user