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

activitystreams-xl

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

activitystreams-xl - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

a2.context.json

2

package.json
{
"name": "activitystreams-xl",
"version": "2.0.0",
"version": "2.0.1",
"description": "ActivityStreams 1.0 & 2.0 parsing and translation",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,2 +5,3 @@ const ltx = require('ltx');

const ACTIVITYNS = 'http://activitystrea.ms/spec/1.0/';
const AS2NS = 'https://www.w3.org/ns/activitystreams';
const POCONS = "http://portablecontacts.net/spec/1.0";

@@ -12,3 +13,24 @@ //const MASTODONNS = "http://mastodon.social/schema/1.0";

const jsonld = require('jsonld').promises;
const as2context = require('./as2.context.json');
const nodeDocumentLoader = require('jsonld').documentLoaders.node();
const CONTEXTS = {
[AS2NS]: as2context
}
const documentLoader = function(url, callback) {
if(url in CONTEXTS) {
return callback(
null, {
contextUrl: null, // this is for a context via a link header
document: CONTEXTS[url], // this is the actual document that was loaded
documentUrl: url // this is the actual context URL after redirects
});
}
nodeDocumentLoader(url, callback);
};
module.exports = {

@@ -35,3 +57,3 @@ parse

const as1 = entry2as1(el);
return jsonld.compact(addContext(as1ToAS2(as1)), 'https://www.w3.org/ns/activitystreams');
return jsonld.compact(addContext(as1ToAS2(as1)), 'https://www.w3.org/ns/activitystreams', { documentLoader });
}

@@ -64,3 +86,3 @@

return Object.assign({
'@context': 'https://www.w3.org/ns/activitystreams'
'@context': AS2NS
}, obj);

@@ -67,0 +89,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