citation-js 0.7.7 → 0.7.9

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 CHANGED
@@ -1663,6 +1663,14 @@ var fieldTypes = {
1663
1663
  };
1664
1664
  function correctName(name, bestGuessConversions) {
1665
1665
  if (_typeof(name) === 'object' && name !== null && (name.literal || name.given || name.family)) {
1666
+ if (name.ORCID || name.orcid || name._ORCID) {
1667
+ name = _objectSpread({
1668
+ _orcid: name.ORCID || name.orcid || name._ORCID
1669
+ }, name);
1670
+ delete name.ORCID;
1671
+ delete name.orcid;
1672
+ delete name._ORCID;
1673
+ }
1666
1674
  return name;
1667
1675
  } else if (!bestGuessConversions) {
1668
1676
  return undefined;
@@ -3421,7 +3429,7 @@ Translator.CONVERT_TO_TARGET = Symbol('convert to target');
3421
3429
  },{}],43:[function(require,module,exports){
3422
3430
  module.exports={
3423
3431
  "name": "@citation-js/core",
3424
- "version": "0.7.6",
3432
+ "version": "0.7.9",
3425
3433
  "description": "Convert different bibliographic metadata sources",
3426
3434
  "keywords": [
3427
3435
  "citation-js",
@@ -3461,7 +3469,7 @@ module.exports={
3461
3469
  "fetch-ponyfill": "^7.1.0",
3462
3470
  "sync-fetch": "^0.4.1"
3463
3471
  },
3464
- "gitHead": "c88a4c1aacf82cfa8f1b55cc8673cb38e807c421"
3472
+ "gitHead": "8fa1b9d3d420f489f9a8a57f9759b50a6369182c"
3465
3473
  }
3466
3474
 
3467
3475
  },{}],44:[function(require,module,exports){
@@ -4263,7 +4271,12 @@ var _default = exports["default"] = {
4263
4271
  sentenceCase: 'never'
4264
4272
  },
4265
4273
  format: {
4266
- useIdAsLabel: false
4274
+ useIdAsLabel: false,
4275
+ asciiOnly: true
4276
+ },
4277
+ biber: {
4278
+ annotationMarker: '+an',
4279
+ namedAnnotationMarker: ':'
4267
4280
  }
4268
4281
  };
4269
4282
 
@@ -4349,7 +4362,7 @@ exports.text = exports.parse = parseBibTxt;
4349
4362
  Object.defineProperty(exports, "__esModule", {
4350
4363
  value: true
4351
4364
  });
4352
- exports.sentenceCaseLanguages = exports.required = exports.mathScripts = exports.mathScriptFormatting = exports.ligatures = exports.ligaturePattern = exports.formattingEnvs = exports.formattingCommands = exports.formatting = exports.fieldTypes = exports.diacritics = exports.defaultStrings = exports.commands = exports.argumentCommands = void 0;
4365
+ exports.sentenceCaseLanguages = exports.required = exports.mathScripts = exports.mathScriptFormatting = exports.mathCommands = exports.ligatures = exports.ligaturePattern = exports.formattingEnvs = exports.formattingCommands = exports.formatting = exports.fieldTypes = exports.diacritics = exports.defaultStrings = exports.commands = exports.argumentCommands = void 0;
4353
4366
  var _required2 = _interopRequireDefault(require("./required.json"));
4354
4367
  var _fieldTypes2 = _interopRequireDefault(require("./fieldTypes.json"));
4355
4368
  var _unicode = _interopRequireDefault(require("./unicode.json"));
@@ -4362,6 +4375,7 @@ var required = exports.required = _required2["default"];
4362
4375
  var fieldTypes = exports.fieldTypes = _fieldTypes2["default"];
4363
4376
  var diacritics = exports.diacritics = _unicode["default"].diacritics;
4364
4377
  var commands = exports.commands = _unicode["default"].commands;
4378
+ var mathCommands = exports.mathCommands = _unicode["default"].mathCommands;
4365
4379
  var defaultStrings = exports.defaultStrings = {
4366
4380
  jan: '01',
4367
4381
  feb: '02',
@@ -4658,6 +4672,11 @@ function parseEntryValues(entry) {
4658
4672
  }
4659
4673
  output[property] = (0, _value.parse)(value + '', property, output.language);
4660
4674
  }
4675
+ for (var _property in entry.annotations) {
4676
+ for (var annotation in entry.annotations[_property]) {
4677
+ output[_property + '+an:' + annotation] = (0, _value.parseAnnotation)(entry.annotations[_property][annotation]);
4678
+ }
4679
+ }
4661
4680
  return _objectSpread(_objectSpread({}, entry), {}, {
4662
4681
  properties: output
4663
4682
  });
@@ -4845,6 +4864,7 @@ exports.bibtexGrammar = void 0;
4845
4864
  exports.parse = parse;
4846
4865
  var _core = require("@citation-js/core");
4847
4866
  var _moo = _interopRequireDefault(require("moo"));
4867
+ var _config = _interopRequireDefault(require("../config.js"));
4848
4868
  var _constants = require("./constants.js");
4849
4869
  function _interopRequireDefault(obj) {
4850
4870
  return obj && obj.__esModule ? obj : {
@@ -4900,7 +4920,7 @@ function _toPrimitive(t, r) {
4900
4920
  }
4901
4921
  return ("string" === r ? String : Number)(t);
4902
4922
  }
4903
- var identifier = /[a-zA-Z_][a-zA-Z0-9_:-]*/;
4923
+ var identifier = /[a-zA-Z_][a-zA-Z0-9_:+-]*/;
4904
4924
  var whitespace = {
4905
4925
  comment: /%.*/,
4906
4926
  whitespace: {
@@ -5041,12 +5061,11 @@ var bibtexGrammar = exports.bibtexGrammar = new _core.util.Grammar({
5041
5061
  this.consumeRule('_');
5042
5062
  this.consumeToken('comma');
5043
5063
  this.consumeRule('_');
5044
- var properties = this.consumeRule('EntryBody');
5045
- result = {
5064
+ var entryBody = this.consumeRule('EntryBody');
5065
+ result = _objectSpread({
5046
5066
  type: type,
5047
- label: label,
5048
- properties: properties
5049
- };
5067
+ label: label
5068
+ }, entryBody);
5050
5069
  }
5051
5070
  this.consumeRule('_');
5052
5071
  var closeBrace = this.consumeToken('rbrace').value;
@@ -5056,13 +5075,35 @@ var bibtexGrammar = exports.bibtexGrammar = new _core.util.Grammar({
5056
5075
  return result;
5057
5076
  },
5058
5077
  EntryBody: function EntryBody() {
5059
- var properties = {};
5078
+ var output = {
5079
+ properties: {}
5080
+ };
5060
5081
  while (this.matchToken('identifier')) {
5061
5082
  var _this$consumeRule3 = this.consumeRule('Field'),
5062
5083
  _this$consumeRule4 = _slicedToArray(_this$consumeRule3, 2),
5063
5084
  field = _this$consumeRule4[0],
5064
5085
  value = _this$consumeRule4[1];
5065
- properties[field] = value;
5086
+ var annotationField = void 0;
5087
+ var annotationName = 'default';
5088
+ if (field.endsWith(_config["default"].biber.annotationMarker)) {
5089
+ annotationField = field.slice(0, -_config["default"].biber.annotationMarker.length);
5090
+ } else if (field.includes(_config["default"].biber.annotationMarker + _config["default"].biber.namedAnnotationMarker)) {
5091
+ var _field$split = field.split(_config["default"].biber.annotationMarker + _config["default"].biber.namedAnnotationMarker);
5092
+ var _field$split2 = _slicedToArray(_field$split, 2);
5093
+ annotationField = _field$split2[0];
5094
+ annotationName = _field$split2[1];
5095
+ }
5096
+ if (annotationField) {
5097
+ if (!output.annotations) {
5098
+ output.annotations = {};
5099
+ }
5100
+ if (!output.annotations[annotationField]) {
5101
+ output.annotations[annotationField] = {};
5102
+ }
5103
+ output.annotations[annotationField][annotationName] = value;
5104
+ } else {
5105
+ output.properties[field] = value;
5106
+ }
5066
5107
  this.consumeRule('_');
5067
5108
  if (this.consumeToken('comma', true)) {
5068
5109
  this.consumeRule('_');
@@ -5070,7 +5111,7 @@ var bibtexGrammar = exports.bibtexGrammar = new _core.util.Grammar({
5070
5111
  break;
5071
5112
  }
5072
5113
  }
5073
- return properties;
5114
+ return output;
5074
5115
  },
5075
5116
  Field: function Field() {
5076
5117
  var field = this.consumeToken('identifier').value.toLowerCase();
@@ -5134,7 +5175,7 @@ function parse(text) {
5134
5175
  return bibtexGrammar.parse(lexer.reset(text));
5135
5176
  }
5136
5177
 
5137
- },{"./constants.js":55,"@citation-js/core":10,"moo":651}],59:[function(require,module,exports){
5178
+ },{"../config.js":52,"./constants.js":55,"@citation-js/core":10,"moo":651}],59:[function(require,module,exports){
5138
5179
  "use strict";
5139
5180
 
5140
5181
  Object.defineProperty(exports, "__esModule", {
@@ -5314,7 +5355,8 @@ function orderNamePieces(pieces) {
5314
5355
  },{}],61:[function(require,module,exports){
5315
5356
  module.exports={"biblatex":{"article":["author","title","journaltitle",["year","date"]],"book":["author","title",["year","date"]],"mvbook":["author","title",["year","date"]],"inbook":["author","title","booktitle",["year","date"]],"booklet":[["author","editor"],"title",["year","date"]],"collection":["editor","title",["year","date"]],"mvcollection":["editor","title",["year","date"]],"incollection":["author","title","booktitle",["year","date"]],"dataset":[["author","editor"],"title",["year","date"]],"online":[["author","editor"],"title",["year","date"],["doi","eprint","url"]],"patent":["author","title","number",["year","date"]],"periodical":["editor","title",["year","date"]],"proceedings":["title",["year","date"]],"mvproceedings":["title",["year","date"]],"inproceedings":["author","title","booktitle",["year","date"]],"report":["author","title","type","institution",["year","date"]],"thesis":["author","title","type","institution",["year","date"]],"unpublished":["author","title",["year","date"]],"conference":["author","title","booktitle",["year","date"]],"electronic":[["author","editor"],"title",["year","date"],["doi","eprint","url"]],"mastersthesis":["author","title","institution",["year","date"]],"phdthesis":["author","title","institution",["year","date"]],"techreport":["author","title","institution",["year","date"]],"www":[["author","editor"],"title",["year","date"],["doi","eprint","url"]]},"bibtex":{"article":["author","title","journal","year"],"book":[["author","editor"],"title","publisher","year"],"booklet":["title"],"inbook":[["author","editor"],"title",["chapter","pages"],"publisher","year"],"incollection":["author","title","booktitle","publisher","year"],"inproceedings":["author","title","booktitle","year"],"mastersthesis":["author","title","school","year"],"phdthesis":["author","title","school","year"],"proceedings":["title","year"],"techreport":["author","title","institution","year"],"unpublished":["author","title","note"]}}
5316
5357
  },{}],62:[function(require,module,exports){
5317
- module.exports={"diacritics":{"`":"̀","'":"́","^":"̂","~":"̃","=":"̄","u":"̆",".":"̇","\"":"̈","r":"̊","H":"̋","v":"̌","b":"̲","d":"̣","c":"̧","k":"̨","t":"͡","textcommabelow":"̦"},"commands":{"textquotesingle":"'","textasciigrave":"`","textquotedbl":"\"","textdollar":"$","textless":"<","textgreater":">","textbackslash":"\\","textasciicircum":"^","textunderscore":"_","textbraceleft":"{","textbar":"|","textbraceright":"}","textasciitilde":"~","textexclamdown":"¡","textcent":"¢","textsterling":"£","textcurrency":"¤","textyen":"¥","textbrokenbar":"¦","textsection":"§","textasciidieresis":"¨","textcopyright":"©","textordfeminine":"ª","guillemetleft":"«","guillemotleft":"«","textlnot":"¬","textregistered":"®","textasciimacron":"¯","textdegree":"°","textpm":"±","texttwosuperior":"²","textthreesuperior":"³","textasciiacute":"´","textmu":"µ","textparagraph":"¶","textperiodcentered":"·","textonesuperior":"¹","textordmasculine":"º","guillemetright":"»","guillemotright":"»","textonequarter":"¼","textonehalf":"½","textthreequarters":"¾","textquestiondown":"¿","AE":"Æ","DH":"Ð","texttimes":"×","O":"Ø","TH":"Þ","ss":"ß","ae":"æ","dh":"ð","textdiv":"÷","o":"ø","th":"þ","DJ":"Đ","dj":"đ","i":"ı","IJ":"IJ","ij":"ij","L":"Ł","l":"ł","NG":"Ŋ","ng":"ŋ","OE":"Œ","oe":"œ","textflorin":"ƒ","j":"ȷ","textasciicaron":"ˇ","textasciibreve":"˘","textacutedbl":"˝","textgravedbl":"˵","texttildelow":"˷","textbaht":"฿","SS":"ẞ","textcompwordmark":"‌","textendash":"–","textemdash":"—","textbardbl":"‖","textquoteleft":"‘","textquoteright":"’","quotesinglbase":"‚","textquotedblleft":"“","textquotedblright":"”","quotedblbase":"„","textdagger":"†","textdaggerdbl":"‡","textbullet":"•","textellipsis":"…","textperthousand":"‰","textpertenthousand":"‱","guilsinglleft":"‹","guilsinglright":"›","textreferencemark":"※","textinterrobang":"‽","textfractionsolidus":"⁄","textlquill":"⁅","textrquill":"⁆","textdiscount":"⁒","textcolonmonetary":"₡","textlira":"₤","textnaira":"₦","textwon":"₩","textdong":"₫","texteuro":"€","textpeso":"₱","textcelsius":"℃","textnumero":"№","textcircledP":"℗","textrecipe":"℞","textservicemark":"℠","texttrademark":"™","textohm":"Ω","textmho":"℧","textestimated":"℮","textleftarrow":"←","textuparrow":"↑","textrightarrow":"→","textdownarrow":"↓","textminus":"−","Hwithstroke":"Ħ","hwithstroke":"ħ","textasteriskcentered":"∗","textsurd":"√","textlangle":"〈","textrangle":"〉","textblank":"␢","textvisiblespace":"␣","textopenbullet":"◦","textbigcircle":"◯","textmusicalnote":"♪","textmarried":"⚭","textdivorced":"⚮","textinterrobangdown":"⸘","textcommabelow":null,"copyright":"©","Gamma":"Γ","Delta":"Δ","Theta":"Θ","Lambda":"Λ","Xi":"Ξ","Pi":"Π","Sigma":"Σ","Phi":"Φ","Psi":"Ψ","Omega":"Ω","alpha":"α","beta":"β","gamma":"γ","delta":"δ","varepsilon":"ε","zeta":"ζ","eta":"η","theta":"θ","iota":"ι","kappa":"κ","lambda":"λ","mu":"μ","nu":"ν","xi":"ξ","pi":"π","rho":"ρ","varsigma":"ς","sigma":"σ","tau":"τ","upsilon":"υ","varphi":"φ","chi":"χ","psi":"ψ","omega":"ω","vartheta":"ϑ","Upsilon":"ϒ","phi":"ϕ","varpi":"ϖ","varrho":"ϱ","epsilon":"ϵ"}}
5358
+ module.exports={"diacritics":{"`":"̀","'":"́","^":"̂","~":"̃","=":"̄","u":"̆",".":"̇","\"":"̈","r":"̊","H":"̋","v":"̌","b":"̲","d":"̣","c":"̧","k":"̨","t":"͡","textcommabelow":"̦"},"commands":{"textquotesingle":"'","textasciigrave":"`","textquotedbl":"\"","textdollar":"$","textless":"<","textgreater":">","textbackslash":"\\","textasciicircum":"^","textunderscore":"_","textbraceleft":"{","textbar":"|","textbraceright":"}","textasciitilde":"~","textexclamdown":"¡","textcent":"¢","textsterling":"£","textcurrency":"¤","textyen":"¥","textbrokenbar":"¦","textsection":"§","textasciidieresis":"¨","textcopyright":"©","textordfeminine":"ª","guillemetleft":"«","guillemotleft":"«","textlnot":"¬","textregistered":"®","textasciimacron":"¯","textdegree":"°","textpm":"±","texttwosuperior":"²","textthreesuperior":"³","textasciiacute":"´","textmu":"µ","textparagraph":"¶","textperiodcentered":"·","textonesuperior":"¹","textordmasculine":"º","guillemetright":"»","guillemotright":"»","textonequarter":"¼","textonehalf":"½","textthreequarters":"¾","textquestiondown":"¿","AE":"Æ","DH":"Ð","texttimes":"×","O":"Ø","TH":"Þ","ss":"ß","ae":"æ","dh":"ð","textdiv":"÷","o":"ø","th":"þ","DJ":"Đ","dj":"đ","i":"ı","IJ":"IJ","ij":"ij","L":"Ł","l":"ł","NG":"Ŋ","ng":"ŋ","OE":"Œ","oe":"œ","textflorin":"ƒ","j":"ȷ","textasciicaron":"ˇ","textasciibreve":"˘","textacutedbl":"˝","textgravedbl":"˵","texttildelow":"˷","textbaht":"฿","SS":"ẞ","textcompwordmark":"‌","textendash":"–","textemdash":"—","textbardbl":"‖","textquoteleft":"‘","textquoteright":"’","quotesinglbase":"‚","textquotedblleft":"“","textquotedblright":"”","quotedblbase":"„","textdagger":"†","textdaggerdbl":"‡","textbullet":"•","textellipsis":"…","textperthousand":"‰","textpertenthousand":"‱","guilsinglleft":"‹","guilsinglright":"›","textreferencemark":"※","textinterrobang":"‽","textfractionsolidus":"⁄","textlquill":"⁅","textrquill":"⁆","textdiscount":"⁒","textcolonmonetary":"₡","textlira":"₤","textnaira":"₦","textwon":"₩","textdong":"₫","texteuro":"€","textpeso":"₱","textcelsius":"℃","textnumero":"№","textcircledP":"℗","textrecipe":"℞","textservicemark":"℠","texttrademark":"™","textohm":"Ω","textmho":"℧","textestimated":"℮","textleftarrow":"←","textuparrow":"↑","textrightarrow":"→","textdownarrow":"↓","textminus":"−","Hwithstroke":"Ħ","hwithstroke":"ħ","textasteriskcentered":"∗","textsurd":"√","textlangle":"〈","textrangle":"〉","textblank":"␢","textvisiblespace":"␣","textopenbullet":"◦","textbigcircle":"◯","textmusicalnote":"♪","textmarried":"⚭","textdivorced":"⚮","textinterrobangdown":"⸘","textcommabelow":null,"copyright":"©"},"mathCommands":{"Gamma":"Γ","Delta":"Δ","Theta":"Θ","Lambda":"Λ","Xi":"Ξ","Pi":"Π","Sigma":"Σ","Phi":"Φ","Psi":"Ψ","Omega":"Ω","alpha":"α","beta":"β","gamma":"γ","delta":"δ","varepsilon":"ε","zeta":"ζ","eta":"η","theta":"θ","iota":"ι","kappa":"κ","lambda":"λ","mu":"μ","nu":"ν","xi":"ξ","pi":"π","rho":"ρ","varsigma":"ς","sigma":"σ","tau":"τ","upsilon":"υ","varphi":"φ","chi":"χ","psi":"ψ","omega":"ω","vartheta":"ϑ","Upsilon":"ϒ","phi":"ϕ","varpi":"ϖ","varrho":"ϱ","epsilon":"ϵ"}}
5359
+
5318
5360
  },{}],63:[function(require,module,exports){
5319
5361
  "use strict";
5320
5362
 
@@ -5329,6 +5371,7 @@ Object.defineProperty(exports, "__esModule", {
5329
5371
  value: true
5330
5372
  });
5331
5373
  exports.parse = parse;
5374
+ exports.parseAnnotation = parseAnnotation;
5332
5375
  exports.valueGrammar = void 0;
5333
5376
  var _core = require("@citation-js/core");
5334
5377
  var _moo = _interopRequireDefault(require("moo"));
@@ -5415,12 +5458,12 @@ function _toPrimitive(t, r) {
5415
5458
  return ("string" === r ? String : Number)(t);
5416
5459
  }
5417
5460
  var text = {
5461
+ commandBegin: {
5462
+ match: '\\begin',
5463
+ push: 'environment'
5464
+ },
5418
5465
  command: {
5419
5466
  match: /\\(?:[a-zA-Z]+|.) */,
5420
- type: _moo["default"].keywords({
5421
- commandBegin: '\\begin',
5422
- commandEnd: '\\end'
5423
- }),
5424
5467
  value: function value(s) {
5425
5468
  return s.slice(1).trim();
5426
5469
  }
@@ -5463,6 +5506,15 @@ var lexer = _moo["default"].states({
5463
5506
  }, text), {}, {
5464
5507
  text: /[^{$}\s~\\,]+/
5465
5508
  }),
5509
+ annotation: _objectSpread(_objectSpread({}, text), {}, {
5510
+ colon: ':',
5511
+ equals: '=',
5512
+ comma: ',',
5513
+ semicolon: ';',
5514
+ quote: '"',
5515
+ itemCount: /\d+/,
5516
+ text: /[^{$}\s~\\":;,=]+/
5517
+ }),
5466
5518
  bracedLiteral: _objectSpread(_objectSpread({}, text), {}, {
5467
5519
  rbrace: {
5468
5520
  match: '}',
@@ -5477,6 +5529,14 @@ var lexer = _moo["default"].states({
5477
5529
  },
5478
5530
  script: /[\^_]/,
5479
5531
  text: /[^{$}\s~\\^_]+/
5532
+ }),
5533
+ environment: _objectSpread(_objectSpread({
5534
+ commandEnd: {
5535
+ match: '\\end',
5536
+ pop: true
5537
+ }
5538
+ }, text), {}, {
5539
+ text: /[^{$}\s~\\]+/
5480
5540
  })
5481
5541
  });
5482
5542
  function flattenConsString(string) {
@@ -5629,6 +5689,87 @@ var valueGrammar = exports.valueGrammar = new _core.util.Grammar({
5629
5689
  }
5630
5690
  return flattenConsString(output);
5631
5691
  },
5692
+ Annotations: function Annotations() {
5693
+ var annotations = {};
5694
+ while (true) {
5695
+ var _this$consumeRule = this.consumeRule('Annotation'),
5696
+ scope = _this$consumeRule.scope,
5697
+ item = _this$consumeRule.item,
5698
+ part = _this$consumeRule.part,
5699
+ value = _this$consumeRule.value;
5700
+ if (scope === 'part') {
5701
+ if (!annotations.part) {
5702
+ annotations.part = [];
5703
+ }
5704
+ if (!annotations.part[item]) {
5705
+ annotations.part[item] = {};
5706
+ }
5707
+ annotations.part[item][part] = value;
5708
+ } else if (scope === 'item') {
5709
+ if (!annotations.item) {
5710
+ annotations.item = [];
5711
+ }
5712
+ annotations.item[item] = value;
5713
+ } else {
5714
+ annotations.field = value;
5715
+ }
5716
+ if (this.matchEndOfFile()) {
5717
+ break;
5718
+ } else {
5719
+ this.consumeToken('semicolon');
5720
+ this.consumeRule('_');
5721
+ }
5722
+ }
5723
+ return annotations;
5724
+ },
5725
+ Annotation: function Annotation() {
5726
+ var annotation = {};
5727
+ if (this.matchToken('itemCount')) {
5728
+ annotation.item = parseInt(this.consumeToken('itemCount')) - 1;
5729
+ if (this.matchToken('colon')) {
5730
+ this.consumeToken('colon');
5731
+ annotation.part = this.consumeToken('text');
5732
+ annotation.scope = 'part';
5733
+ } else {
5734
+ annotation.scope = 'item';
5735
+ }
5736
+ } else {
5737
+ annotation.scope = 'field';
5738
+ }
5739
+ this.consumeToken('equals');
5740
+ this.consumeRule('_');
5741
+ if (this.matchToken('quote')) {
5742
+ this.consumeToken('quote');
5743
+ var literal = '';
5744
+ while (!this.matchToken('quote')) {
5745
+ if (this.matchToken('itemCount') || this.matchToken('colon') || this.matchToken('comma') || this.matchToken('semicolon') || this.matchToken('equals')) {
5746
+ literal += this.token.value;
5747
+ this.token = this.lexer.next();
5748
+ } else {
5749
+ literal += this.consumeRule('Text');
5750
+ }
5751
+ }
5752
+ this.consumeToken('quote');
5753
+ annotation.value = flattenConsString(literal);
5754
+ this.consumeRule('_');
5755
+ } else {
5756
+ annotation.value = [];
5757
+ var output = '';
5758
+ while (true) {
5759
+ output += this.consumeRule('Text');
5760
+ if (this.matchToken('comma')) {
5761
+ this.consumeToken('comma');
5762
+ this.consumeRule('_');
5763
+ annotation.value.push(flattenConsString(output));
5764
+ output = '';
5765
+ } else if (this.matchEndOfFile() || this.matchToken('semicolon')) {
5766
+ annotation.value.push(flattenConsString(output));
5767
+ break;
5768
+ }
5769
+ }
5770
+ }
5771
+ return annotation;
5772
+ },
5632
5773
  BracketString: function BracketString() {
5633
5774
  var _this$state;
5634
5775
  var output = '';
@@ -5732,6 +5873,8 @@ var valueGrammar = exports.valueGrammar = new _core.util.Grammar({
5732
5873
  return applyFormatting(_text7, _format);
5733
5874
  } else if (command in constants.commands) {
5734
5875
  return constants.commands[command];
5876
+ } else if (command in constants.mathCommands) {
5877
+ return constants.mathCommands[command];
5735
5878
  } else if (command in constants.diacritics && !this.matchEndOfFile()) {
5736
5879
  var _text8 = this.consumeRule('Text');
5737
5880
  var diacritic = _text8[0] + constants.diacritics[command];
@@ -5771,6 +5914,11 @@ var valueGrammar = exports.valueGrammar = new _core.util.Grammar({
5771
5914
  throw new SyntaxError(this.lexer.formatError(end, "environment started with \"".concat(beginEnv, "\", ended with \"").concat(endEnv, "\"")));
5772
5915
  }
5773
5916
  return applyFormatting(output, constants.formattingEnvs[beginEnv]);
5917
+ },
5918
+ _: function _() {
5919
+ while (this.matchToken('whitespace')) {
5920
+ this.consumeToken('whitespace');
5921
+ }
5774
5922
  }
5775
5923
  }, {
5776
5924
  sentenceCase: false,
@@ -5836,6 +5984,13 @@ function parse(text, field) {
5836
5984
  col: 0
5837
5985
  }), getMainRule(fieldType, languages));
5838
5986
  }
5987
+ function parseAnnotation(text) {
5988
+ return valueGrammar.parse(lexer.reset(text, {
5989
+ state: 'annotation',
5990
+ line: 0,
5991
+ col: 0
5992
+ }), 'Annotations');
5993
+ }
5839
5994
 
5840
5995
  },{"../config.js":52,"./constants.js":55,"./name.js":60,"@citation-js/core":10,"moo":651}],64:[function(require,module,exports){
5841
5996
  "use strict";
@@ -5980,9 +6135,9 @@ var _default = exports["default"] = new _core.util.Translator([].concat(aliases,
5980
6135
  source: 'annotation',
5981
6136
  target: 'annote'
5982
6137
  }, {
5983
- source: 'author',
6138
+ source: ['author', 'author+an:orcid'],
5984
6139
  target: 'author',
5985
- convert: _shared.Converters.NAMES
6140
+ convert: _shared.Converters.NAMES_ORCID
5986
6141
  }, {
5987
6142
  source: 'library',
5988
6143
  target: 'call-number'
@@ -7372,6 +7527,31 @@ var Converters = exports.Converters = {
7372
7527
  return list.map(name.convertToSource);
7373
7528
  }
7374
7529
  },
7530
+ NAMES_ORCID: {
7531
+ toTarget: function toTarget(list, orcid) {
7532
+ return list.map(function (inputName, i) {
7533
+ var _orcid$item;
7534
+ var outputName = name.convertToTarget(inputName);
7535
+ if (typeof (orcid === null || orcid === void 0 || (_orcid$item = orcid.item) === null || _orcid$item === void 0 ? void 0 : _orcid$item[i]) === 'string') {
7536
+ outputName._orcid = orcid.item[i];
7537
+ }
7538
+ return outputName;
7539
+ });
7540
+ },
7541
+ toSource: function toSource(list) {
7542
+ var names = [];
7543
+ var orcid = [];
7544
+ for (var i = 0; i < list.length; i++) {
7545
+ names.push(name.convertToSource(list[i]));
7546
+ if (list[i]._orcid) {
7547
+ orcid[i] = list[i]._orcid;
7548
+ }
7549
+ }
7550
+ return [names, orcid.length ? {
7551
+ item: orcid
7552
+ } : undefined];
7553
+ }
7554
+ },
7375
7555
  PAGES: {
7376
7556
  toTarget: function toTarget(pages) {
7377
7557
  return pages.replace(/[–—]/, '-');
@@ -7415,27 +7595,34 @@ var Converters = exports.Converters = {
7415
7595
  },{"../config.js":52,"@citation-js/core":10}],71:[function(require,module,exports){
7416
7596
  "use strict";
7417
7597
 
7418
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7419
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7420
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7421
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7422
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7423
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7424
7598
  Object.defineProperty(exports, "__esModule", {
7425
7599
  value: true
7426
7600
  });
7427
7601
  exports.format = format;
7428
- function formatEntry(_ref, dict) {
7429
- var type = _ref.type,
7430
- label = _ref.label,
7431
- properties = _ref.properties;
7432
- var fields = Object.entries(properties).map(function (_ref2) {
7433
- var _ref3 = _slicedToArray(_ref2, 2),
7434
- field = _ref3[0],
7435
- value = _ref3[1];
7436
- return dict.listItem.join("".concat(field, " = {").concat(value, "},"));
7437
- });
7438
- return dict.entry.join("@".concat(type, "{").concat(label, ",").concat(dict.list.join(fields.join('')), "}"));
7602
+ var _config = _interopRequireDefault(require("../config.js"));
7603
+ function _interopRequireDefault(obj) {
7604
+ return obj && obj.__esModule ? obj : {
7605
+ "default": obj
7606
+ };
7607
+ }
7608
+ function formatField(field, value, dict) {
7609
+ return dict.listItem.join("".concat(field, " = {").concat(value, "},"));
7610
+ }
7611
+ function formatEntry(entry, dict) {
7612
+ var fields = [];
7613
+ for (var field in entry.properties) {
7614
+ fields.push(formatField(field, entry.properties[field], dict));
7615
+ if (entry.annotations && entry.annotations[field]) {
7616
+ for (var annotation in entry.annotations[field]) {
7617
+ var annotationField = field + _config["default"].biber.annotationMarker;
7618
+ if (annotation !== 'default') {
7619
+ annotationField += _config["default"].biber.namedAnnotationMarker + annotation;
7620
+ }
7621
+ fields.push(formatField(annotationField, entry.annotations[field][annotation], dict));
7622
+ }
7623
+ }
7624
+ }
7625
+ return dict.entry.join("@".concat(entry.type, "{").concat(entry.label, ",").concat(dict.list.join(fields.join('')), "}"));
7439
7626
  }
7440
7627
  function format(src, dict) {
7441
7628
  var entries = src.map(function (entry) {
@@ -7444,7 +7631,7 @@ function format(src, dict) {
7444
7631
  return dict.bibliographyContainer.join(entries);
7445
7632
  }
7446
7633
 
7447
- },{}],72:[function(require,module,exports){
7634
+ },{"../config.js":52}],72:[function(require,module,exports){
7448
7635
  "use strict";
7449
7636
 
7450
7637
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -7479,6 +7666,12 @@ function format(src, dict) {
7479
7666
  },{}],73:[function(require,module,exports){
7480
7667
  "use strict";
7481
7668
 
7669
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7670
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7671
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7672
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7673
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7674
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7482
7675
  Object.defineProperty(exports, "__esModule", {
7483
7676
  value: true
7484
7677
  });
@@ -7490,16 +7683,30 @@ function formatEntryValues(_ref) {
7490
7683
  var type = _ref.type,
7491
7684
  label = _ref.label,
7492
7685
  properties = _ref.properties;
7493
- var output = {};
7494
- for (var property in properties) {
7495
- var value = properties[property];
7496
- output[property] = (0, _value.format)(property, value);
7497
- }
7498
- return {
7686
+ var output = {
7499
7687
  type: type,
7500
7688
  label: label,
7501
- properties: output
7689
+ properties: {}
7502
7690
  };
7691
+ for (var property in properties) {
7692
+ var value = properties[property];
7693
+ var _property$split = property.split('+an:'),
7694
+ _property$split2 = _slicedToArray(_property$split, 2),
7695
+ field = _property$split2[0],
7696
+ annotation = _property$split2[1];
7697
+ if (annotation) {
7698
+ if (!output.annotations) {
7699
+ output.annotations = {};
7700
+ }
7701
+ if (!output.annotations[field]) {
7702
+ output.annotations[field] = {};
7703
+ }
7704
+ output.annotations[field][annotation] = (0, _value.formatAnnotation)(value);
7705
+ } else {
7706
+ output.properties[property] = (0, _value.format)(property, value);
7707
+ }
7708
+ }
7709
+ return output;
7503
7710
  }
7504
7711
  function format(entries) {
7505
7712
  return (0, _index.format)(entries).map(formatEntryValues);
@@ -7554,7 +7761,14 @@ Object.defineProperty(exports, "__esModule", {
7554
7761
  value: true
7555
7762
  });
7556
7763
  exports.format = format;
7764
+ exports.formatAnnotation = formatAnnotation;
7765
+ var _config = _interopRequireDefault(require("../config.js"));
7557
7766
  var _constants = require("../input/constants.js");
7767
+ function _interopRequireDefault(obj) {
7768
+ return obj && obj.__esModule ? obj : {
7769
+ "default": obj
7770
+ };
7771
+ }
7558
7772
  var unicode = {};
7559
7773
  for (var command in _constants.commands) {
7560
7774
  unicode[_constants.commands[command]] = command;
@@ -7565,8 +7779,13 @@ for (var diacritic in _constants.diacritics) {
7565
7779
  for (var ligature in _constants.ligatures) {
7566
7780
  unicode[_constants.ligatures[ligature]] = ligature;
7567
7781
  }
7782
+ var mathUnicode = {};
7783
+ for (var _command in _constants.mathCommands) {
7784
+ mathUnicode[_constants.mathCommands[_command]] = _command;
7785
+ }
7568
7786
  var UNSAFE_UNICODE = /[^a-zA-Z0-9\s!"#%&'()*+,\-./:;=?@[\]{}\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]/g;
7569
7787
  var DIACRITIC_PATTERN = /.[\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]+/g;
7788
+ var LONE_DIACRITIC_PATTERN = /[\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]/g;
7570
7789
  var listDelimiters = {
7571
7790
  separated: ',',
7572
7791
  list: ' and '
@@ -7580,14 +7799,26 @@ var richTextMappings = {
7580
7799
  'span style="font-variant:small-caps;"': '\\textsc{',
7581
7800
  'span class="nocase"': '{'
7582
7801
  };
7802
+ function escapeCharacter(_char) {
7803
+ if (_char in unicode) {
7804
+ return unicode[_char] in _constants.ligatures ? unicode[_char] : "\\".concat(unicode[_char], "{}");
7805
+ } else if (_char in mathUnicode) {
7806
+ return "$\\".concat(mathUnicode[_char], "$");
7807
+ } else {
7808
+ return '';
7809
+ }
7810
+ }
7583
7811
  function escapeValue(value) {
7584
- return value.normalize('NFKD').replace(UNSAFE_UNICODE, function (_char) {
7585
- return _char in unicode ? unicode[_char] in _constants.ligatures ? unicode[_char] : "\\".concat(unicode[_char], "{}") : '';
7812
+ if (!_config["default"].format.asciiOnly) {
7813
+ return value;
7814
+ }
7815
+ return value.normalize('NFKD').replace(UNSAFE_UNICODE, function (_char2) {
7816
+ return escapeCharacter(_char2);
7586
7817
  }).replace(DIACRITIC_PATTERN, function (match) {
7587
7818
  return Array.from(match).reduce(function (subject, diacritic) {
7588
7819
  return "{\\".concat(unicode[diacritic], " ").concat(subject, "}");
7589
7820
  });
7590
- });
7821
+ }).replace(LONE_DIACRITIC_PATTERN, '');
7591
7822
  }
7592
7823
  function formatRichText(value) {
7593
7824
  var closingTags = [];
@@ -7628,7 +7859,7 @@ function formatName(name) {
7628
7859
  }
7629
7860
  function formatTitle(title) {
7630
7861
  return formatRichText(title).split(/(:\s*)/).map(function (part, i) {
7631
- return i % 2 ? part : part.replace(/(?!^)\b[a-z]*[A-Z].*?\b/g, '{$&}');
7862
+ return i % 2 ? part : part.replace(/([^\\])\b([a-z]*[A-Z].*?)\b/g, '$1{$2}');
7632
7863
  }).join('');
7633
7864
  }
7634
7865
  function formatSingleValue(value, valueType) {
@@ -7653,6 +7884,15 @@ function formatList(values, valueType, listType) {
7653
7884
  return formatted.includes(delimiter) ? "{".concat(formatted, "}") : formatted;
7654
7885
  }).join(delimiter);
7655
7886
  }
7887
+ function formatAnnotationValue(values) {
7888
+ if (Array.isArray(values)) {
7889
+ return values.map(function (value) {
7890
+ return escapeValue(value).replace(/([;,"])/g, '{$1}');
7891
+ }).join(', ');
7892
+ } else {
7893
+ return '"' + escapeValue(values).replace(/(["])/g, '{$1}') + '"';
7894
+ }
7895
+ }
7656
7896
  function format(field, value) {
7657
7897
  if (!(field in _constants.fieldTypes)) {
7658
7898
  return formatSingleValue(value, 'verbatim');
@@ -7666,8 +7906,44 @@ function format(field, value) {
7666
7906
  return formatSingleValue(value, valueType);
7667
7907
  }
7668
7908
  }
7909
+ function formatAnnotation(value) {
7910
+ var annotations = [];
7911
+ if (value.field) {
7912
+ annotations.push('=' + formatAnnotationValue(value.field));
7913
+ }
7914
+ if (value.item) {
7915
+ for (var _i = 0, _Object$entries = Object.entries(value.item); _i < _Object$entries.length; _i++) {
7916
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
7917
+ itemCount = _Object$entries$_i[0],
7918
+ itemValue = _Object$entries$_i[1];
7919
+ if (!itemValue) {
7920
+ continue;
7921
+ }
7922
+ var i = parseInt(itemCount) + 1;
7923
+ annotations.push(i + '=' + formatAnnotationValue(itemValue));
7924
+ }
7925
+ }
7926
+ if (value.part) {
7927
+ for (var _i2 = 0, _Object$entries2 = Object.entries(value.part); _i2 < _Object$entries2.length; _i2++) {
7928
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
7929
+ _itemCount = _Object$entries2$_i[0],
7930
+ _itemValue = _Object$entries2$_i[1];
7931
+ if (!_itemValue) {
7932
+ continue;
7933
+ }
7934
+ var _i3 = parseInt(_itemCount) + 1;
7935
+ for (var part in _itemValue) {
7936
+ if (!_itemValue[part]) {
7937
+ continue;
7938
+ }
7939
+ annotations.push(_i3 + ':' + part + '=' + formatAnnotationValue(_itemValue[part]));
7940
+ }
7941
+ }
7942
+ }
7943
+ return annotations.join('; ');
7944
+ }
7669
7945
 
7670
- },{"../input/constants.js":55}],76:[function(require,module,exports){
7946
+ },{"../config.js":52,"../input/constants.js":55}],76:[function(require,module,exports){
7671
7947
  "use strict";
7672
7948
 
7673
7949
  Object.defineProperty(exports, "__esModule", {
@@ -8103,7 +8379,7 @@ var formats = exports.formats = {
8103
8379
  parseAsync: api.parseAsync,
8104
8380
  parseType: {
8105
8381
  dataType: 'String',
8106
- predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9]+))\s*$/i,
8382
+ predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+))\s*$/i,
8107
8383
  "extends": '@else/url'
8108
8384
  }
8109
8385
  },
@@ -8113,21 +8389,21 @@ var formats = exports.formats = {
8113
8389
  },
8114
8390
  parseType: {
8115
8391
  dataType: 'String',
8116
- predicate: /^\s*((?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9]+))\s*$/i
8392
+ predicate: /^\s*((?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+))\s*$/i
8117
8393
  }
8118
8394
  },
8119
8395
  '@doi/id': {
8120
8396
  parse: id.parse,
8121
8397
  parseType: {
8122
8398
  dataType: 'String',
8123
- predicate: /^\s*(10.\d{4,9}\/[-._;()/:A-Z0-9]+)\s*$/i
8399
+ predicate: /^\s*(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+)\s*$/i
8124
8400
  }
8125
8401
  },
8126
8402
  '@doi/list+text': {
8127
8403
  parse: id.parse,
8128
8404
  parseType: {
8129
8405
  dataType: 'String',
8130
- tokenList: /^10.\d{4,9}\/[-._;()/:A-Z0-9]+$/i
8406
+ tokenList: /^10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+$/i
8131
8407
  }
8132
8408
  },
8133
8409
  '@doi/list+object': {
@@ -15236,58 +15512,71 @@ var FETCH_ADDITIONAL = {
15236
15512
  }
15237
15513
  };
15238
15514
  function collectAdditionalIds(entity, needed) {
15515
+ var additionalIds = [];
15239
15516
  if (!needed) {
15240
- return [];
15517
+ return additionalIds;
15241
15518
  }
15242
15519
  entity._needed = Object.assign(entity._needed || {}, needed);
15243
- return Object.keys(entity.claims).filter(function (prop) {
15244
- return prop in needed;
15245
- }).flatMap(function (prop) {
15246
- return entity.claims[prop].map(function (_ref) {
15247
- var value = _ref.value;
15248
- return value.id || value;
15249
- });
15250
- });
15520
+ for (var prop in entity.claims) {
15521
+ if (prop in needed) {
15522
+ var _iterator = _createForOfIteratorHelper(entity.claims[prop]),
15523
+ _step;
15524
+ try {
15525
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
15526
+ var claim = _step.value;
15527
+ if (claim.value) {
15528
+ var _claim$value$id;
15529
+ additionalIds.push((_claim$value$id = claim.value.id) !== null && _claim$value$id !== void 0 ? _claim$value$id : claim.value);
15530
+ }
15531
+ }
15532
+ } catch (err) {
15533
+ _iterator.e(err);
15534
+ } finally {
15535
+ _iterator.f();
15536
+ }
15537
+ }
15538
+ }
15539
+ return additionalIds;
15251
15540
  }
15252
15541
  function completeResponse(entities, old) {
15253
15542
  if (!old) {
15254
15543
  var allIds = [];
15255
15544
  for (var id in entities) {
15256
15545
  var _ids = collectAdditionalIds(entities[id], FETCH_ADDITIONAL);
15257
- var _iterator = _createForOfIteratorHelper(_ids),
15258
- _step;
15546
+ var _iterator2 = _createForOfIteratorHelper(_ids),
15547
+ _step2;
15259
15548
  try {
15260
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
15261
- var _id2 = _step.value;
15549
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
15550
+ var _id2 = _step2.value;
15262
15551
  if (!allIds.includes(_id2)) {
15263
15552
  allIds.push(_id2);
15264
15553
  }
15265
15554
  }
15266
15555
  } catch (err) {
15267
- _iterator.e(err);
15556
+ _iterator2.e(err);
15268
15557
  } finally {
15269
- _iterator.f();
15558
+ _iterator2.f();
15270
15559
  }
15271
15560
  }
15272
15561
  return allIds;
15273
15562
  }
15274
15563
  var ids = [];
15275
- var _iterator2 = _createForOfIteratorHelper(old),
15276
- _step2;
15564
+ var _iterator3 = _createForOfIteratorHelper(old),
15565
+ _step3;
15277
15566
  try {
15278
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
15279
- var _id3 = _step2.value;
15567
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
15568
+ var _id3 = _step3.value;
15280
15569
  var entity = entities[_id3];
15281
15570
  if (!entity._needed) {
15282
15571
  continue;
15283
15572
  }
15284
15573
  for (var prop in entity.claims) {
15285
15574
  if (prop in entity._needed) {
15286
- var _iterator3 = _createForOfIteratorHelper(entity.claims[prop]),
15287
- _step3;
15575
+ var _iterator4 = _createForOfIteratorHelper(entity.claims[prop]),
15576
+ _step4;
15288
15577
  try {
15289
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
15290
- var claim = _step3.value;
15578
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
15579
+ var claim = _step4.value;
15291
15580
  if (claim.value && claim.value.id) {
15292
15581
  continue;
15293
15582
  }
@@ -15295,18 +15584,18 @@ function completeResponse(entities, old) {
15295
15584
  ids.push.apply(ids, _toConsumableArray(collectAdditionalIds(claim.value, entity._needed[prop])));
15296
15585
  }
15297
15586
  } catch (err) {
15298
- _iterator3.e(err);
15587
+ _iterator4.e(err);
15299
15588
  } finally {
15300
- _iterator3.f();
15589
+ _iterator4.f();
15301
15590
  }
15302
15591
  }
15303
15592
  }
15304
15593
  delete entity._needed;
15305
15594
  }
15306
15595
  } catch (err) {
15307
- _iterator2.e(err);
15596
+ _iterator3.e(err);
15308
15597
  } finally {
15309
- _iterator2.f();
15598
+ _iterator3.f();
15310
15599
  }
15311
15600
  return ids;
15312
15601
  }
@@ -15391,7 +15680,7 @@ function _fillCacheAsync() {
15391
15680
  urls = filterIdsAndGetUrls(state.needed, cache);
15392
15681
  _context2.next = 6;
15393
15682
  return Promise.all(urls.map(function () {
15394
- var _ref2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(url) {
15683
+ var _ref = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(url) {
15395
15684
  return _regeneratorRuntime().wrap(function _callee$(_context) {
15396
15685
  while (1) switch (_context.prev = _context.next) {
15397
15686
  case 0:
@@ -15409,7 +15698,7 @@ function _fillCacheAsync() {
15409
15698
  }, _callee);
15410
15699
  }));
15411
15700
  return function (_x3) {
15412
- return _ref2.apply(this, arguments);
15701
+ return _ref.apply(this, arguments);
15413
15702
  };
15414
15703
  }()));
15415
15704
  case 6: