Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
fix: able to add repo name with "."(dot) in it issue#1451 (#1453)
Browse files Browse the repository at this point in the history
fixes #1451
  • Loading branch information
us3r64bit committed Jun 25, 2022
1 parent 4a26b94 commit fcca807
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/util.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export function isValidRepoUrl(url) {
url = url.trim();
url = url.substr(0, 1) === "/" ? url.substr(1) : url;
url = url.toLowerCase().trim();
url = url.substring(0, 1) === "/" ? url.substring(1) : url;

const isRelativeUrl = !(url.substr(0, 4) === "http" || url.includes(".com") || url.includes("www."));
const isRelativeUrl = !(url.substring(0,7) === 'http://' || url.substring(0,8) === 'https://' || url.substring(0,4) === 'www.');
if (isRelativeUrl) {
return relativeUrlValidator(url);
}
Expand Down Expand Up @@ -33,7 +33,7 @@ function absoluteUrlValidator(url) {
const urlObject = new URL(url);

const getIndexGithub = url.indexOf(githubLink) + githubLink.length;
const relativeRepoUrl = url.substr(getIndexGithub, url.length);
const relativeRepoUrl = url.substring(getIndexGithub, url.length);

const [owner, repo] = relativeRepoUrl.split("/");

Expand Down

0 comments on commit fcca807

Please sign in to comment.