Skip to content

Commit

Permalink
Expanded list of ignoredURLs
Browse files Browse the repository at this point in the history
  • Loading branch information
justindhillon committed Mar 17, 2024
1 parent 83a8908 commit 29426f7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions checkLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ const axios = require("axios");

// Return true if link is broken
export async function checkLink(link: string): Promise<boolean> {
const ignoredCodes: Set<number> = new Set([999, 429, 403, 401]);
const ignoredURLs: Set<string> = new Set(['example.com']);
const ignoredCodes: Set<number> = new Set([
999,
429,
403,
401
]);

const ignoredURLs: Set<string> = new Set([
'example.com',
'www.example.com',
'example.org',
'www.example.org',
'goo.gl',
'fonts.googleapis.com',
'fonts.gstatic.com'
]);

const url = new URL(link);
if (ignoredURLs.has(url.host)) {
Expand Down

0 comments on commit 29426f7

Please sign in to comment.