« get me outta code hell

data, infra: import validators directly - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/homepage-layout.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-07 12:06:06 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-07 12:07:03 -0300
commit6889c764caef5542ba9ad8362acf6e8b7b879ea9 (patch)
treea89bb9a9bd9884ffd1c51e4926a04469618f73b3 /src/data/things/homepage-layout.js
parent8b379954c9d74f0d47ac32ef395627353940c728 (diff)
data, infra: import validators directly
Diffstat (limited to 'src/data/things/homepage-layout.js')
-rw-r--r--src/data/things/homepage-layout.js36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/data/things/homepage-layout.js b/src/data/things/homepage-layout.js
index c478bc41..59656b41 100644
--- a/src/data/things/homepage-layout.js
+++ b/src/data/things/homepage-layout.js
@@ -1,17 +1,18 @@
 import find from '#find';
 
+import {
+  is,
+  isCountingNumber,
+  isString,
+  isStringNonEmpty,
+  validateArrayItems,
+  validateInstanceOf,
+} from '#validators';
+
 import Thing from './thing.js';
 
 export class HomepageLayout extends Thing {
-  static [Thing.getPropertyDescriptors] = ({
-    HomepageLayoutRow,
-
-    validators: {
-      isStringNonEmpty,
-      validateArrayItems,
-      validateInstanceOf,
-    },
-  }) => ({
+  static [Thing.getPropertyDescriptors] = ({HomepageLayoutRow}) => ({
     // Update & expose
 
     sidebarContent: Thing.common.simpleString(),
@@ -32,10 +33,7 @@ export class HomepageLayout extends Thing {
 }
 
 export class HomepageLayoutRow extends Thing {
-  static [Thing.getPropertyDescriptors] = ({
-    Album,
-    Group,
-  }) => ({
+  static [Thing.getPropertyDescriptors] = ({Album, Group}) => ({
     // Update & expose
 
     name: Thing.common.name('Unnamed Homepage Row'),
@@ -63,17 +61,7 @@ export class HomepageLayoutRow extends Thing {
 }
 
 export class HomepageLayoutAlbumsRow extends HomepageLayoutRow {
-  static [Thing.getPropertyDescriptors] = (opts, {
-    Album,
-    Group,
-
-    validators: {
-      is,
-      isCountingNumber,
-      isString,
-      validateArrayItems,
-    },
-  } = opts) => ({
+  static [Thing.getPropertyDescriptors] = (opts, {Album, Group} = opts) => ({
     ...HomepageLayoutRow[Thing.getPropertyDescriptors](opts),
 
     // Update & expose