code: function (entityV1) {
          if (!entityV1) { return; }
  
          // if prioritizeV2 is true, events is used as the source of truth
          if ((util.notLegacy(entityV1, 'event') || this.options.prioritizeV2) && !_.isEmpty(entityV1.events)) {
              // in v1, `events` is regarded as the source of truth if it exists, so handle that first and bail out.
              // @todo: Improve this to order prerequest events before test events
              _.forEach(entityV1.events, function (event) {
                  !event.listen && (event.listen = 'test');
  
                  if (event.script) {
                      !event.script.type && (event.script.type = 'text/javascript');
  
                      // @todo: Add support for src
                      _.isString(event.script.exec) && (event.script.exec = event.script.exec.split('\n'));
                  }
              });
  
              return entityV1.events;
          }
  
          var events = [];
  
          // @todo: Extract both flows below into a common method
          if (entityV1.tests) {
              events.push({
                  listen: 'test',
                  script: {
                      type: 'text/javascript',
                      exec: _.isString(entityV1.tests) ?
                          entityV1.tests.split('\n') :
                          entityV1.tests
                  }
              });
          }
          if (entityV1.preRequestScript) {
              events.push({
                  listen: 'prerequest',
                  script: {
                      type: 'text/javascript',
                      exec: _.isString(entityV1.preRequestScript) ?
                          entityV1.preRequestScript.split('\n') :
                          entityV1.preRequestScript
                  }
              });
          }
  
          return events.length ? events : undefined;
      }
docs: Constructs a V2 "events" object from a V1 Postman Request
  
  @param {Object} entityV1 - The v1 entity to extract script information from.
  @returns {Object[]|*}