MCPcopy Index your code
hub / github.com/github-tools/github / __getScopedUrl

Method __getScopedUrl

lib/User.js:33–53  ·  view source on GitHub ↗

* Get the url for the request. (dependent on if we're requesting for the authenticated user or not) * @private * @param {string} endpoint - the endpoint being requested * @return {string} - the resolved endpoint

(endpoint)

Source from the content-addressed store, hash-verified

31 * @return {string} - the resolved endpoint
32 */
33 __getScopedUrl(endpoint) {
34 if (this.__user) {
35 return endpoint ?
36 `/users/${this.__user}/${endpoint}` :
37 `/users/${this.__user}`
38 ;
39
40 } else { // eslint-disable-line
41 switch (endpoint) {
42 case '':
43 return '/user';
44
45 case 'notifications':
46 case 'gists':
47 return `/${endpoint}`;
48
49 default:
50 return `/user/${endpoint}`;
51 }
52 }
53 }
54
55 /**
56 * List the user's repositories

Callers 8

listReposMethod · 0.95
listOrgsMethod · 0.95
listFollowersMethod · 0.95
listFollowingMethod · 0.95
listGistsMethod · 0.95
listNotificationsMethod · 0.95
getProfileMethod · 0.95
listStarredReposMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected