mirror of https://github.com/webpack/webpack.git
				
				
				
			feat: make RexExps case-insensitive
This commit is contained in:
		
							parent
							
								
									cc3149b38c
								
							
						
					
					
						commit
						e4fcce4541
					
				| 
						 | 
					@ -13,14 +13,14 @@ const { join, dirname, readJson } = require("../util/fs");
 | 
				
			||||||
const RE_URL_GITHUB_EXTREME_SHORT = /^[^/@:.\s][^/@:\s]*\/[^@:\s]*[^/@:\s]#\S+/;
 | 
					const RE_URL_GITHUB_EXTREME_SHORT = /^[^/@:.\s][^/@:\s]*\/[^@:\s]*[^/@:\s]#\S+/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Short url with specific protocol. eg: github:foo/bar
 | 
					// Short url with specific protocol. eg: github:foo/bar
 | 
				
			||||||
const RE_GIT_URL_SHORT = /^(github|gitlab|bitbucket|gist):\/?[^/.]+\/?/;
 | 
					const RE_GIT_URL_SHORT = /^(github|gitlab|bitbucket|gist):\/?[^/.]+\/?/i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Currently supported protocols
 | 
					// Currently supported protocols
 | 
				
			||||||
const RE_PROTOCOL =
 | 
					const RE_PROTOCOL =
 | 
				
			||||||
	/^((git\+)?(ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/;
 | 
						/^((git\+)?(ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Has custom protocol
 | 
					// Has custom protocol
 | 
				
			||||||
const RE_CUSTOM_PROTOCOL = /^((git\+)?(ssh|https?|file)|git):\/\//;
 | 
					const RE_CUSTOM_PROTOCOL = /^((git\+)?(ssh|https?|file)|git):\/\//i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Valid hash format for npm / yarn ...
 | 
					// Valid hash format for npm / yarn ...
 | 
				
			||||||
const RE_URL_HASH_VERSION = /#(?:semver:)?(.+)/;
 | 
					const RE_URL_HASH_VERSION = /#(?:semver:)?(.+)/;
 | 
				
			||||||
| 
						 | 
					@ -262,7 +262,7 @@ function getGitUrlVersion(gitUrl) {
 | 
				
			||||||
		return "";
 | 
							return "";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!PROTOCOLS_FOR_SHORT.includes(protocol)) {
 | 
						if (!PROTOCOLS_FOR_SHORT.includes(protocol.toLowerCase())) {
 | 
				
			||||||
		if (!RE_HOSTNAME.test(hostname)) {
 | 
							if (!RE_HOSTNAME.test(hostname)) {
 | 
				
			||||||
			return "";
 | 
								return "";
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue