Skip to content

Commit

Permalink
Merge branch 'allow-dot-in-git-urls' of github.com:GalHalupSeaLights/…
Browse files Browse the repository at this point in the history
…parse-url into new-version
  • Loading branch information
IonicaBizau committed Aug 3, 2022
2 parents d98fd46 + bdd9745 commit 72c00c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -36,7 +36,7 @@ import normalizeUrl from "normalize-url";
const parseUrl = (url, normalize = false) => {

// Constants
const GIT_RE = /(^(git@|http(s)?:\/\/)([\w\.\-@]+)(\/|:))(([\~,\w,\-,\_,\/]+)(.git){0,1}((\/){0,1}))/
const GIT_RE = /(^(git@|http(s)?:\/\/)([\w\.\-@]+)(\/|:))(([\~,\.\w,\-,\_,\/]+)(.git){0,1}((\/){0,1}))/

if (typeof url !== "string" || !url.trim()) {
const err = new Error("Invalid url.")
Expand Down
15 changes: 15 additions & 0 deletions test/index.js
Expand Up @@ -125,6 +125,21 @@ const INPUTS = [
, query: {}
}
]
, [
["git@github.com:halup/Cloud.API.Gateway.git", false]
, {
protocols: [ "ssh" ]
, protocol: "ssh"
, port: ""
, resource: "github.com"
, host: "github.com"
, user: "git"
, pathname: "/halup/Cloud.API.Gateway.git"
, hash: ""
, search: ""
, query: {}
}
]
];

tester.describe("check urls", test => {
Expand Down

0 comments on commit 72c00c0

Please sign in to comment.