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

utils.js « graphql_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a262fbd9ac3b7cc9c4803d7400bb5993030ef868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/**
 * Ids generated by GraphQL endpoints are usually in the format
 * gid://gitlab/Environments/123. This method extracts Id number
 * from the Id path
 *
 * @param {String} gid GraphQL global ID
 * @returns {Number}
 */
export const getIdFromGraphQLId = (gid = '') =>
  parseInt((gid || '').replace(/gid:\/\/gitlab\/.*\//g, ''), 10) || null;

export default {};