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.9.1 to 7.10.0

lib/queries/cirrus_search.js

3

CHANGELOG.md
# CHANGELOG
*versions follow [SemVer](http://semver.org)*
## 7.10.0 - 2021-04-10
* Added [`cirrusSearchPages`](https://github.com/maxlath/wikidata-sdk/blob/master/docs/search_entities.md#cirrussearchpages) function
## 7.9.0 - 2021-01-29

@@ -5,0 +8,0 @@ * [`getEntityIdFromGuid`](https://github.com/maxlath/wikidata-sdk/blob/master/docs/general_helpers.md#getentityidfromguid): added support for hyphenated GUIDs

31

lib/helpers/parse_responses.js
const { simplifyEntity } = require('./simplify_entity')
module.exports = {
wd: {
entities: res => {
res = res.body || res
const { entities } = res
Object.keys(entities).forEach(entityId => {
entities[entityId] = simplifyEntity(entities[entityId])
})
return entities
}
const wb = {
entities: res => {
// Legacy convenience for the time the 'request' lib was all the rage
res = res.body || res
const { entities } = res
Object.keys(entities).forEach(entityId => {
entities[entityId] = simplifyEntity(entities[entityId])
})
return entities
},
pagesTitles: res => {
// Same behavior as above
res = res.body || res
return res.query.search.map(result => result.title)
}
}
module.exports = {
wb,
// Legacy
wd: wb
}

@@ -36,2 +36,3 @@ const { isPlainObject } = require('./utils/utils')

searchEntities: require('./queries/search_entities')(buildUrl),
cirrusSearchPages: require('./queries/cirrus_search')(buildUrl),
getEntities: require('./queries/get_entities')(buildUrl),

@@ -46,2 +47,3 @@ getManyEntities: require('./queries/get_many_entities')(buildUrl),

searchEntities: missingInstance('searchEntities'),
cirrusSearchPages: missingInstance('cirrusSearchPages'),
getEntities: missingInstance('getEntities'),

@@ -48,0 +50,0 @@ getManyEntities: missingInstance('getManyEntities'),

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

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

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