diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-01-30 15:01:35 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-01-30 15:01:35 -0400 |
commit | dfd84ead5bd5dfbcd7c25d08b816b28b4620ee5a (patch) | |
tree | 1e6ba1818f12171e3c0b5b37fbf0e8d4d6d14f2c /src/thing | |
parent | dccb3cd1312cfa9c2ea86eef6833a63b778de157 (diff) |
all-in-one document mode & artist data
Diffstat (limited to 'src/thing')
-rw-r--r-- | src/thing/artist.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/thing/artist.js b/src/thing/artist.js new file mode 100644 index 00000000..bbb2a935 --- /dev/null +++ b/src/thing/artist.js @@ -0,0 +1,48 @@ +import Thing from './thing.js'; + +import { + isDirectory, + isName, + isString, + isURL, + validateArrayItems, + validateReferenceList, +} from './validators.js'; + +export default class Artist extends Thing { + static [Thing.referenceType] = 'artist'; + + static propertyDescriptors = { + // Update & expose + + name: { + flags: {update: true, expose: true}, + + update: { + default: 'Unnamed Artist', + validate: isName + } + }, + + directory: { + flags: {update: true, expose: true}, + update: {validate: isDirectory}, + expose: Thing.directoryExpose + }, + + urls: { + flags: {update: true, expose: true}, + update: {validate: validateArrayItems(isURL)} + }, + + aliasRefs: { + flags: {update: true, expose: true}, + update: {validate: validateReferenceList('artist')} + }, + + contextNotes: { + flags: {update: true, expose: true}, + update: {validate: isString} + }, + }; +} |