Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
monil-patel committed Nov 21, 2023
1 parent 0175389 commit fef96bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ import parsePath from "parse-path";
const parseUrl = (url, normalize = false) => {

// Constants
/**
* ([a-z_][a-z0-9_-]{0,31}) Try to match the user
* ([\w\.\-@]+) Match the host/resource
* (([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?) Match the path, allowing spaces/white
*/
const GIT_RE = /^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:](([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?)$/;

const throwErr = msg => {
const err = new Error(msg)
err.subject_url = url
Expand Down

0 comments on commit fef96bb

Please sign in to comment.