citation-js 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/citation.js +91 -5
- package/build/citation.min.js +1 -1
- package/package.json +9 -9
package/build/citation.js
CHANGED
|
@@ -4282,7 +4282,7 @@ Translator.CONVERT_TO_TARGET = Symbol('convert to target');
|
|
|
4282
4282
|
},{}],44:[function(require,module,exports){
|
|
4283
4283
|
module.exports={
|
|
4284
4284
|
"name": "@citation-js/core",
|
|
4285
|
-
"version": "0.6.
|
|
4285
|
+
"version": "0.6.1",
|
|
4286
4286
|
"description": "Convert different bibliographic metadata sources",
|
|
4287
4287
|
"keywords": [
|
|
4288
4288
|
"citation-js",
|
|
@@ -4321,7 +4321,7 @@ module.exports={
|
|
|
4321
4321
|
"devDependencies": {
|
|
4322
4322
|
"@babel/plugin-proposal-class-properties": "^7.12.1"
|
|
4323
4323
|
},
|
|
4324
|
-
"gitHead": "
|
|
4324
|
+
"gitHead": "1ea02689d28379ce53121148783c356a57b161cf"
|
|
4325
4325
|
}
|
|
4326
4326
|
|
|
4327
4327
|
},{}],45:[function(require,module,exports){
|
|
@@ -7237,7 +7237,7 @@ var nonSpec = [{
|
|
|
7237
7237
|
},
|
|
7238
7238
|
toSource: function toSource(_ref) {
|
|
7239
7239
|
var S2ID = _ref.S2ID;
|
|
7240
|
-
return
|
|
7240
|
+
return S2ID;
|
|
7241
7241
|
}
|
|
7242
7242
|
}
|
|
7243
7243
|
}];
|
|
@@ -16065,6 +16065,11 @@ function parseEntity(entity) {
|
|
|
16065
16065
|
data.author = data['original-author'];
|
|
16066
16066
|
}
|
|
16067
16067
|
|
|
16068
|
+
if (data._versions) {
|
|
16069
|
+
data.custom.versions = data._versions;
|
|
16070
|
+
delete data._versions;
|
|
16071
|
+
}
|
|
16072
|
+
|
|
16068
16073
|
return data;
|
|
16069
16074
|
}
|
|
16070
16075
|
|
|
@@ -16425,6 +16430,26 @@ function parseDateRange(dates) {
|
|
|
16425
16430
|
};
|
|
16426
16431
|
}
|
|
16427
16432
|
|
|
16433
|
+
function parseVersion(version) {
|
|
16434
|
+
var output = {
|
|
16435
|
+
version: version.value
|
|
16436
|
+
};
|
|
16437
|
+
|
|
16438
|
+
if (version.qualifiers.P577) {
|
|
16439
|
+
output.issued = (0, _date.parse)(version.qualifiers.P577[0]);
|
|
16440
|
+
}
|
|
16441
|
+
|
|
16442
|
+
if (version.qualifiers.P356) {
|
|
16443
|
+
output.DOI = version.qualifiers.P356[0];
|
|
16444
|
+
}
|
|
16445
|
+
|
|
16446
|
+
if (version.qualifiers.P6138) {
|
|
16447
|
+
output.SWHID = version.qualifiers.P6138[0];
|
|
16448
|
+
}
|
|
16449
|
+
|
|
16450
|
+
return output;
|
|
16451
|
+
}
|
|
16452
|
+
|
|
16428
16453
|
function parseProp(prop, value, entity) {
|
|
16429
16454
|
switch (prop) {
|
|
16430
16455
|
case 'type':
|
|
@@ -16484,6 +16509,9 @@ function parseProp(prop, value, entity) {
|
|
|
16484
16509
|
case 'number-of-volumes':
|
|
16485
16510
|
return value.length;
|
|
16486
16511
|
|
|
16512
|
+
case '_versions':
|
|
16513
|
+
return value.map(parseVersion);
|
|
16514
|
+
|
|
16487
16515
|
default:
|
|
16488
16516
|
return value;
|
|
16489
16517
|
}
|
|
@@ -16680,7 +16708,9 @@ module.exports={
|
|
|
16680
16708
|
"URL": {
|
|
16681
16709
|
"values": "any",
|
|
16682
16710
|
"props": ["P856", "P953", "P973", "P2699"]
|
|
16683
|
-
}
|
|
16711
|
+
},
|
|
16712
|
+
|
|
16713
|
+
"_versions": { "values": "all", "props": ["P348:all"] }
|
|
16684
16714
|
}
|
|
16685
16715
|
|
|
16686
16716
|
},{}],110:[function(require,module,exports){
|
|
@@ -16722,6 +16752,47 @@ var _api = require("./api.js");
|
|
|
16722
16752
|
|
|
16723
16753
|
var _id = require("./id.js");
|
|
16724
16754
|
|
|
16755
|
+
function ownKeys(object, enumerableOnly) {
|
|
16756
|
+
var keys = Object.keys(object);
|
|
16757
|
+
|
|
16758
|
+
if (Object.getOwnPropertySymbols) {
|
|
16759
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
16760
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
16761
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
16762
|
+
})), keys.push.apply(keys, symbols);
|
|
16763
|
+
}
|
|
16764
|
+
|
|
16765
|
+
return keys;
|
|
16766
|
+
}
|
|
16767
|
+
|
|
16768
|
+
function _objectSpread(target) {
|
|
16769
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
16770
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
16771
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
16772
|
+
_defineProperty(target, key, source[key]);
|
|
16773
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
16774
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
16775
|
+
});
|
|
16776
|
+
}
|
|
16777
|
+
|
|
16778
|
+
return target;
|
|
16779
|
+
}
|
|
16780
|
+
|
|
16781
|
+
function _defineProperty(obj, key, value) {
|
|
16782
|
+
if (key in obj) {
|
|
16783
|
+
Object.defineProperty(obj, key, {
|
|
16784
|
+
value: value,
|
|
16785
|
+
enumerable: true,
|
|
16786
|
+
configurable: true,
|
|
16787
|
+
writable: true
|
|
16788
|
+
});
|
|
16789
|
+
} else {
|
|
16790
|
+
obj[key] = value;
|
|
16791
|
+
}
|
|
16792
|
+
|
|
16793
|
+
return obj;
|
|
16794
|
+
}
|
|
16795
|
+
|
|
16725
16796
|
var SIMPLIFY_OPTS = {
|
|
16726
16797
|
keepQualifiers: true,
|
|
16727
16798
|
timeConverter: 'simple-day'
|
|
@@ -16860,7 +16931,22 @@ function completeResponse(entities, old) {
|
|
|
16860
16931
|
}
|
|
16861
16932
|
|
|
16862
16933
|
function simplifyEntities(entities) {
|
|
16863
|
-
|
|
16934
|
+
var simplified = _wikidataSdk.simplify.entities(entities, SIMPLIFY_OPTS);
|
|
16935
|
+
|
|
16936
|
+
for (var id in entities) {
|
|
16937
|
+
var claims = entities[id].claims;
|
|
16938
|
+
|
|
16939
|
+
if (claims.P348) {
|
|
16940
|
+
simplified[id].claims['P348:all'] = _wikidataSdk.simplify.propertyClaims(claims.P348, _objectSpread(_objectSpread({}, SIMPLIFY_OPTS), {}, {
|
|
16941
|
+
keepNonTruthy: true,
|
|
16942
|
+
keepRank: true
|
|
16943
|
+
})).filter(function (claim) {
|
|
16944
|
+
return claim.rank !== 'deprecated';
|
|
16945
|
+
});
|
|
16946
|
+
}
|
|
16947
|
+
}
|
|
16948
|
+
|
|
16949
|
+
return simplified;
|
|
16864
16950
|
}
|
|
16865
16951
|
|
|
16866
16952
|
function initLoopState(entities, cache) {
|