Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
script.returns = script.returns.split('||').map(mask => mask.trim()).reduce((final, mask) => {
assert(pgp.queryResult.hasOwnProperty(mask), `Script at ${path} specified invalid return type "${mask}`)
return final + pgp.queryResult[mask]
}, 0)
script.returns = script.returns.split('||').map(mask => mask.trim()).reduce((final, mask) => {
assert(pgp.queryResult.hasOwnProperty(mask), `Script at ${path} specified invalid return type "${mask}`)
return final + pgp.queryResult[mask]
}, 0)