import { VM } from 'vm2' ; export function safeEvaluate ( value ) { const vm = new VM ( { timeout : 1000 * 60 , sandbox : { metadata : undefined } } ) ; vm . run ( `metadata = ${ value };` ) ; return vm . sandbox . metadata ; }