wikibase-sdk
Advanced tools
Comparing version 7.4.2 to 7.4.3
const simplifyTextAttributes = multivalue => data => { | ||
return Object.keys(data).reduce(aggregateValues(data, multivalue), {}) | ||
const simplified = {} | ||
Object.keys(data).forEach(lang => { | ||
const obj = data[lang] | ||
if (obj != null) { | ||
simplified[lang] = multivalue ? obj.map(getValue) : obj.value | ||
} else { | ||
simplified[lang] = multivalue ? [] : null | ||
} | ||
}) | ||
return simplified | ||
} | ||
const aggregateValues = (data, multivalue) => (index, lang) => { | ||
const obj = data[lang] | ||
index[lang] = multivalue ? obj.map(getValue) : obj.value | ||
return index | ||
} | ||
const getValue = obj => obj.value | ||
@@ -12,0 +15,0 @@ |
{ | ||
"name": "wikibase-sdk", | ||
"version": "7.4.2", | ||
"version": "7.4.3", | ||
"description": "utils functions to query a Wikibase instance and simplify its results", | ||
@@ -5,0 +5,0 @@ "main": "lib/wikibase-sdk.js", |
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
68923
1112