« get me outta code hell

Merge branch 'track-data-cleanup' of github.com:hsmusic/hsmusic-wiki into track-data-cleanup - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/index.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-09 09:41:06 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-09 09:41:06 -0300
commitcaf2ade89b827f5245875f8194f78ebb2661e61e (patch)
tree78c935a5784602d0eaee717e9ceaa73db3d73af8 /src/data/things/index.js
parentf242d1dec3cd905e74eec6ce518781843d5f65d9 (diff)
parent3083e006fb8be524ca8e37c3194b78b0bf37861f (diff)
Merge branch 'track-data-cleanup' of github.com:hsmusic/hsmusic-wiki into track-data-cleanup
Diffstat (limited to 'src/data/things/index.js')
-rw-r--r--src/data/things/index.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/data/things/index.js b/src/data/things/index.js
index 3b73a772..4d8d9d1f 100644
--- a/src/data/things/index.js
+++ b/src/data/things/index.js
@@ -2,6 +2,7 @@ import * as path from 'node:path';
 import {fileURLToPath} from 'node:url';
 
 import {logError} from '#cli';
+import {compositeFrom} from '#composite';
 import * as serialize from '#serialize';
 import {openAggregate, showAggregate} from '#sugar';
 
@@ -130,8 +131,16 @@ function evaluatePropertyDescriptors() {
         throw new Error(`Missing [Thing.getPropertyDescriptors] function`);
       }
 
-      constructor.propertyDescriptors =
-        constructor[Thing.getPropertyDescriptors](opts);
+      const results = constructor[Thing.getPropertyDescriptors](opts);
+
+      for (const [key, value] of Object.entries(results)) {
+        if (Array.isArray(value)) {
+          results[key] = compositeFrom(`${constructor.name}.${key}`, value);
+          continue;
+        }
+      }
+
+      constructor.propertyDescriptors = results;
     },
 
     showFailedClasses(failedClasses) {