theme.keycloak.v2.account.resources.util.ParseLink.js Maven / Gradle / Ivy
function parse(linkHeader) {
if (!linkHeader) return {};
const links = linkHeader.split(/,\s*);
return links.reduce((acc, link) => {
const matcher = link.match(/([^>]*)>(.*)/);
if (!matcher) return {};
const linkUrl = matcher[1];
const rel = matcher[2].match(/\s*(.+)\s*=\s*"?([^"]+)"?/);
if (rel) {
acc[rel[2]] = linkUrl;
}
return acc;
}, {});
}
export default parse;
//# sourceMappingURL=ParseLink.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy