« 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/serialize.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/serialize.js')
-rw-r--r--src/data/serialize.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/data/serialize.js b/src/data/serialize.js
index a4206fd..52aacb0 100644
--- a/src/data/serialize.js
+++ b/src/data/serialize.js
@@ -1,6 +1,4 @@
-/** @format */
-
-// serialize-util.js: simple interface and utility functions for converting
+// serialize.js: simple interface and utility functions for converting
 // Things into a directly serializeable format
 
 // Utility functions
@@ -27,17 +25,14 @@ export const serializeDescriptors = Symbol();
 
 export function serializeThing(thing) {
   const descriptors = thing.constructor[serializeDescriptors];
+
   if (!descriptors) {
-    throw new Error(
-      `Constructor ${thing.constructor.name} does not provide serialize descriptors`
-    );
+    throw new Error(`Constructor ${thing.constructor.name} does not provide serialize descriptors`);
   }
 
   return Object.fromEntries(
-    Object.entries(descriptors).map(([property, transform]) => [
-      property,
-      transform(thing[property]),
-    ])
+    Object.entries(descriptors)
+      .map(([property, transform]) => [property, transform(thing[property])])
   );
 }