wikibase-sdk
Advanced tools
Comparing version 7.1.4 to 7.1.5
@@ -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 |
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
63658
141