{"size": 979, "ext": "js", "max_stars_repo_path": "test/helper.js", "max_stars_repo_name": "psxpaul/serverless-express-custom-domain-middleware", "max_stars_repo_stars_event_min_datetime": "2018-09-17T08:10:43.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-23T08:33:17.000Z", "max_issues_repo_path": "test/helper.js", "max_issues_repo_name": "psxpaul/serverless-express-custom-domain-middleware", "max_issues_repo_issues_event_min_datetime": "2018-03-26T18:29:40.000Z", "max_issues_repo_issues_event_max_datetime": "2018-09-25T12:51:36.000Z", "max_forks_repo_path": "test/helper.js", "max_forks_repo_name": "psxpaul/serverless-express-custom-domain-middleware", "max_forks_repo_forks_event_min_datetime": "2018-09-21T18:50:11.000Z", "max_forks_repo_forks_event_max_datetime": "2019-07-16T08:47:39.000Z"}
{"max_stars_count": 5, "max_issues_count": 2, "max_forks_count": 2, "avg_line_length": 21.2826086957, "max_line_length": 68, "alphanum_fraction": 0.6373850868}
function copy(obj) {
  return () => {
    // we can assume only valid JSON, so this works as a "deep copy"
    return JSON.parse(JSON.stringify(obj));
  }
}

const noGateway = {
  headers: {
    Authorization: 'some_key_here',
  },
  url: '/untouched_url',
  originalUrl: '/untouched_originalUrl',
};

const noParam = {
  headers: {
    'x-apigateway-event': encodeURIComponent(JSON.stringify({
      path: '/custom_map/some_path',
      pathParameters: null,
      resource: '/some_path',
    })),
  },
  url: '/custom_map/some_path',
  originalUrl: '/custom_map/some_path',
};

const withParam = {
  headers: {
    'x-apigateway-event': encodeURIComponent(JSON.stringify({
      path: '/custom_map/id_01',
      pathParameters: { resource_id: 'id_01'},
      resource: '/{resource_id}',
    })),
  },
  url: '/custom_map/id_01',
  originalUrl: '/custom_map/id_01',
};


module.exports = {
  noGateway: copy(noGateway),
  withParam: copy(withParam),
  noParam: copy(noParam),
}
