« 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/thing.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things/thing.js')
-rw-r--r--src/data/things/thing.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 0484b589..169fc1ca 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -27,6 +27,7 @@ import {
   isDate,
   isDimensions,
   isDirectory,
+  isDuration,
   isFileExtension,
   isName,
   isString,
@@ -132,6 +133,15 @@ export function dimensions() {
   };
 }
 
+// Duration! This is a number of seconds, possibly floating point, always
+// at minimum zero.
+export function duration() {
+  return {
+    flags: {update: true, expose: true},
+    update: {validate: isDuration},
+  };
+}
+
 // Straightforward flag descriptor for a variety of property purposes.
 // Provide a default value, true or false!
 export function flag(defaultValue = false) {