Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getSources = () => Sources
.query()
.eager( 'translationSources' )
.then( sources => sources.reduce( (
( acc, { translationSources, id, ...source } ) => ( {
...acc,
[ id ]: {
...source,
translationSources: groupBy(
translationSources,
( { languageId } ) => languageId,
),
},
} ) ), {} ) )
.then( sources => ( {
sources,
recommended: Object.entries( sources ).reduce( (