@adactive/adsum-utils
Advanced tools
Comparing version 0.0.2-y.44.58 to 0.0.2-y.44.59
{ | ||
"name": "@adactive/adsum-utils", | ||
"version": "0.0.2-y.44.58", | ||
"version": "0.0.2-y.44.59", | ||
"description": "Adsum Component utils", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,10 +14,12 @@ // @flow | ||
async init(config) { | ||
const { endpoint, key, site, username } = config; | ||
const { | ||
endpoint, key, site, username, | ||
} = config; | ||
this.entityManager = new EntityManager({ | ||
endpoint, | ||
site, | ||
username, | ||
key, | ||
cacheManager: new DistCacheManager('/local'), | ||
endpoint, | ||
site, | ||
username, | ||
key, | ||
cacheManager: new DistCacheManager('/local'), | ||
}); | ||
@@ -40,7 +42,7 @@ } | ||
getPoi(id) { | ||
let poi = this.entityManager.getRepository('Poi').get(id); | ||
const poi = this.entityManager.getRepository('Poi').get(id); | ||
if (poi && poi.logos && poi.logos.values) { | ||
for (const logo in poi.logos.values) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !isNaN(poi.logos.values[logo].value)) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !Number.isNaN(poi.logos.values[logo].value)) { | ||
poi.logos.values[logo] = this.getFile(poi.logos.values[logo].value); | ||
@@ -59,3 +61,3 @@ } | ||
for (const logo in poi.logos.values) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !isNaN(poi.logos.values[logo].value)) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !Number.isNaN(poi.logos.values[logo].value)) { | ||
poi.logos.values[logo] = this.getFile(poi.logos.values[logo].value); | ||
@@ -77,3 +79,3 @@ } | ||
for (const logo in poi.logos.values) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !isNaN(poi.logos.values[logo].value)) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !Number.isNaN(poi.logos.values[logo].value)) { | ||
poi.logos.values[logo] = this.getFile(poi.logos.values[logo].value); | ||
@@ -101,3 +103,3 @@ } | ||
return tags.has(tag[0]); | ||
} | ||
}, | ||
}); | ||
@@ -142,7 +144,7 @@ } | ||
getCategoriesByTag(tagName) { | ||
let result = []; | ||
const tags = this.getTagBy({name: tagName}); | ||
const result = []; | ||
const tags = this.getTagBy({ name: tagName }); | ||
for (let tag of tags) { | ||
result.push(... this.getCategories(tag.categories)); | ||
for (const tag of tags) { | ||
result.push(...this.getCategories(tag.categories)); | ||
} | ||
@@ -155,5 +157,3 @@ return result; | ||
return _.map([...category.pois.values.values()], poiInfo => { | ||
return this.getPoi(poiInfo.value); | ||
}); | ||
return _.map([...category.pois.values.values()], poiInfo => this.getPoi(poiInfo.value)); | ||
} | ||
@@ -182,4 +182,4 @@ | ||
getPlaylistByTag(tagName) { | ||
const tag = this.getTagBy({ name: tagName }) | ||
let playlist = [] | ||
const tag = this.getTagBy({ name: tagName }); | ||
let playlist = []; | ||
if (tag.length) { | ||
@@ -189,3 +189,3 @@ playlist = this.getPlaylistBy({ | ||
return tags.has(tag[0]); | ||
} | ||
}, | ||
}); | ||
@@ -199,4 +199,4 @@ } | ||
for (const i in medias) { | ||
medias[i] = this.getMediaFile(medias[i]); | ||
for (const media of medias) { | ||
this.getMediaFile(media); | ||
} | ||
@@ -214,4 +214,4 @@ | ||
for (const i in medias) { | ||
medias[i] = this.getMediaFile(medias[i]); | ||
for (const media of medias) { | ||
this.getMediaFile(media); | ||
} | ||
@@ -235,3 +235,3 @@ } | ||
this._allCategories = categories.map((category) => { | ||
if (category.logo && category.logo.value && !isNaN(category.logo.value)) { | ||
if (category.logo && category.logo.value && !Number.isNaN(category.logo.value)) { | ||
category.logo = this.getFile(category.logo.value); | ||
@@ -252,3 +252,3 @@ } | ||
for (const logo in poi.logos.values) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !isNaN(poi.logos.values[logo].value)) { | ||
if (poi.logos.values[logo] && poi.logos.values[logo].value && !Number.isNaN(poi.logos.values[logo].value)) { | ||
poi.logos.values[logo] = this.getFile(poi.logos.values[logo].value); | ||
@@ -255,0 +255,0 @@ } |
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
10148