Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(current.scores).forEach(domainKey => {
if (!Object.keys(prev).includes(domainKey)) {
const domain = getDomain({ language: language, domain: domainKey })
prev[domainKey] = { scores: [], facet: {}, description: domain.shortDescription, title: domain.title }
}
prev[domainKey].scores.push({ title: person, score: current.scores[domainKey].score })
Object.keys(current.scores[domainKey].facet).forEach(facetKey => {
if (!Object.keys(prev[domainKey].facet).includes(facetKey)) {
const facet = getFacet({ language: language, domain: domainKey, facet: facetKey })
prev[domainKey].facet[facetKey] = {
scores: [],
description: facet.text,
title: facet.title
}
}
prev[domainKey].facet[facetKey].scores.push({ title: person, score: current.scores[domainKey].facet[facetKey].score })
})
})
return prevObject.keys(current.scores[domainKey].facet).forEach(facetKey => {
if (!Object.keys(prev[domainKey].facet).includes(facetKey)) {
const facet = getFacet({ language: language, domain: domainKey, facet: facetKey })
prev[domainKey].facet[facetKey] = {
scores: [],
description: facet.text,
title: facet.title
}
}
prev[domainKey].facet[facetKey].scores.push({ title: person, score: current.scores[domainKey].facet[facetKey].score })
})
})