citation-js 0.7.1 → 0.7.3
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 +64 -29
- package/build/citation.min.js +1 -1
- package/package.json +8 -8
package/build/citation.js
CHANGED
|
@@ -6510,6 +6510,9 @@ var _default = new _core.util.Translator([].concat(aliases, nonSpec, [{
|
|
|
6510
6510
|
convert: _shared.Converters.PICK,
|
|
6511
6511
|
when: {
|
|
6512
6512
|
source: {
|
|
6513
|
+
howpublished: function howpublished(howPublished) {
|
|
6514
|
+
return howPublished && !howPublished.startsWith('http');
|
|
6515
|
+
},
|
|
6513
6516
|
publisher: false,
|
|
6514
6517
|
organization: false,
|
|
6515
6518
|
institution: false
|
|
@@ -6859,6 +6862,9 @@ var _default = new _core.util.Translator([{
|
|
|
6859
6862
|
convert: _shared.Converters.PICK,
|
|
6860
6863
|
when: {
|
|
6861
6864
|
source: {
|
|
6865
|
+
howpublished: function howpublished(howPublished) {
|
|
6866
|
+
return howPublished && !howPublished.startsWith('http');
|
|
6867
|
+
},
|
|
6862
6868
|
publisher: false,
|
|
6863
6869
|
organization: false,
|
|
6864
6870
|
institution: false,
|
|
@@ -8453,6 +8459,29 @@ var CONVERTERS = {
|
|
|
8453
8459
|
return parts.join('/');
|
|
8454
8460
|
}
|
|
8455
8461
|
},
|
|
8462
|
+
YEAR: {
|
|
8463
|
+
toTarget: function toTarget(year) {
|
|
8464
|
+
return {
|
|
8465
|
+
'date-parts': [[year]]
|
|
8466
|
+
};
|
|
8467
|
+
},
|
|
8468
|
+
toSource: function toSource(date) {
|
|
8469
|
+
var _date$dateParts;
|
|
8470
|
+
return (_date$dateParts = date['date-parts']) === null || _date$dateParts === void 0 || (_date$dateParts = _date$dateParts[0]) === null || _date$dateParts === void 0 || (_date$dateParts = _date$dateParts[0]) === null || _date$dateParts === void 0 ? void 0 : _date$dateParts.toString();
|
|
8471
|
+
}
|
|
8472
|
+
},
|
|
8473
|
+
DATE_YEAR: {
|
|
8474
|
+
keepAll: true,
|
|
8475
|
+
toTarget: function toTarget() {
|
|
8476
|
+
for (var _len3 = arguments.length, dates = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8477
|
+
dates[_key3] = arguments[_key3];
|
|
8478
|
+
}
|
|
8479
|
+
return CONVERTERS.DATE.toTarget(dates.find(Boolean));
|
|
8480
|
+
},
|
|
8481
|
+
toSource: function toSource(date) {
|
|
8482
|
+
return [CONVERTERS.DATE.toSource(date), CONVERTERS.YEAR.toSource(date)];
|
|
8483
|
+
}
|
|
8484
|
+
},
|
|
8456
8485
|
NAME: {
|
|
8457
8486
|
toTarget: function toTarget(names) {
|
|
8458
8487
|
return names && [].concat(names).map(function (name) {
|
|
@@ -8550,7 +8579,7 @@ module.exports={
|
|
|
8550
8579
|
"accessed": "DATE",
|
|
8551
8580
|
"container": "DATE",
|
|
8552
8581
|
"event-date": "DATE",
|
|
8553
|
-
"issued": "
|
|
8582
|
+
"issued": "DATE_YEAR",
|
|
8554
8583
|
"original-date": "DATE",
|
|
8555
8584
|
"submitted": "DATE",
|
|
8556
8585
|
|
|
@@ -8667,34 +8696,40 @@ function prepareTranslator(spec) {
|
|
|
8667
8696
|
_step;
|
|
8668
8697
|
try {
|
|
8669
8698
|
var _loop = function _loop() {
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
if (mapping.convert && mapping.convert.keepAll === true) {
|
|
8675
|
-
return 1;
|
|
8676
|
-
}
|
|
8677
|
-
if (Array.isArray(mapping.source)) {
|
|
8678
|
-
if (mapping.convert) {
|
|
8679
|
-
var _mapping$convert = mapping.convert,
|
|
8680
|
-
_toSource = _mapping$convert.toSource,
|
|
8681
|
-
_toTarget = _mapping$convert.toTarget;
|
|
8682
|
-
mapping.convert = {
|
|
8683
|
-
toTarget: function toTarget() {
|
|
8684
|
-
var _converters$default$A;
|
|
8685
|
-
return _toTarget((_converters$default$A = _converters["default"].ANY).toTarget.apply(_converters$default$A, arguments));
|
|
8686
|
-
},
|
|
8687
|
-
toSource: function toSource() {
|
|
8688
|
-
return _converters["default"].ANY.toSource(_toSource.apply(void 0, arguments));
|
|
8689
|
-
}
|
|
8690
|
-
};
|
|
8691
|
-
} else {
|
|
8692
|
-
mapping.convert = _converters["default"].ANY;
|
|
8699
|
+
var mapping = _step.value;
|
|
8700
|
+
if (mapping.target === 'issued' && !Array.isArray(mapping.source)) {
|
|
8701
|
+
mapping.convert = _converters["default"].YEAR;
|
|
8702
|
+
return 0;
|
|
8693
8703
|
}
|
|
8694
|
-
|
|
8695
|
-
|
|
8704
|
+
if (mapping.target in _dataTypes["default"]) {
|
|
8705
|
+
mapping.convert = _converters["default"][_dataTypes["default"][mapping.target]];
|
|
8706
|
+
}
|
|
8707
|
+
if (mapping.convert && mapping.convert.keepAll === true) {
|
|
8708
|
+
return 0;
|
|
8709
|
+
}
|
|
8710
|
+
if (Array.isArray(mapping.source)) {
|
|
8711
|
+
if (mapping.convert) {
|
|
8712
|
+
var _mapping$convert = mapping.convert,
|
|
8713
|
+
_toSource = _mapping$convert.toSource,
|
|
8714
|
+
_toTarget = _mapping$convert.toTarget;
|
|
8715
|
+
mapping.convert = {
|
|
8716
|
+
toTarget: function toTarget() {
|
|
8717
|
+
var _converters$default$A;
|
|
8718
|
+
return _toTarget((_converters$default$A = _converters["default"].ANY).toTarget.apply(_converters$default$A, arguments));
|
|
8719
|
+
},
|
|
8720
|
+
toSource: function toSource() {
|
|
8721
|
+
return _converters["default"].ANY.toSource(_toSource.apply(void 0, arguments));
|
|
8722
|
+
}
|
|
8723
|
+
};
|
|
8724
|
+
} else {
|
|
8725
|
+
mapping.convert = _converters["default"].ANY;
|
|
8726
|
+
}
|
|
8727
|
+
}
|
|
8728
|
+
},
|
|
8729
|
+
_ret;
|
|
8696
8730
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
8697
|
-
|
|
8731
|
+
_ret = _loop();
|
|
8732
|
+
if (_ret === 0) continue;
|
|
8698
8733
|
}
|
|
8699
8734
|
} catch (err) {
|
|
8700
8735
|
_iterator.e(err);
|
|
@@ -10611,8 +10646,8 @@ module.exports=[
|
|
|
10611
10646
|
{
|
|
10612
10647
|
"source": [
|
|
10613
10648
|
"DA",
|
|
10614
|
-
"
|
|
10615
|
-
"
|
|
10649
|
+
"PY",
|
|
10650
|
+
"C2"
|
|
10616
10651
|
],
|
|
10617
10652
|
"target": "issued",
|
|
10618
10653
|
"when": {
|