function isSafeNotificationHref(href) {
  return href.startsWith("/") && !href.startsWith("//");
}
function assertSafeNotificationHref(href) {
  if (href == null) {
    return void 0;
  }
  if (!isSafeNotificationHref(href)) {
    throw new Error("Notification href must be a same-origin relative path starting with /");
  }
  return href;
}
function sanitizeNotificationActions(actions) {
  if (!actions) {
    return void 0;
  }
  return actions.map((action) => action.href ? { ...action, href: assertSafeNotificationHref(action.href) } : action);
}
export {
  assertSafeNotificationHref,
  isSafeNotificationHref,
  sanitizeNotificationActions
};
//# sourceMappingURL=safeHref.js.map
