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

jsonld

Package Overview
Dependencies
Maintainers
5
Versions
214
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonld - npm Package Compare versions

Comparing version 5.2.0 to 6.0.0

20

lib/documentLoaders/node.js

@@ -83,2 +83,3 @@ /*

doc = {contextUrl: null, documentUrl: url, document: body || null};
// handle error

@@ -96,3 +97,5 @@ const statusText = http.STATUS_CODES[res.status];

const link = res.headers.get('link');
let location = res.headers.get('location');
const contentType = res.headers.get('content-type');
// handle Link Header

@@ -115,3 +118,3 @@ if(link && contentType !== 'application/ld+json') {

// "alternate" link header is a redirect
alternate = linkHeaders['alternate'];
alternate = linkHeaders.alternate;
if(alternate &&

@@ -121,6 +124,6 @@ alternate.type == 'application/ld+json' &&

.match(/^application\/(\w*\+)?json$/)) {
res.headers.set('location', prependBase(url, alternate.target));
location = prependBase(url, alternate.target);
}
}
const location = res.headers.get('location');
// handle redirect

@@ -150,3 +153,5 @@ if((alternate ||

redirects.push(url);
return loadDocument(location, redirects);
// location can be relative, turn into full url
const nextUrl = new URL(location, url).href;
return loadDocument(nextUrl, redirects);
}

@@ -171,3 +176,8 @@

try {
const options = {headers, redirect: 'manual'};
const options = {
headers,
redirect: 'manual',
// ky specific to avoid redirects throwing
throwHttpErrors: false
};
const isHttps = url.startsWith('https:');

@@ -174,0 +184,0 @@ if(isHttps) {

@@ -93,3 +93,3 @@ /*

// "alternate" link header is a redirect
alternate = linkHeaders['alternate'];
alternate = linkHeaders.alternate;
if(alternate &&

@@ -96,0 +96,0 @@ alternate.type == 'application/ld+json' &&

@@ -133,3 +133,3 @@ /*

}
const rel = result['rel'] || '';
const rel = result.rel || '';
if(Array.isArray(rval[rel])) {

@@ -136,0 +136,0 @@ rval[rel].push(result);

{
"name": "jsonld",
"version": "5.2.0",
"version": "6.0.0",
"description": "A JSON-LD Processor and API implementation in JavaScript.",

@@ -32,3 +32,3 @@ "homepage": "https://github.com/digitalbazaar/jsonld.js",

"dependencies": {
"@digitalbazaar/http-client": "^1.1.0",
"@digitalbazaar/http-client": "^3.2.0",
"canonicalize": "^1.0.1",

@@ -82,3 +82,3 @@ "lru-cache": "^6.0.0",

"engines": {
"node": ">=12"
"node": ">=14"
},

@@ -94,3 +94,3 @@ "keywords": [

"scripts": {
"prepublish": "npm run build",
"prepack": "npm run build",
"build": "npm run build-webpack",

@@ -110,3 +110,3 @@ "build-webpack": "webpack",

"coverage-report": "nyc report",
"lint": "eslint *.js lib/**.js tests/**.js"
"lint": "eslint ."
},

@@ -113,0 +113,0 @@ "nyc": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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