diff --git a/lib/index.js b/lib/index.js index 91aca3c..483a62e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -37,7 +37,7 @@ const parsePath = require("parse-path") 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.")