Skip to content

Commit

Permalink
build: ensure URL is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Sep 13, 2019
1 parent 325f57d commit 445b50c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/metascraper-helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const isUrl = (url, { relative = false } = {}) =>
relative ? isRelativeUrl(url) || urlRegex.test(url) : urlRegex.test(url)

const absoluteUrl = (baseUrl, relativePath) => {
if (isEmpty(relativePath)) return baseUrl
if (isEmpty(relativePath)) return new URL(baseUrl).toString()
return new URL(relativePath, baseUrl).toString()
}

Expand Down

0 comments on commit 445b50c

Please sign in to comment.