All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.account.resources.util.ParseLink.js Maven / Gradle / Ivy

There is a newer version: 26.0.5
Show newest version
function parse(linkHeader) {
  if (!linkHeader) return {};
  const links = linkHeader.split(/,\s* {
    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