sparqlxml-parse
Advanced tools
Comparing version 2.0.0 to 2.0.1
# 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/sparqlxml-parse.js/compare/v2.0.0...v2.0.1) - 2022-07-15 | ||
### Fixed | ||
* [Ensure variables or error event is emitted](https://github.com/rubensworks/sparqlxml-parse.js/commit/46f6c89526d55c0cbceae72a4521e350f6a8ca6f) | ||
<a name="v2.0.0"></a> | ||
@@ -5,0 +11,0 @@ ## [v2.0.0](https://github.com/rubensworks/sparqlxml-parse.js/compare/v1.5.0...v2.0.0) - 2022-07-14 |
@@ -31,2 +31,4 @@ "use strict"; | ||
const stack = []; | ||
let variablesFound = false; | ||
let resultsFound = false; | ||
const variables = []; | ||
@@ -43,2 +45,5 @@ let currentBindings = {}; | ||
} | ||
else if (tag.name === "results" && this.stackEquals(stack, ['sparql'])) { | ||
resultsFound = true; | ||
} | ||
else if (tag.name === 'result' && this.stackEquals(stack, ['sparql', 'results'])) { | ||
@@ -70,2 +75,3 @@ currentBindings = {}; | ||
resultStream.emit("variables", variables); | ||
variablesFound = true; | ||
} | ||
@@ -101,2 +107,10 @@ if (this.stackEquals(stack, ['sparql', 'results', 'result'])) { | ||
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({ | ||
@@ -103,0 +117,0 @@ objectMode: true, |
{ | ||
"name": "sparqlxml-parse", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Parses SPARQL XML query results", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22077
254