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

sparqljson-parse

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparqljson-parse - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

6

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file.
<a name="v2.0.1"></a>
## [v2.0.1](https://github.com/rubensworks/sparqljson-parse.js/compare/v2.0.0...v2.0.1) - 2022-07-15
### Fixed
* [Ensure variables or error event is emitted](https://github.com/rubensworks/sparqljson-parse.js/commit/40a86691c9096a75ef3218a928e73bc0ea68cefb)
<a name="v2.0.0"></a>

@@ -5,0 +11,0 @@ ## [v2.0.0](https://github.com/rubensworks/sparqljson-parse.js/compare/v1.7.0...v2.0.0) - 2022-07-14

@@ -40,6 +40,12 @@ "use strict";

jsonParser.onError = errorListener;
let variablesFound = false;
let resultsFound = false;
jsonParser.onValue = (value) => {
if (jsonParser.key === "vars" && jsonParser.stack.length === 2 && jsonParser.stack[1].key === 'head') {
resultStream.emit('variables', value.map((v) => this.dataFactory.variable(v)));
variablesFound = true;
}
else if (jsonParser.key === "results" && jsonParser.stack.length === 1) {
resultsFound = true;
}
else if (typeof jsonParser.key === 'number' && jsonParser.stack.length === 3 && jsonParser.stack[1].key === 'results' && jsonParser.stack[2].key === 'bindings') {

@@ -50,2 +56,10 @@ resultStream.push(this.parseJsonBindings(value));

const resultStream = sparqlResponseStream
.on("end", _ => {
if (!resultsFound) {
resultStream.emit("error", new Error("No valid SPARQL query results were found."));
}
else if (!variablesFound) {
resultStream.emit('variables', []);
}
})
.pipe(new readable_stream_1.Transform({

@@ -52,0 +66,0 @@ objectMode: true,

2

package.json
{
"name": "sparqljson-parse",
"version": "2.0.0",
"version": "2.0.1",
"description": "Parses SPARQL JSON query results",

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

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