New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wikidata-sdk

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikidata-sdk - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

build/queries/wdq_get_reverse_claims.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -3,0 +3,0 @@ var buildUrl, wd_, wdq_;

@@ -1,5 +0,5 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {
var buildUrl, wd_,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

@@ -11,3 +11,3 @@ wd_ = require('../utils/utils');

module.exports = function(ids, languages, props, format) {
var query, _ref;
var query, ref;
if (languages == null) {

@@ -22,5 +22,5 @@ languages = ['en'];

}
_ref = [ids, languages, props].map(wd_.toPropertiesArray), ids = _ref[0], languages = _ref[1], props = _ref[2];
ref = [ids, languages, props].map(wd_.toPropertiesArray), ids = ref[0], languages = ref[1], props = ref[2];
ids = wd_.normalizeIds(ids);
if (__indexOf.call(languages, 'en') < 0) {
if (indexOf.call(languages, 'en') < 0) {
languages.push('en');

@@ -27,0 +27,0 @@ }

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -3,0 +3,0 @@ var buildUrl, wd_;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -3,0 +3,0 @@ var err, qs, roots;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -24,5 +24,5 @@ var simplifyClaims, wd_;

entities: function(res) {
var _ref;
var ref;
res = res.body || res;
return (_ref = res.items) != null ? _ref.map(function(item) {
return (ref = res.items) != null ? ref.map(function(item) {
return wd_.normalizeId(item);

@@ -29,0 +29,0 @@ }) : void 0;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -3,0 +3,0 @@ module.exports = {

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -18,6 +18,6 @@ var simpifyStatement, wd_;

simpifyStatement = function(statement) {
var datatype, datavalue, mainsnak, value, _ref;
var datatype, datavalue, mainsnak, ref, value;
mainsnak = statement.mainsnak;
if (mainsnak != null) {
_ref = [mainsnak.datatype, mainsnak.datavalue], datatype = _ref[0], datavalue = _ref[1];
ref = [mainsnak.datatype, mainsnak.datavalue], datatype = ref[0], datavalue = ref[1];
switch (datatype) {

@@ -24,0 +24,0 @@ case 'string':

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -53,20 +53,24 @@ var wd_;

wd_.normalizeWikidataTime = function(wikidataTime) {
var day, month, parts, rest, sign, year;
parts = wikidataTime.split('-');
switch (parts.length) {
case 3:
year = parts[0], month = parts[1], rest = parts[2];
break;
case 4:
sign = parts[0], year = parts[1], month = parts[2], rest = parts[3];
year = "-" + year;
break;
default:
console.error("unknown wikidata time format");
wd_.wikidataTimeToDateObject = function(wikidataTime) {
var date, rest, sign;
sign = wikidataTime[0];
rest = wikidataTime.slice(1);
if (sign === '-') {
date = "-00" + rest;
return new Date(date);
} else {
return new Date(rest);
}
day = rest.slice(0, 2);
return new Date(year, month, day).getTime();
};
wd_.wikidataTimeToEpochTime = function(wikidataTime) {
return wd_.wikidataTimeToDateObject(wikidataTime).getTime();
};
wd_.wikidataTimeToISOString = function(wikidataTime) {
return wd_.wikidataTimeToDateObject(wikidataTime).toISOString();
};
wd_.normalizeWikidataTime = wd_.wikidataTimeToEpochTime;
wd_.toPropertiesArray = function(obj) {

@@ -73,0 +77,0 @@ if (typeof obj === 'string') {

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.8.0
// Generated by CoffeeScript 1.9.3
(function() {

@@ -3,0 +3,0 @@ module.exports = {

{
"name": "wikidata-sdk",
"version": "0.0.5",
"version": "0.0.6",
"description": "a javascript tool suite to query wikidata data",

@@ -5,0 +5,0 @@ "main": "build/wikidata-sdk.js",

@@ -181,3 +181,6 @@ ![wikidata](https://upload.wikimedia.org/wikipedia/commons/f/ff/Wikidata-logo.svg)

- normalizeIds
- normalizeWikidataTime
- wikidataTimeToDateObject
- wikidataTimeToEpochTime
- wikidataTimeToISOString
- normalizeWikidataTime (aliased to wikidataTimeToEpochTime)
- toPropertiesArray

@@ -184,0 +187,0 @@

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