Files
Superalgos/node_modules/@octokit/rest/lib/plugins/pagination/get-page-links.js
T

16 lines
397 B
JavaScript

module.exports = getPageLinks
function getPageLinks (link) {
link = link.link || link.meta.link || ''
const links = {}
// link format:
// '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
links[type] = uri
})
return links
}