« get me outta code hell

checks, data, css: niceys - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/thing.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-07-12 11:56:23 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-07-12 11:56:23 -0300
commit6a713867ed1e8353ae6aacddc955ddd84389692d (patch)
tree9ea360fbe85fdd8b8f068a92e9a40d5f9c1c6b27 /src/data/thing.js
parent9718fbc7b4c0c878856d5c492443c0e338930507 (diff)
checks, data, css: niceys
Diffstat (limited to 'src/data/thing.js')
-rw-r--r--src/data/thing.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/data/thing.js b/src/data/thing.js
index f5afe076..621dff5a 100644
--- a/src/data/thing.js
+++ b/src/data/thing.js
@@ -67,7 +67,11 @@ export default class Thing extends CacheableObject {
       name = colors.yellow(`couldn't get name`);
     }
 
-    let reference = Thing.inspectReference(this, {showConstructor: false});
+    let reference =
+      Thing.inspectReference(this, {
+        showConstructor: false,
+        showName: false,
+      });
 
     return (
       (name ? `${constructorName} ${name}` : `${constructorName}`) +
@@ -120,7 +124,10 @@ export default class Thing extends CacheableObject {
     return `${thing.constructor[Thing.referenceType]}:${thing.directory}`;
   }
 
-  static inspectReference(thing, {showConstructor = true} = {}) {
+  static inspectReference(thing, {
+    showConstructor = true,
+    showName = true,
+  } = {}) {
     const referenceType =
       thing.constructor[Thing.referenceType] ??
       null;
@@ -145,12 +152,12 @@ export default class Thing extends CacheableObject {
 
     if (directoryPart && referenceType) {
       return colors.blue(`${referenceType}:${directoryPart}`);
-    } else if (directoryPart) {
-      return constructorPart + `(${colors.blue(directoryPart)})`;
-    } else if (tryToGet('name')) {
-      return constructorPart + `(named ${inspect(thing.name)}`;
+    } if (directoryPart) {
+      return constructorPart + `${colors.blue(directoryPart)}`;
+    } else if (showName && tryToGet('name')) {
+      return constructorPart + `named ${inspect(thing.name)}`;
     } else if (errored && directoryErrored) {
-      return constructorPart + `(${colors.yellow(`couldn't compute reference`)})`;
+      return constructorPart + `${colors.yellow(`couldn't compute reference`)}`;
     } else {
       return constructorPart;
     }