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 9.2.0 to 9.2.1

15

dist/src/helpers/parse_claim.js

@@ -95,9 +95,16 @@ import { wikibaseTimeToEpochTime, wikibaseTimeToISOString, wikibaseTimeToSimpleDay } from './time.js';

};
const normalizeDatatype = datatype => datatype.toLowerCase().replace(/[\s-]/g, '');
const normalizedParsers = {};
for (const [datatype, parser] of Object.entries(parsers)) {
normalizedParsers[normalizeDatatype(datatype)] = parser;
}
export function parseClaim(datatype, datavalue, options, claimId) {
// Known case of missing datatype: form.claims, sense.claims
// Known case of missing datatype: form.claims, sense.claims, mediainfo.statements
datatype = datatype || datavalue.type;
// Known case requiring this: legacy "muscial notation" datatype
datatype = datatype.replace(' ', '-');
try {
return parsers[datatype](datavalue, options);
// Known case requiring normalization
// - legacy "muscial notation" datatype
// - mediainfo won't have datatype="globe-coordinate", but datavalue.type="globecoordinate"
const parser = normalizedParsers[normalizeDatatype(datatype)];
return parser(datavalue, options);
}

@@ -104,0 +111,0 @@ catch (err) {

{
"name": "wikibase-sdk",
"version": "9.2.0",
"version": "9.2.1",
"type": "module",

@@ -5,0 +5,0 @@ "description": "utils functions to query a Wikibase instance and simplify its results",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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