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 8.0.5 to 8.1.0

20

lib/helpers/simplify_sitelinks.js
const { getSitelinkUrl } = require('./sitelinks')
module.exports = (sitelinks, options = {}) => {
const { addUrl } = options
return Object.keys(sitelinks).reduce(aggregateValues(sitelinks, addUrl), {})
let { addUrl, keepBadges, keepAll } = options
keepBadges = keepBadges || keepAll
return Object.keys(sitelinks).reduce(aggregateValues({
sitelinks,
addUrl,
keepBadges
}), {})
}
const aggregateValues = (sitelinks, addUrl) => (index, key) => {
const aggregateValues = ({ sitelinks, addUrl, keepBadges }) => (index, key) => {
// Accomodating for wikibase-cli, which might set the sitelink to null

@@ -15,5 +20,8 @@ // to signify that a requested sitelink was not found

}
const { title } = sitelinks[key]
if (addUrl) {
index[key] = { title, url: getSitelinkUrl(key, title) }
const { title, badges } = sitelinks[key]
if (addUrl || keepBadges) {
index[key] = { title }
if (addUrl) index[key].url = getSitelinkUrl(key, title)
if (keepBadges) index[key].badges = badges
} else {

@@ -20,0 +28,0 @@ index[key] = title

{
"name": "wikibase-sdk",
"version": "8.0.5",
"version": "8.1.0",
"description": "utils functions to query a Wikibase instance and simplify its results",

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

@@ -31,3 +31,2 @@ # wikibase-sdk

- [Changelog](#changelog)

@@ -34,0 +33,0 @@ - [Dependencies](#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