@metascraper/helpers
Advanced tools
Comparing version 4.3.2 to 4.3.5
10
index.js
@@ -45,7 +45,5 @@ 'use strict' | ||
const urlTest = (url, { relative = true }) => | ||
const isUrl = (url, { relative = false } = {}) => | ||
relative ? isRelativeUrl(url) || urlRegex.test(url) : urlRegex.test(url) | ||
const isUrl = (url, opts = {}) => !isEmpty(url) && urlTest(url, opts) | ||
const absoluteUrl = (baseUrl, relativePath = '') => | ||
@@ -122,3 +120,7 @@ resolveUrl(baseUrl, relativePath) | ||
const url = (value, { url }) => isUrl(value) && normalizeUrl(url, value) | ||
const url = (value, { url }) => { | ||
if (isEmpty(value)) return false | ||
const absoluteUrl = normalizeUrl(url, value) | ||
return isUrl(absoluteUrl) && absoluteUrl | ||
} | ||
@@ -125,0 +127,0 @@ const date = value => { |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://metascraper.js.org", | ||
"version": "4.3.2", | ||
"version": "4.3.5", | ||
"main": "src/index.js", | ||
@@ -53,3 +53,3 @@ "repository": { | ||
"license": "MIT", | ||
"gitHead": "0ece28808358c9a61799bff9ea1efb113de01711" | ||
"gitHead": "049ef06601c38db725f788f3e2c5706cd3e6cd3d" | ||
} |
8217
139