diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-09-08 16:25:22 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-09-08 16:25:22 -0300 |
commit | cd3e2ae7384d82f0f2758beb0ae38ce0fe9f5e09 (patch) | |
tree | b015fef9361fe7255f8b2861f946fae169b88146 /src/data/things/thing.js | |
parent | e01b73d286fbb11ac8ded59b4c23738dff195171 (diff) |
data: duration utility
Diffstat (limited to 'src/data/things/thing.js')
-rw-r--r-- | src/data/things/thing.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js index 0484b58..169fc1c 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) { |