« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/flash.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things/flash.js')
-rw-r--r--src/data/things/flash.js62
1 files changed, 27 insertions, 35 deletions
diff --git a/src/data/things/flash.js b/src/data/things/flash.js
index d7e8bb46..7e859bfa 100644
--- a/src/data/things/flash.js
+++ b/src/data/things/flash.js
@@ -1,13 +1,8 @@
 import {input} from '#composite';
 import find from '#find';
-
-import {
-  anyOf,
-  isColor,
-  isDirectory,
-  isNumber,
-  isString,
-} from '#validators';
+import Thing from '#thing';
+import {anyOf, isColor, isDirectory, isNumber, isString} from '#validators';
+import {parseDate, parseContributors} from '#yaml';
 
 import {exposeDependency, exposeUpdateValueOrContinue}
   from '#composite/control-flow';
@@ -28,10 +23,6 @@ import {
 
 import {withFlashAct} from '#composite/things/flash';
 
-import {parseContributors} from '#yaml';
-
-import Thing from './thing.js';
-
 export class Flash extends Thing {
   static [Thing.referenceType] = 'flash';
 
@@ -137,24 +128,25 @@ export class Flash extends Thing {
   });
 
   static [Thing.yamlDocumentSpec] = {
-    fieldTransformations: {
-      'Date': (value) => new Date(value),
-
-      'Contributors': parseContributors,
-    },
-
-    propertyFieldMapping: {
-      name: 'Flash',
-      directory: 'Directory',
-      page: 'Page',
-      color: 'Color',
-      urls: 'URLs',
+    fields: {
+      'Flash': {property: 'name'},
+      'Directory': {property: 'directory'},
+      'Page': {property: 'page'},
+      'Color': {property: 'color'},
+      'URLs': {property: 'urls'},
+
+      'Date': {
+        property: 'date',
+        transform: parseDate,
+      },
 
-      date: 'Date',
-      coverArtFileExtension: 'Cover Art File Extension',
+      'Cover Art File Extension': {property: 'coverArtFileExtension'},
 
-      featuredTracks: 'Featured Tracks',
-      contributorContribs: 'Contributors',
+      'Featured Tracks': {property: 'featuredTracks'},
+      'Contributors': {
+        property: 'contributorContribs',
+        transform: parseContributors,
+      },
     },
 
     ignoredFields: ['Review Points'],
@@ -199,15 +191,15 @@ export class FlashAct extends Thing {
   });
 
   static [Thing.yamlDocumentSpec] = {
-    propertyFieldMapping: {
-      name: 'Act',
-      directory: 'Directory',
+    fields: {
+      'Act': {property: 'name'},
+      'Directory': {property: 'directory'},
 
-      color: 'Color',
-      listTerminology: 'List Terminology',
+      'Color': {property: 'color'},
+      'List Terminology': {property: 'listTerminology'},
 
-      jump: 'Jump',
-      jumpColor: 'Jump Color',
+      'Jump': {property: 'jump'},
+      'Jump Color': {property: 'jumpColor'},
     },
 
     ignoredFields: ['Review Points'],