(header)
| 30 | } |
| 31 | |
| 32 | export 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 | } |
no outgoing calls
no test coverage detected