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+/;
|
||||
|
||||
// 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
|
||||
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
|
||||
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 ...
|
||||
const RE_URL_HASH_VERSION = /#(?:semver:)?(.+)/;
|
||||
|
|
@ -262,7 +262,7 @@ function getGitUrlVersion(gitUrl) {
|
|||
return "";
|
||||
}
|
||||
|
||||
if (!PROTOCOLS_FOR_SHORT.includes(protocol)) {
|
||||
if (!PROTOCOLS_FOR_SHORT.includes(protocol.toLowerCase())) {
|
||||
if (!RE_HOSTNAME.test(hostname)) {
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue