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.1.1 to 1.1.2

28

build/src/index.js

@@ -43,3 +43,9 @@ "use strict";

}
const results = yield this.crawl({ url: options.path, crawl: true, checkOptions: options });
const results = yield this.crawl({
url: options.path,
crawl: true,
checkOptions: options,
results: [],
cache: new Set()
});
const result = {

@@ -76,9 +82,7 @@ links: results,

return __awaiter(this, void 0, void 0, function* () {
opts.results = opts.results || [];
opts.cache = opts.cache || [];
// Check to see if we've already scanned this url
if (opts.cache.includes(opts.url)) {
if (opts.cache.has(opts.url)) {
return opts.results;
}
opts.cache.push(opts.url);
opts.cache.add(opts.url);
// Check for links that should be skipped

@@ -101,4 +105,4 @@ const skips = opts.checkOptions.linksToSkip

try {
const res = yield gaxios.request({
method: 'GET',
let res = yield gaxios.request({
method: opts.crawl ? 'GET' : 'HEAD',
url: opts.url,

@@ -108,2 +112,12 @@ responseType: opts.crawl ? 'text' : 'stream',

});
// If we got an HTTP 405, the server may not like HEAD. GET instead!
if (res.status === 405) {
res = yield gaxios.request({
method: 'GET',
url: opts.url,
responseType: 'stream',
validateStatus: () => true
});
}
// Assume any 2xx status is 👌
status = res.status;

@@ -110,0 +124,0 @@ if (res.status >= 200 && res.status < 300) {

{
"name": "linkinator",
"description": "Find broken links, missing images, etc in your HTML.",
"version": "1.1.1",
"version": "1.1.2",
"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