Welcome to mirror list, hosted at ThFree Co, Russian Federation.

merge_request.js « utils « diffs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: edb4304f558199a5a2c16661f140a5d99f12813c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const endpointRE = /^(\/?(.+?)\/(.+?)\/-\/merge_requests\/(\d+)).*$/i;

export function getDerivedMergeRequestInformation({ endpoint } = {}) {
  let mrPath;
  let userOrGroup;
  let project;
  let id;
  const matches = endpointRE.exec(endpoint);

  if (matches) {
    [, mrPath, userOrGroup, project, id] = matches;
  }

  return {
    mrPath,
    userOrGroup,
    project,
    id,
  };
}