const Redirect = function()

in src/middleware/redirects.js [32:50]


const Redirect = function(glob, regex, destination, type) {
  this.type = type || 301;
  this.glob = slasher(glob);
  this.regex = regex;
  this.destination = destination;

  if (this.destination.match(/(?:^|\/):/)) {
    this.captureKeys = [];
    if (this.glob) {
      this.engine = "glob";
      this.capture = pathToRegexp(this.glob, this.captureKeys);
    }
    if (this.regex) {
      this.engine = "pattern";
      this.capture = patterns.createRaw(this.regex);
    }
    this.compileDestination = pathToRegexp.compile(this.destination);
  }
};