« get me outta code hell

data: always require at least one step for nesting compositions - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-04 21:19:44 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-11-04 21:19:44 -0300
commit527e4618fdc57d80ac79ca9ceb3eed60fca90d6b (patch)
treea379bb63402407f6b0a757f01f5ef313639104a1 /src/data
parent5aad4eae6629eaa1e4dd849b03abff8888afdb4d (diff)
data: always require at least one step for nesting compositions
Diffstat (limited to 'src/data')
-rw-r--r--src/data/things/composite.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/data/things/composite.js b/src/data/things/composite.js
index c3b08f86..113f0a4f 100644
--- a/src/data/things/composite.js
+++ b/src/data/things/composite.js
@@ -637,6 +637,10 @@ export function compositeFrom(description) {
 
   const compositionNests = description.compose ?? true;
 
+  if (compositionNests && empty(steps)) {
+    aggregate.push(new TypeError(`Expected at least one step`));
+  }
+
   // Steps default to exposing if using a shorthand syntax where flags aren't
   // specified at all.
   const stepsExpose =