Skip to content

Commit

Permalink
fix(is_external_link): correcting type annotation (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
liby authored Aug 22, 2023
1 parent 022c4d7 commit 7dda4e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/is_external_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const cache = new Cache<boolean>();
* @returns {Boolean} True if the link doesn't have protocol or link has same host with config.url
*/

function isExternalLink(input: string, sitehost: string, exclude: string[]): boolean {
function isExternalLink(input: string, sitehost: string, exclude?: string[]): boolean {
return cache.apply(`${input}-${sitehost}-${exclude}`, () => {
// Return false early for internal link
if (!/^(\/\/|http(s)?:)/.test(input)) return false;
Expand Down

0 comments on commit 7dda4e5

Please sign in to comment.