diff options
Diffstat (limited to 'src/content/dependencies/generateTrackAdditionalNamesBox.js')
-rw-r--r-- | src/content/dependencies/generateTrackAdditionalNamesBox.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/content/dependencies/generateTrackAdditionalNamesBox.js b/src/content/dependencies/generateTrackAdditionalNamesBox.js deleted file mode 100644 index bad04b74..00000000 --- a/src/content/dependencies/generateTrackAdditionalNamesBox.js +++ /dev/null @@ -1,53 +0,0 @@ -import {empty} from '#sugar'; - -export default { - contentDependencies: ['generateAdditionalNamesBox'], - extraDependencies: ['html'], - - query: (track) => { - const { - additionalNames: own, - sharedAdditionalNames: shared, - inferredAdditionalNames: inferred, - } = track; - - if (empty(own) && empty(shared) && empty(inferred)) { - return {combinedList: []}; - } - - const firstFilter = - (empty(own) - ? new Set() - : new Set(own.map(({name}) => name))); - - const sharedFiltered = - shared.filter(({name}) => !firstFilter.has(name)) - - const secondFilter = - new Set([ - ...firstFilter, - ...sharedFiltered.map(({name}) => name), - ]); - - const inferredFiltered = - inferred.filter(({name}) => !secondFilter.has(name)); - - return { - combinedList: [ - ...own, - ...sharedFiltered, - ...inferredFiltered, - ], - }; - }, - - relations: (relation, query) => ({ - box: - (empty(query.combinedList) - ? null - : relation('generateAdditionalNamesBox', query.combinedList)), - }), - - generate: (relations, {html}) => - relations.box ?? html.blank(), -}; |