@hestia-earth/utils
Advanced tools
Comparing version 0.9.0 to 0.9.1
@@ -120,4 +120,3 @@ "use strict"; | ||
}) | ||
.filter(function (term) { return !!term && term['@type'] === 'Term' && (term['@id'] || term.name); }) | ||
.map(function (term) { return ({ id: term['@id'], name: term.name }); }); | ||
.filter(function (term) { return (!!term) && (term['@type'] === 'Term') && (!!term['@id'] || !!term.name); }); | ||
}; | ||
@@ -135,3 +134,3 @@ var queryTerms = function (terms) { return __awaiter(void 0, void 0, void 0, function () { | ||
should: terms.map(function (_a) { | ||
var id = _a.id, name = _a.name; | ||
var id = _a["@id"], name = _a.name; | ||
return ({ match: id ? { '@id.keyword': id } : { 'name.keyword': name } }); | ||
@@ -150,3 +149,3 @@ }), | ||
return [2, terms.map(function (_a) { | ||
var id = _a.id, name = _a.name; | ||
var id = _a["@id"], name = _a.name; | ||
var exists = results.find(function (res) { return res['@id'] === id || res.name === name; }); | ||
@@ -153,0 +152,0 @@ return exists ? true : id || name; |
{ | ||
"name": "@hestia-earth/utils", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "Hestia Utils library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -15,3 +15,3 @@ import { promises } from 'fs'; | ||
class Term { | ||
id: string; | ||
'@id': string; | ||
name: string; | ||
@@ -53,4 +53,3 @@ } | ||
}) | ||
.filter(term => !!term && term['@type'] === 'Term' && (term['@id'] || term.name)) | ||
.map(term => ({ id: term['@id'], name: term.name })); | ||
.filter(term => (!!term) && (term['@type'] === 'Term') && (!!term['@id'] || !!term.name)); | ||
@@ -63,3 +62,3 @@ const queryTerms = async (terms: Term[]) => { | ||
}], | ||
should: terms.map(({ id, name }) => ({ match: id ? { '@id.keyword': id } : { 'name.keyword': name } })), | ||
should: terms.map(({ '@id': id, name }) => ({ match: id ? { '@id.keyword': id } : { 'name.keyword': name } })), | ||
minimum_should_match: 1 | ||
@@ -73,3 +72,3 @@ } | ||
}); | ||
return terms.map(({ id, name }) => { | ||
return terms.map(({ '@id': id, name }) => { | ||
const exists = results.find(res => res['@id'] === id || res.name === name); | ||
@@ -76,0 +75,0 @@ return exists ? true : id || name; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43042
735