export function declareEndpoint()

in packages/gitlab-api-client/src/endpoints/declareEndpoint.ts [132:145]


export function declareEndpoint(
  method: EndpointMethod,
  path: string,
): PostEndpointBuilder | GetEndpointBuilder {
  if (method === 'GET') {
    return new GetEndpointBuilder(path);
  }

  if (method === 'POST') {
    return new PostEndpointBuilder(path);
  }

  throw new Error(`Unexpected method found! ${method}`);
}