MCPcopy Create free account
hub / github.com/formschema/native / setCommonFields

Function setCommonFields

lib/parser.js:5–15  ·  view source on GitHub ↗
(schema, field)

Source from the content-addressed store, hash-verified

3const ARRAY_KEYWORDS = ['anyOf', 'oneOf', 'enum']
4
5const setCommonFields = (schema, field) => {
6 field.value = schema.hasOwnProperty('default')
7 ? schema.default
8 : field.hasOwnProperty('value') ? field.value : ''
9
10 field.schemaType = schema.type
11 field.label = schema.title || ''
12 field.description = schema.description || ''
13 field.required = schema.required || false
14 field.disabled = schema.disabled || false
15}
16
17const setFormValue = (vm, field) => {
18 if (vm.value && !vm.value[field.name]) {

Callers 3

parseBooleanFunction · 0.85
parseStringFunction · 0.85
parseArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected