« get me outta code hell

sugar: onlyItem - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/track
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-10-03 15:21:18 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-10-03 15:21:18 -0300
commit68e482ea27367ffcf98b35b4e102681f642710a7 (patch)
treebaa04e4a5cdad1e4abe835632727a7dada055497 /src/data/composite/things/track
parent9e7807a8500a0208f8f8cbded89dfb06f1e21061 (diff)
sugar: onlyItem
Diffstat (limited to 'src/data/composite/things/track')
-rw-r--r--src/data/composite/things/track/withMainReleaseTrack.js9
1 files changed, 1 insertions, 8 deletions
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`,