only_ever_generator 0.7.6 → 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.
|
@@ -76,29 +76,18 @@ class ParseCardResponse {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
_getCardReference(generatedCardData, sourceTaxonomy) {
|
|
79
|
-
var _a, _b, _c
|
|
79
|
+
var _a, _b, _c;
|
|
80
80
|
const cardConcepts = (_a = generatedCardData.concepts) !== null && _a !== void 0 ? _a : [];
|
|
81
81
|
const cardFacts = (_b = generatedCardData.facts) !== null && _b !== void 0 ? _b : [];
|
|
82
82
|
const combinedCardFactsAndConcepts = [...cardConcepts, ...cardFacts];
|
|
83
83
|
const sourceConcepts = (_c = sourceTaxonomy.concepts) !== null && _c !== void 0 ? _c : [];
|
|
84
|
-
const sourceFacts = (_d = sourceTaxonomy.facts) !== null && _d !== void 0 ? _d : [];
|
|
85
84
|
const mappedSourceConcepts = sourceConcepts.map((elem) => {
|
|
86
85
|
return {
|
|
87
86
|
text: elem.concept_text,
|
|
88
87
|
reference: elem.reference,
|
|
89
88
|
};
|
|
90
89
|
});
|
|
91
|
-
const
|
|
92
|
-
return {
|
|
93
|
-
text: elem.concept_text,
|
|
94
|
-
reference: elem.reference,
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
const compinedConceptsAndFacts = [
|
|
98
|
-
...mappedSourceConcepts,
|
|
99
|
-
...mappedSourceFacts,
|
|
100
|
-
];
|
|
101
|
-
const firstMatchedConcept = compinedConceptsAndFacts.find((elem) => combinedCardFactsAndConcepts.includes(elem.text));
|
|
90
|
+
const firstMatchedConcept = sourceConcepts.find((elem) => combinedCardFactsAndConcepts.includes(elem.text));
|
|
102
91
|
if (firstMatchedConcept) {
|
|
103
92
|
return firstMatchedConcept.reference;
|
|
104
93
|
}
|
package/package.json
CHANGED
|
@@ -85,7 +85,6 @@ export class ParseCardResponse {
|
|
|
85
85
|
const combinedCardFactsAndConcepts = [...cardConcepts, ...cardFacts];
|
|
86
86
|
|
|
87
87
|
const sourceConcepts = sourceTaxonomy.concepts ?? [];
|
|
88
|
-
const sourceFacts = sourceTaxonomy.facts ?? [];
|
|
89
88
|
|
|
90
89
|
const mappedSourceConcepts = sourceConcepts.map((elem: any) => {
|
|
91
90
|
return {
|
|
@@ -93,18 +92,8 @@ export class ParseCardResponse {
|
|
|
93
92
|
reference: elem.reference,
|
|
94
93
|
};
|
|
95
94
|
});
|
|
96
|
-
const mappedSourceFacts = sourceFacts.map((elem: any) => {
|
|
97
|
-
return {
|
|
98
|
-
text: elem.concept_text,
|
|
99
|
-
reference: elem.reference,
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
95
|
|
|
103
|
-
const
|
|
104
|
-
...mappedSourceConcepts,
|
|
105
|
-
...mappedSourceFacts,
|
|
106
|
-
];
|
|
107
|
-
const firstMatchedConcept = compinedConceptsAndFacts.find((elem: any) =>
|
|
96
|
+
const firstMatchedConcept = sourceConcepts.find((elem: any) =>
|
|
108
97
|
combinedCardFactsAndConcepts.includes(elem.text)
|
|
109
98
|
);
|
|
110
99
|
|