New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

get-urls

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-urls - npm Package Compare versions

Comparing version 12.0.0 to 12.1.0

19

index.js
import urlRegex from 'url-regex-safe';
import normalizeUrl from 'normalize-url';
import {isMatch, matches} from 'super-regex';

@@ -9,3 +10,3 @@ const getUrlsFromQueryParameters = url => {

for (const [, value] of searchParams) {
if (urlRegex({exact: true}).test(value)) {
if (isMatch(urlRegex({exact: true}), value, {timeout: 500})) {
returnValue.add(value);

@@ -35,10 +36,15 @@ }

const urls = text.match(
const results = matches(
urlRegex(options.requireSchemeOrWww === undefined ? undefined : {
re2: false,
strict: options.requireSchemeOrWww,
parens: true,
}),
) || [];
text,
{
matchTimeout: 500,
},
);
for (const url of urls) {
for (const {match: url} of results) {
add(url);

@@ -54,6 +60,7 @@

for (const excludedItem of options.exclude || []) {
for (const excludedItem of options.exclude ?? []) {
const regex = new RegExp(excludedItem);
for (const item of returnValue) {
if (regex.test(item)) {
if (isMatch(regex, item, {timeout: 500})) {
returnValue.delete(item);

@@ -60,0 +67,0 @@ }

{
"name": "get-urls",
"version": "12.0.0",
"version": "12.1.0",
"description": "Get all URLs in a string",

@@ -40,4 +40,4 @@ "license": "MIT",

"normalize-url": "^8.0.0",
"re2": "^1.19.1",
"url-regex-safe": "^3.0.0"
"super-regex": "^0.2.0",
"url-regex-safe": "^4.0.0"
},

@@ -47,4 +47,4 @@ "devDependencies": {

"tsd": "^0.28.1",
"xo": "^0.55.0"
"xo": "^0.56.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc