Skip to content

Commit

Permalink
fix(is_external_link): type (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon authored Sep 4, 2023
1 parent da3d8da commit ca44aac
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 | 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 ca44aac

Please sign in to comment.