« get me outta code hell

data: isAlbum, isTrack, isArtist, isCommentaryEntry, etc - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/sorting-rule.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-07-10 08:28:41 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-07-10 08:28:41 -0300
commit0674d61d13ebaafe3b36dd84b7ab90db7f99ceb4 (patch)
treefa081814a1e44f003fb44b8cdbf6ed782c879c9b /src/data/things/sorting-rule.js
parentb9afcbf668f52d55550eddcc9ff164ee66aadeae (diff)
data: isAlbum, isTrack, isArtist, isCommentaryEntry, etc
Diffstat (limited to 'src/data/things/sorting-rule.js')
-rw-r--r--src/data/things/sorting-rule.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/data/things/sorting-rule.js b/src/data/things/sorting-rule.js
index ccc4ad89..808a0085 100644
--- a/src/data/things/sorting-rule.js
+++ b/src/data/things/sorting-rule.js
@@ -3,6 +3,7 @@ export const SORTING_RULE_DATA_FILE = 'sorting-rules.yaml';
 import {readFile, writeFile} from 'node:fs/promises';
 import * as path from 'node:path';
 
+import {input} from '#composite';
 import {chunkByProperties, compareArrays, unique} from '#sugar';
 import Thing from '#thing';
 import {isObject, isStringNonEmpty, anyOf, strictArrayOf} from '#validators';
@@ -21,6 +22,7 @@ import {
   reorderDocumentsInYAMLSourceText,
 } from '#yaml';
 
+import {exposeConstant} from '#composite/control-flow';
 import {flag} from '#composite/wiki-properties';
 
 function isSelectFollowingEntry(value) {
@@ -46,6 +48,14 @@ export class SortingRule extends Thing {
       flags: {update: true, expose: true},
       update: {validate: isStringNonEmpty},
     },
+
+    // Expose only
+
+    isSortingRule: [
+      exposeConstant({
+        value: input.value(true),
+      }),
+    ],
   });
 
   static [Thing.yamlDocumentSpec] = {
@@ -118,6 +128,14 @@ export class ThingSortingRule extends SortingRule {
         validate: strictArrayOf(isStringNonEmpty),
       },
     },
+
+    // Expose only
+
+    isThingSortingRule: [
+      exposeConstant({
+        value: input.value(true),
+      }),
+    ],
   });
 
   static [Thing.yamlDocumentSpec] = Thing.extendDocumentSpec(SortingRule, {
@@ -217,6 +235,14 @@ export class DocumentSortingRule extends ThingSortingRule {
       flags: {update: true, expose: true},
       update: {validate: isStringNonEmpty},
     },
+
+    // Expose only
+
+    isDocumentSortingRule: [
+      exposeConstant({
+        value: input.value(true),
+      }),
+    ],
   });
 
   static [Thing.yamlDocumentSpec] = Thing.extendDocumentSpec(ThingSortingRule, {