Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const out = []
for (const field of type.fieldsArray) {
const key = field.name
if (key !== 'uninterpretedOption') {
if (options.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins
let val = options[key]
if (field.resolvedType instanceof Enum && typeof val === 'number' &&
field.resolvedType.valuesById[val] !== undefined) {
val = field.resolvedType.valuesById[val]
}
out.push(underScore(key), val)
}
}
}
return out.length ? util.toObject(out) : undefined
}