« get me outta code hell

inputWikiData.js « wiki-data « composite « data « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-data/inputWikiData.js
blob: cf7a7c2c87384524873faf36f921dc9b04f991bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import {input} from '#composite';
import {validateWikiData} from '#validators';

// TODO: This doesn't access a class's own ThingSubclass[Thing.referenceType]
// value because classes aren't initialized by when templateCompositeFrom gets
// called (see: circular imports). So the reference types have to be hard-coded,
// which somewhat defeats the point of storing them on the class in the first
// place...
export default function inputWikiData({
  referenceType = '',
  allowMixedTypes = false,
} = {}) {
  return input({
    validate: validateWikiData({referenceType, allowMixedTypes}),
    acceptsNull: true,
  });
}