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 7.1.4 to 7.1.5

31

lib/helpers/simplify_claims.js

@@ -87,11 +87,10 @@ const { parse: parseClaim } = require('./parse_claim')

const richValue = { value }
const valueObj = { value }
if (keepHashes) richValue.hash = claim.hash
if (keepTypes) richValue.type = datatype
if (keepSnaktypes) richValue.snaktype = snaktype
if (keepHashes) valueObj.hash = claim.hash
if (keepTypes) valueObj.type = datatype
if (keepSnaktypes) valueObj.snaktype = snaktype
return richValue
return valueObj
}
if (isReferenceSnak) {

@@ -102,3 +101,2 @@ if (!keepTypes) return value

}
// No need to test keepHashes as it has no effect if neither

@@ -112,9 +110,9 @@ // keepQualifiers or keepReferences is true

// instead of a direct value
const richValue = { value }
const valueObj = { value }
if (keepTypes) richValue.type = datatype
if (keepTypes) valueObj.type = datatype
if (keepSnaktypes) richValue.snaktype = snaktype
if (keepSnaktypes) valueObj.snaktype = snaktype
if (keepRanks) richValue.rank = rank
if (keepRanks) valueObj.rank = rank

@@ -125,3 +123,3 @@ const subSnaksOptions = getSubSnakOptions(options)

if (keepQualifiers) {
richValue.qualifiers = simplifyClaims(claim.qualifiers, subSnaksOptions)
valueObj.qualifiers = simplifyClaims(claim.qualifiers, subSnaksOptions)
}

@@ -131,3 +129,3 @@

claim.references = claim.references || []
richValue.references = claim.references.map(refRecord => {
valueObj.references = claim.references.map(refRecord => {
const snaks = simplifyClaims(refRecord.snaks, subSnaksOptions)

@@ -139,5 +137,5 @@ if (keepHashes) return { snaks, hash: refRecord.hash }

if (keepIds) richValue.id = claim.id
if (keepIds) valueObj.id = claim.id
return richValue
return valueObj
}

@@ -168,3 +166,4 @@

const keepOptions = [ 'keepQualifiers', 'keepReferences', 'keepIds', 'keepHashes', 'keepTypes', 'keepSnaktypes', 'keepRanks' ]
const keepOptions = [ 'keepQualifiers', 'keepReferences', 'keepIds', 'keepHashes', 'keepTypes', 'keepSnaktypes', 'keepRanks', 'keepRichValues' ]
const parseKeepOptions = options => {

@@ -171,0 +170,0 @@ if (options.keepAll) {

{
"name": "wikibase-sdk",
"version": "7.1.4",
"version": "7.1.5",
"description": "A javascript tool-suite to query wikibase and simplify its results",

@@ -5,0 +5,0 @@ "main": "lib/wikibase-sdk.js",

@@ -29,2 +29,3 @@ # Wikibase SDK

- [Changelog](#changelog)
- [Dependencies](#dependencies)

@@ -45,2 +46,4 @@ - [Install](#install)

## Changelog
See [CHANGELOG.md](CHANGELOG.md) for version info

@@ -47,0 +50,0 @@ ## Dependencies

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