MCPcopy Create free account
hub / github.com/culvertsoft/mgen / createDefaultField

Function createDefaultField

mgen-javascriptlib/src/main/javascript/mgen-lib.js:346–352  ·  view source on GitHub ↗
(field, key, options)

Source from the content-addressed store, hash-verified

344 }
345
346 function createDefaultField(field, key, options) {
347 if (options.validate && hasFlag(field.flags, "required")) {
348 throw Error("Missing REQUIRED value: \"" + key + "\" of type " + field.type);
349 } else {
350 return createFieldOfType(field.type, null, options);
351 }
352 }
353
354
355 function createFieldOfType(in_type, value, options) {

Callers 1

createClassFunction · 0.85

Calls 2

hasFlagFunction · 0.85
createFieldOfTypeFunction · 0.85

Tested by

no test coverage detected