citation-js 0.7.7 → 0.7.8
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 +82 -41
- package/build/citation.min.js +1 -1
- package/package.json +5 -5
package/build/citation.js
CHANGED
|
@@ -4263,7 +4263,8 @@ var _default = exports["default"] = {
|
|
|
4263
4263
|
sentenceCase: 'never'
|
|
4264
4264
|
},
|
|
4265
4265
|
format: {
|
|
4266
|
-
useIdAsLabel: false
|
|
4266
|
+
useIdAsLabel: false,
|
|
4267
|
+
asciiOnly: true
|
|
4267
4268
|
}
|
|
4268
4269
|
};
|
|
4269
4270
|
|
|
@@ -4349,7 +4350,7 @@ exports.text = exports.parse = parseBibTxt;
|
|
|
4349
4350
|
Object.defineProperty(exports, "__esModule", {
|
|
4350
4351
|
value: true
|
|
4351
4352
|
});
|
|
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;
|
|
4353
|
+
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
4354
|
var _required2 = _interopRequireDefault(require("./required.json"));
|
|
4354
4355
|
var _fieldTypes2 = _interopRequireDefault(require("./fieldTypes.json"));
|
|
4355
4356
|
var _unicode = _interopRequireDefault(require("./unicode.json"));
|
|
@@ -4362,6 +4363,7 @@ var required = exports.required = _required2["default"];
|
|
|
4362
4363
|
var fieldTypes = exports.fieldTypes = _fieldTypes2["default"];
|
|
4363
4364
|
var diacritics = exports.diacritics = _unicode["default"].diacritics;
|
|
4364
4365
|
var commands = exports.commands = _unicode["default"].commands;
|
|
4366
|
+
var mathCommands = exports.mathCommands = _unicode["default"].mathCommands;
|
|
4365
4367
|
var defaultStrings = exports.defaultStrings = {
|
|
4366
4368
|
jan: '01',
|
|
4367
4369
|
feb: '02',
|
|
@@ -5314,7 +5316,8 @@ function orderNamePieces(pieces) {
|
|
|
5314
5316
|
},{}],61:[function(require,module,exports){
|
|
5315
5317
|
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
5318
|
},{}],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":"ϵ"}}
|
|
5319
|
+
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":"ϵ"}}
|
|
5320
|
+
|
|
5318
5321
|
},{}],63:[function(require,module,exports){
|
|
5319
5322
|
"use strict";
|
|
5320
5323
|
|
|
@@ -5732,6 +5735,8 @@ var valueGrammar = exports.valueGrammar = new _core.util.Grammar({
|
|
|
5732
5735
|
return applyFormatting(_text7, _format);
|
|
5733
5736
|
} else if (command in constants.commands) {
|
|
5734
5737
|
return constants.commands[command];
|
|
5738
|
+
} else if (command in constants.mathCommands) {
|
|
5739
|
+
return constants.mathCommands[command];
|
|
5735
5740
|
} else if (command in constants.diacritics && !this.matchEndOfFile()) {
|
|
5736
5741
|
var _text8 = this.consumeRule('Text');
|
|
5737
5742
|
var diacritic = _text8[0] + constants.diacritics[command];
|
|
@@ -7554,7 +7559,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7554
7559
|
value: true
|
|
7555
7560
|
});
|
|
7556
7561
|
exports.format = format;
|
|
7562
|
+
var _config = _interopRequireDefault(require("../config.js"));
|
|
7557
7563
|
var _constants = require("../input/constants.js");
|
|
7564
|
+
function _interopRequireDefault(obj) {
|
|
7565
|
+
return obj && obj.__esModule ? obj : {
|
|
7566
|
+
"default": obj
|
|
7567
|
+
};
|
|
7568
|
+
}
|
|
7558
7569
|
var unicode = {};
|
|
7559
7570
|
for (var command in _constants.commands) {
|
|
7560
7571
|
unicode[_constants.commands[command]] = command;
|
|
@@ -7565,8 +7576,13 @@ for (var diacritic in _constants.diacritics) {
|
|
|
7565
7576
|
for (var ligature in _constants.ligatures) {
|
|
7566
7577
|
unicode[_constants.ligatures[ligature]] = ligature;
|
|
7567
7578
|
}
|
|
7579
|
+
var mathUnicode = {};
|
|
7580
|
+
for (var _command in _constants.mathCommands) {
|
|
7581
|
+
mathUnicode[_constants.mathCommands[_command]] = _command;
|
|
7582
|
+
}
|
|
7568
7583
|
var UNSAFE_UNICODE = /[^a-zA-Z0-9\s!"#%&'()*+,\-./:;=?@[\]{}\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]/g;
|
|
7569
7584
|
var DIACRITIC_PATTERN = /.[\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]+/g;
|
|
7585
|
+
var LONE_DIACRITIC_PATTERN = /[\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]/g;
|
|
7570
7586
|
var listDelimiters = {
|
|
7571
7587
|
separated: ',',
|
|
7572
7588
|
list: ' and '
|
|
@@ -7580,14 +7596,26 @@ var richTextMappings = {
|
|
|
7580
7596
|
'span style="font-variant:small-caps;"': '\\textsc{',
|
|
7581
7597
|
'span class="nocase"': '{'
|
|
7582
7598
|
};
|
|
7599
|
+
function escapeCharacter(_char) {
|
|
7600
|
+
if (_char in unicode) {
|
|
7601
|
+
return unicode[_char] in _constants.ligatures ? unicode[_char] : "\\".concat(unicode[_char], "{}");
|
|
7602
|
+
} else if (_char in mathUnicode) {
|
|
7603
|
+
return "$\\".concat(mathUnicode[_char], "$");
|
|
7604
|
+
} else {
|
|
7605
|
+
return '';
|
|
7606
|
+
}
|
|
7607
|
+
}
|
|
7583
7608
|
function escapeValue(value) {
|
|
7584
|
-
|
|
7585
|
-
return
|
|
7609
|
+
if (!_config["default"].format.asciiOnly) {
|
|
7610
|
+
return value;
|
|
7611
|
+
}
|
|
7612
|
+
return value.normalize('NFKD').replace(UNSAFE_UNICODE, function (_char2) {
|
|
7613
|
+
return escapeCharacter(_char2);
|
|
7586
7614
|
}).replace(DIACRITIC_PATTERN, function (match) {
|
|
7587
7615
|
return Array.from(match).reduce(function (subject, diacritic) {
|
|
7588
7616
|
return "{\\".concat(unicode[diacritic], " ").concat(subject, "}");
|
|
7589
7617
|
});
|
|
7590
|
-
});
|
|
7618
|
+
}).replace(LONE_DIACRITIC_PATTERN, '');
|
|
7591
7619
|
}
|
|
7592
7620
|
function formatRichText(value) {
|
|
7593
7621
|
var closingTags = [];
|
|
@@ -7628,7 +7656,7 @@ function formatName(name) {
|
|
|
7628
7656
|
}
|
|
7629
7657
|
function formatTitle(title) {
|
|
7630
7658
|
return formatRichText(title).split(/(:\s*)/).map(function (part, i) {
|
|
7631
|
-
return i % 2 ? part : part.replace(/(
|
|
7659
|
+
return i % 2 ? part : part.replace(/([^\\])\b([a-z]*[A-Z].*?)\b/g, '$1{$2}');
|
|
7632
7660
|
}).join('');
|
|
7633
7661
|
}
|
|
7634
7662
|
function formatSingleValue(value, valueType) {
|
|
@@ -7667,7 +7695,7 @@ function format(field, value) {
|
|
|
7667
7695
|
}
|
|
7668
7696
|
}
|
|
7669
7697
|
|
|
7670
|
-
},{"../input/constants.js":55}],76:[function(require,module,exports){
|
|
7698
|
+
},{"../config.js":52,"../input/constants.js":55}],76:[function(require,module,exports){
|
|
7671
7699
|
"use strict";
|
|
7672
7700
|
|
|
7673
7701
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -8103,7 +8131,7 @@ var formats = exports.formats = {
|
|
|
8103
8131
|
parseAsync: api.parseAsync,
|
|
8104
8132
|
parseType: {
|
|
8105
8133
|
dataType: 'String',
|
|
8106
|
-
predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9]+))\s*$/i,
|
|
8134
|
+
predicate: /^\s*(https?:\/\/(?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+))\s*$/i,
|
|
8107
8135
|
"extends": '@else/url'
|
|
8108
8136
|
}
|
|
8109
8137
|
},
|
|
@@ -8113,21 +8141,21 @@ var formats = exports.formats = {
|
|
|
8113
8141
|
},
|
|
8114
8142
|
parseType: {
|
|
8115
8143
|
dataType: 'String',
|
|
8116
|
-
predicate: /^\s*((?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9]+))\s*$/i
|
|
8144
|
+
predicate: /^\s*((?:dx\.)?doi\.org\/(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+))\s*$/i
|
|
8117
8145
|
}
|
|
8118
8146
|
},
|
|
8119
8147
|
'@doi/id': {
|
|
8120
8148
|
parse: id.parse,
|
|
8121
8149
|
parseType: {
|
|
8122
8150
|
dataType: 'String',
|
|
8123
|
-
predicate: /^\s*(10.\d{4,9}\/[-._;()/:A-Z0-9]+)\s*$/i
|
|
8151
|
+
predicate: /^\s*(10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+)\s*$/i
|
|
8124
8152
|
}
|
|
8125
8153
|
},
|
|
8126
8154
|
'@doi/list+text': {
|
|
8127
8155
|
parse: id.parse,
|
|
8128
8156
|
parseType: {
|
|
8129
8157
|
dataType: 'String',
|
|
8130
|
-
tokenList: /^10.\d{4,9}\/[-._;()/:A-Z0-9]+$/i
|
|
8158
|
+
tokenList: /^10.\d{4,9}\/[-._;()/:A-Z0-9[\]<>]+$/i
|
|
8131
8159
|
}
|
|
8132
8160
|
},
|
|
8133
8161
|
'@doi/list+object': {
|
|
@@ -15236,58 +15264,71 @@ var FETCH_ADDITIONAL = {
|
|
|
15236
15264
|
}
|
|
15237
15265
|
};
|
|
15238
15266
|
function collectAdditionalIds(entity, needed) {
|
|
15267
|
+
var additionalIds = [];
|
|
15239
15268
|
if (!needed) {
|
|
15240
|
-
return
|
|
15269
|
+
return additionalIds;
|
|
15241
15270
|
}
|
|
15242
15271
|
entity._needed = Object.assign(entity._needed || {}, needed);
|
|
15243
|
-
|
|
15244
|
-
|
|
15245
|
-
|
|
15246
|
-
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15272
|
+
for (var prop in entity.claims) {
|
|
15273
|
+
if (prop in needed) {
|
|
15274
|
+
var _iterator = _createForOfIteratorHelper(entity.claims[prop]),
|
|
15275
|
+
_step;
|
|
15276
|
+
try {
|
|
15277
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
15278
|
+
var claim = _step.value;
|
|
15279
|
+
if (claim.value) {
|
|
15280
|
+
var _claim$value$id;
|
|
15281
|
+
additionalIds.push((_claim$value$id = claim.value.id) !== null && _claim$value$id !== void 0 ? _claim$value$id : claim.value);
|
|
15282
|
+
}
|
|
15283
|
+
}
|
|
15284
|
+
} catch (err) {
|
|
15285
|
+
_iterator.e(err);
|
|
15286
|
+
} finally {
|
|
15287
|
+
_iterator.f();
|
|
15288
|
+
}
|
|
15289
|
+
}
|
|
15290
|
+
}
|
|
15291
|
+
return additionalIds;
|
|
15251
15292
|
}
|
|
15252
15293
|
function completeResponse(entities, old) {
|
|
15253
15294
|
if (!old) {
|
|
15254
15295
|
var allIds = [];
|
|
15255
15296
|
for (var id in entities) {
|
|
15256
15297
|
var _ids = collectAdditionalIds(entities[id], FETCH_ADDITIONAL);
|
|
15257
|
-
var
|
|
15258
|
-
|
|
15298
|
+
var _iterator2 = _createForOfIteratorHelper(_ids),
|
|
15299
|
+
_step2;
|
|
15259
15300
|
try {
|
|
15260
|
-
for (
|
|
15261
|
-
var _id2 =
|
|
15301
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
15302
|
+
var _id2 = _step2.value;
|
|
15262
15303
|
if (!allIds.includes(_id2)) {
|
|
15263
15304
|
allIds.push(_id2);
|
|
15264
15305
|
}
|
|
15265
15306
|
}
|
|
15266
15307
|
} catch (err) {
|
|
15267
|
-
|
|
15308
|
+
_iterator2.e(err);
|
|
15268
15309
|
} finally {
|
|
15269
|
-
|
|
15310
|
+
_iterator2.f();
|
|
15270
15311
|
}
|
|
15271
15312
|
}
|
|
15272
15313
|
return allIds;
|
|
15273
15314
|
}
|
|
15274
15315
|
var ids = [];
|
|
15275
|
-
var
|
|
15276
|
-
|
|
15316
|
+
var _iterator3 = _createForOfIteratorHelper(old),
|
|
15317
|
+
_step3;
|
|
15277
15318
|
try {
|
|
15278
|
-
for (
|
|
15279
|
-
var _id3 =
|
|
15319
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
15320
|
+
var _id3 = _step3.value;
|
|
15280
15321
|
var entity = entities[_id3];
|
|
15281
15322
|
if (!entity._needed) {
|
|
15282
15323
|
continue;
|
|
15283
15324
|
}
|
|
15284
15325
|
for (var prop in entity.claims) {
|
|
15285
15326
|
if (prop in entity._needed) {
|
|
15286
|
-
var
|
|
15287
|
-
|
|
15327
|
+
var _iterator4 = _createForOfIteratorHelper(entity.claims[prop]),
|
|
15328
|
+
_step4;
|
|
15288
15329
|
try {
|
|
15289
|
-
for (
|
|
15290
|
-
var claim =
|
|
15330
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
15331
|
+
var claim = _step4.value;
|
|
15291
15332
|
if (claim.value && claim.value.id) {
|
|
15292
15333
|
continue;
|
|
15293
15334
|
}
|
|
@@ -15295,18 +15336,18 @@ function completeResponse(entities, old) {
|
|
|
15295
15336
|
ids.push.apply(ids, _toConsumableArray(collectAdditionalIds(claim.value, entity._needed[prop])));
|
|
15296
15337
|
}
|
|
15297
15338
|
} catch (err) {
|
|
15298
|
-
|
|
15339
|
+
_iterator4.e(err);
|
|
15299
15340
|
} finally {
|
|
15300
|
-
|
|
15341
|
+
_iterator4.f();
|
|
15301
15342
|
}
|
|
15302
15343
|
}
|
|
15303
15344
|
}
|
|
15304
15345
|
delete entity._needed;
|
|
15305
15346
|
}
|
|
15306
15347
|
} catch (err) {
|
|
15307
|
-
|
|
15348
|
+
_iterator3.e(err);
|
|
15308
15349
|
} finally {
|
|
15309
|
-
|
|
15350
|
+
_iterator3.f();
|
|
15310
15351
|
}
|
|
15311
15352
|
return ids;
|
|
15312
15353
|
}
|
|
@@ -15391,7 +15432,7 @@ function _fillCacheAsync() {
|
|
|
15391
15432
|
urls = filterIdsAndGetUrls(state.needed, cache);
|
|
15392
15433
|
_context2.next = 6;
|
|
15393
15434
|
return Promise.all(urls.map(function () {
|
|
15394
|
-
var
|
|
15435
|
+
var _ref = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(url) {
|
|
15395
15436
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15396
15437
|
while (1) switch (_context.prev = _context.next) {
|
|
15397
15438
|
case 0:
|
|
@@ -15409,7 +15450,7 @@ function _fillCacheAsync() {
|
|
|
15409
15450
|
}, _callee);
|
|
15410
15451
|
}));
|
|
15411
15452
|
return function (_x3) {
|
|
15412
|
-
return
|
|
15453
|
+
return _ref.apply(this, arguments);
|
|
15413
15454
|
};
|
|
15414
15455
|
}()));
|
|
15415
15456
|
case 6:
|