MCPcopy Index your code
hub / github.com/sindresorhus/notifier-for-github / parseLinkHeader

Function parseLinkHeader

source/util.js:32–44  ·  view source on GitHub ↗
(header)

Source from the content-addressed store, hash-verified

30}
31
32export function parseLinkHeader(header) {
33 const links = {};
34 for (const part of (header || '').split(',')) {
35 const [sectionUrl = '', sectionName = ''] = part.split(';');
36 const url = sectionUrl.replace(/<(.+)>/, '$1').trim();
37 const name = sectionName.replace(/rel="(.+)"/, '$1').trim();
38 if (name && url) {
39 links[name] = url;
40 }
41 }
42
43 return links;
44}

Callers 4

getNotificationsFunction · 0.90
getNotificationCountFunction · 0.90
getRepositoriesFunction · 0.90
util-test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected