function runScriptWithSES(bundle, globals = defaultGlobals()) {
  if (typeof bundle !== 'string' || bundle === '') {
    throw new Error(
      'runScriptWithSES requires a bundle string as the first argument'
    )
  }
  const lockdownCode = readFileSync(require.resolve('ses'), 'utf8')

  const code = `
    ;(()=>{
     ${lockdownCode}
    })();
    ${bundle}
  `
  return runScript(code, globals)
}
Run a script with SES

@param {string} bundle
@param {Record<string, any>} globals
@returns {any}