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

wikibase-sdk

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikibase-sdk - npm Package Compare versions

Comparing version 10.0.0 to 10.0.1

2

dist/src/helpers/simplify_sparql_results.d.ts
import type { SimplifiedSparqlResults, SparqlResults, SimplifiedSparqlValueGroup, SparqlValueRaw } from '../types/sparql.js';
export declare function simplifySparqlResults(input: SparqlResults | string): (Record<string, SparqlValueRaw> & Record<string, SimplifiedSparqlValueGroup>)[];
export declare function minimizeSimplifiedSparqlResults(simplifySparqlResults: SimplifiedSparqlResults): SparqlValueRaw[];
export declare function minimizeSimplifiedSparqlResults(simplifySparqlResults: SimplifiedSparqlResults): SimplifiedSparqlResults | SparqlValueRaw[];
//# sourceMappingURL=simplify_sparql_results.d.ts.map

@@ -12,11 +12,11 @@ export function simplifySparqlResults(input) {

export function minimizeSimplifiedSparqlResults(simplifySparqlResults) {
return simplifySparqlResults
.map(simplifySparqlResult => {
const values = Object.values(simplifySparqlResult);
if (values.length > 1)
throw new Error('too many variables: SPARQL result can not be minimzed');
return values[0];
})
// filtering-out bnodes
.filter((result) => result != null);
// filtering-out bnodes
simplifySparqlResults = simplifySparqlResults.filter(result => Object.keys(result).length > 0);
const canBeMinimized = simplifySparqlResults.every(result => Object.keys(result).length === 1);
if (canBeMinimized) {
return simplifySparqlResults.map(result => Object.values(result)[0]);
}
else {
return simplifySparqlResults;
}
}

@@ -23,0 +23,0 @@ function parseValue(valueObj) {

{
"name": "wikibase-sdk",
"version": "10.0.0",
"version": "10.0.1",
"type": "module",

@@ -5,0 +5,0 @@ "description": "utils functions to query a Wikibase instance and simplify its results",

Sorry, the diff of this file is not supported yet

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