function extractRouteArguments(args) {
  let [lastArg] = args.splice(-1);
  if (isOption(lastArg)) {
    lastArg = assign({}, defaultRouteOptions, lastArg);
  } else {
    args.push(lastArg);
    lastArg = defaultRouteOptions;
  }
  let t = 2 - args.length;
  while (t-- > 0) {
    args.push(undefined);
  }
  args.push(lastArg);
  return args;
}
Extract arguments for a route.

@method extractRouteArguments
@param {Array} args Of the form [options], [object, code], [function, code]
[shorthand, options], [shorthand, code, options]
@return {Array} [handler (i.e. the function, object or shorthand), code,
options].