only_ever_generator 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.
@@ -81,36 +81,13 @@ class ParseCardResponse {
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 = sourceTaxonomy.facts ?? [];
85
84
  const mappedSourceConcepts = sourceConcepts.map((elem) => {
86
- if (elem.type) {
87
- if (elem.type == "concept") {
88
- return {
89
- text: elem.concept_text,
90
- reference: elem.reference,
91
- };
92
- }
93
- }
94
- else {
95
- return {
96
- text: elem.concept_text,
97
- reference: elem.reference,
98
- };
99
- }
100
- });
101
- const mappedSourceFacts = sourceConcepts.map((elem) => {
102
- if (elem.type == "fact") {
103
- return {
104
- text: elem.concept_text,
105
- reference: elem.reference,
106
- };
107
- }
85
+ return {
86
+ text: elem.concept_text,
87
+ reference: elem.reference,
88
+ };
108
89
  });
109
- const compinedConceptsAndFacts = [
110
- ...mappedSourceConcepts,
111
- ...mappedSourceFacts,
112
- ];
113
- const firstMatchedConcept = compinedConceptsAndFacts.find((elem) => combinedCardFactsAndConcepts.includes(elem.text));
90
+ const firstMatchedConcept = sourceConcepts.find((elem) => combinedCardFactsAndConcepts.includes(elem.text));
114
91
  if (firstMatchedConcept) {
115
92
  return firstMatchedConcept.reference;
116
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "only_ever_generator",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "start": "npm run build && nodemon dist/index.js",
@@ -85,38 +85,15 @@ 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
- if (elem.type) {
92
- if (elem.type == "concept") {
93
- return {
94
- text: elem.concept_text,
95
- reference: elem.reference,
96
- };
97
- }
98
- } else {
99
- return {
100
- text: elem.concept_text,
101
- reference: elem.reference,
102
- };
103
- }
104
- });
105
- const mappedSourceFacts = sourceConcepts.map((elem: any) => {
106
- if (elem.type == "fact") {
107
- return {
108
- text: elem.concept_text,
109
- reference: elem.reference,
110
- };
111
-
112
- }
90
+ return {
91
+ text: elem.concept_text,
92
+ reference: elem.reference,
93
+ };
113
94
  });
114
95
 
115
- const compinedConceptsAndFacts = [
116
- ...mappedSourceConcepts,
117
- ...mappedSourceFacts,
118
- ];
119
- const firstMatchedConcept = compinedConceptsAndFacts.find((elem: any) =>
96
+ const firstMatchedConcept = sourceConcepts.find((elem: any) =>
120
97
  combinedCardFactsAndConcepts.includes(elem.text)
121
98
  );
122
99