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

Function validateIndata

mgen-javascriptlib/src/main/javascript/mgen-lib.js:310–326  ·  view source on GitHub ↗
(obj, data)

Source from the content-addressed store, hash-verified

308 }
309
310 function validateIndata(obj, data) {
311 var pos, _key, possible;
312 for (_key in data) {
313 if (!data.hasOwnProperty(_key)) continue;
314 if (!obj[_key] && _key != "__t") {
315 // trying to set a field that does not exist. Throw error.
316 possible = "";
317 for (pos in obj) {
318 if (pos != "__t") {
319 possible += " \t " + pos + " \n ";
320 }
321 }
322 throw Error(tmpWrap(obj.__t) + " does not have field " + _key +
323 " \n Possible options are: \n" + possible + " \n ");
324 }
325 }
326 }
327
328 function createField(field, key, data, options) {
329 if (hasFlag(field.flags, "transient") && options.remove_transient){

Callers 1

createClassFunction · 0.85

Calls 1

tmpWrapFunction · 0.85

Tested by

no test coverage detected