createModuleTransform = (parser) => {
  return (sourceBytes, specifier, location, _packageLocation, opts) => {
    let source = decoder.decode(sourceBytes)
    source = decapitateHashbang(source)
    // FIXME: this function calls stuff we could get in `ses/tools.js`
    // except `evadeDirectEvalExpressions`. unclear if we should be using this from `lavamoat-core`
    source = applySourceTransforms(source)
    source = evadeDirectEvalExpressions(source)
    source = evadeGibson(source)
    source = evadeImportString(source)
    const { code, map } = evadeCensorSync(source, {
      sourceMap: opts?.sourceMap,
      sourceUrl: new URL(specifier, location).href,
      sourceType: parser === 'mjs' ? 'module' : 'script',
    })
    const objectBytes = encoder.encode(code)
    return { bytes: objectBytes, parser, map }
  }
}
Create a module transform which performs source transforms to evade SES
restrictions

@param {Language} parser
@returns {SyncModuleTransform}