« get me outta code hell

new Additional Files data field - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/validators.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-12 19:04:35 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-12 19:04:35 -0300
commit9dbc0792c8988e97b1b93b83b27b1aa62dfc1875 (patch)
tree600dc05550fef6aebd6d44126636b14ccc0c9366 /src/data/validators.js
parent6f9e037670476a0829c133872ab3271a0f29de47 (diff)
new Additional Files data field
Diffstat (limited to 'src/data/validators.js')
-rw-r--r--src/data/validators.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/data/validators.js b/src/data/validators.js
index c0e41c98..0d325aed 100644
--- a/src/data/validators.js
+++ b/src/data/validators.js
@@ -235,6 +235,14 @@ export const isContribution = validateProperties({
 
 export const isContributionList = validateArrayItems(isContribution);
 
+export const isAdditionalFile = validateProperties({
+    title: isString,
+    description: value => (value === undefined || value === null || isString(value)),
+    files: validateArrayItems(isString)
+});
+
+export const isAdditionalFileList = validateArrayItems(isAdditionalFile);
+
 export function isDimensions(dimensions) {
     isArray(dimensions);