From 68e482ea27367ffcf98b35b4e102681f642710a7 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 3 Oct 2025 15:21:18 -0300 Subject: sugar: onlyItem --- src/data/composite/things/track/withMainReleaseTrack.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/data/composite') diff --git a/src/data/composite/things/track/withMainReleaseTrack.js b/src/data/composite/things/track/withMainReleaseTrack.js index fa678161..871eba7d 100644 --- a/src/data/composite/things/track/withMainReleaseTrack.js +++ b/src/data/composite/things/track/withMainReleaseTrack.js @@ -5,6 +5,7 @@ // is specified by reference and that reference doesn't resolve to anything. import {input, templateCompositeFrom} from '#composite'; +import {onlyItem} from '#sugar'; import {getKebabCase} from '#wiki-data'; import {exitWithoutDependency, withResultOfAvailabilityCheck} @@ -19,14 +20,6 @@ import { import withMainRelease from './withMainRelease.js'; -function onlyItem(array) { - if (array.length === 1) { - return array[0]; - } else { - return null; - } -} - export default templateCompositeFrom({ annotation: `withMainReleaseTrack`, -- cgit 1.3.0-6-gf8a5