Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

linkinator

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkinator - npm Package Compare versions

Comparing version 1.7.4 to 1.7.5

26

build/src/links.js

@@ -40,8 +40,32 @@ "use strict";

});
let realBaseUrl = baseUrl;
const base = $('base[href]');
if (base.length) {
// only first <base by specification
const htmlBaseUrl = base.first().attr('href');
realBaseUrl = getBaseUrl(htmlBaseUrl, baseUrl);
}
const sanitized = links
.filter(link => !!link)
.map(link => parseLink(link, baseUrl));
.map(link => parseLink(link, realBaseUrl));
return sanitized;
}
exports.getLinks = getLinks;
function getBaseUrl(htmlBaseUrl, oldBaseUrl) {
if (isAbsoluteUrl(htmlBaseUrl)) {
return htmlBaseUrl;
}
const url = new url_1.URL(htmlBaseUrl, oldBaseUrl);
url.hash = '';
return url.href;
}
function isAbsoluteUrl(url) {
// Don't match Windows paths
if (/^[a-zA-Z]:\\/.test(url)) {
return false;
}
// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
return /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
}
function parseAttr(name, value) {

@@ -48,0 +72,0 @@ switch (name) {

2

package.json
{
"name": "linkinator",
"description": "Find broken links, missing images, etc in your HTML. Scurry around your site and find all those broken links.",
"version": "1.7.4",
"version": "1.7.5",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "JustinBeckwith/linkinator",

Sorry, the diff of this file is not supported yet

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