Comparing version 8.0.0 to 9.0.0
11
index.js
@@ -6,3 +6,3 @@ 'use strict'; | ||
function getUrlsFromQueryParams(url) { | ||
const getUrlsFromQueryParams = url => { | ||
const ret = new Set(); | ||
@@ -18,3 +18,3 @@ const {searchParams} = (new URL(url)); | ||
return ret; | ||
} | ||
}; | ||
@@ -29,3 +29,5 @@ module.exports = (text, options = {}) => { | ||
const add = url => { | ||
ret.add(normalizeUrl(url.trim().replace(/\.+$/, ''), options)); | ||
try { | ||
ret.add(normalizeUrl(url.trim().replace(/\.+$/, ''), options)); | ||
} catch (_) {} | ||
}; | ||
@@ -38,3 +40,4 @@ | ||
if (options.extractFromQueryString) { | ||
for (const qsUrl of getUrlsFromQueryParams(url)) { | ||
const qsUrls = getUrlsFromQueryParams(url); | ||
for (const qsUrl of qsUrls) { | ||
add(qsUrl); | ||
@@ -41,0 +44,0 @@ } |
{ | ||
"name": "get-urls", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"description": "Get all URLs in a string", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
@@ -34,9 +34,9 @@ "scripts": { | ||
"dependencies": { | ||
"normalize-url": "^3.3.0", | ||
"normalize-url": "^4.1.0", | ||
"url-regex": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"xo": "^0.23.0" | ||
"ava": "^1.2.1", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -7,3 +7,5 @@ # get-urls [![Build Status](https://travis-ci.org/sindresorhus/get-urls.svg?branch=master)](https://travis-ci.org/sindresorhus/get-urls) | ||
*Don't use this for any kind of security-related validation.* | ||
## Install | ||
@@ -10,0 +12,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4203
45
67
+ Addednormalize-url@4.5.1(transitive)
- Removednormalize-url@3.3.0(transitive)
Updatednormalize-url@^4.1.0