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

jsonld-streaming-parser

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonld-streaming-parser - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

6

lib/JsonLdParser.d.ts

@@ -222,2 +222,8 @@ /// <reference types="node" />

rdfstarReverseInEmbedded?: boolean;
/**
* If the APIs you interact with publish valid JSON-LD on media types that are not application/ld+json,
* provide those content-types in this array.
* Default to ['application/activity+json']
*/
wellKnownMediaTypes?: string[];
}

8

lib/JsonLdParser.js

@@ -65,4 +65,8 @@ "use strict";

let context;
// Special cases when receiving something else than the JSON-LD media type
if (mediaType !== 'application/ld+json') {
let wellKnownMediaTypes = ['application/activity+json'];
if (options && options.wellKnownMediaTypes) {
wellKnownMediaTypes = options.wellKnownMediaTypes;
}
// Special cases when receiving something else than the JSON-LD media type or the wellKnownMediaTypes
if (mediaType !== 'application/ld+json' && !wellKnownMediaTypes.includes(mediaType)) {
// Only accept JSON or JSON extension types

@@ -69,0 +73,0 @@ if (mediaType !== 'application/json' && !mediaType.endsWith('+json')) {

{
"name": "jsonld-streaming-parser",
"version": "3.3.0",
"version": "3.4.0",
"description": "A fast and lightweight streaming JSON-LD parser",

@@ -5,0 +5,0 @@ "keywords": [

@@ -184,2 +184,3 @@ # JSON-LD Streaming Parser

* `rdfstarReverseInEmbedded`: If embedded nodes in JSON-LD star can have reverse properties. _(Default: `false`)_
* `wellKnownMediaTypes`: an array of media types that can also be parsed as JSON-LD. _(Default: `['application/activity+json']`)_

@@ -186,0 +187,0 @@ ```javascript

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