Skip to content

Commit

Permalink
Fix regex error
Browse files Browse the repository at this point in the history
  • Loading branch information
spookyuser committed Dec 6, 2024
1 parent 2d13e26 commit 57999ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "badlinks",
"version": "1.0.10",
"version": "1.0.11",
"description": "A fast way to scan a package for links that might upset the chrome webstore team",
"scripts": {
"build": "tsup ./src",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function findJsLinks(folderPath: string, remove: boolean = false): void {
findJsLinks(filePath, remove);
} else if (fileStat.isFile() && path.extname(filePath) === ".js") {
let fileContent = fs.readFileSync(filePath, "utf-8");
const links = fileContent.match(/https?:\/\/[^\s"']+(?:\.js|\/js)(?!.*redux)(\?[^#"'<>]*)?/g);
const links = fileContent.match(/https?:\/\/(?!.*redux)[^\s"]+\.js/g);
if (links) {
console.log(`JS link(s) found in ${filePath}:`);
console.log(links);
Expand Down

0 comments on commit 57999ab

Please sign in to comment.