Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
forEach(function (e, f) {
var def = f.options && f.options.default
var resolved = resolve(f.type, m.id, false)
var vals = resolved && resolved.values
if (vals) { // is enum
if (f.repeated) {
objectKeys.push(genobj.property(f.name) + ': []')
} else {
def = (def && vals[def]) ? vals[def].value : vals[Object.keys(vals)[0]].value
objectKeys.push(genobj.property(f.name) + ': ' + parseInt(def || 0, 10))
}
return
}
objectKeys.push(genobj.property(f.name) + ': ' + defaultValue(f, def))
})