"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = secureTargetBlankLink;

function secureTargetBlankLink(_ref) {
  var _ref$rel = _ref.rel,
      rel = _ref$rel === void 0 ? "" : _ref$rel,
      target = _ref.target;
  var NOOPENER_NOREFERRER = "noopener noreferrer";

  if (target && target.includes("_blank") && !rel.includes(NOOPENER_NOREFERRER)) {
    return "".concat(rel, " ").concat(NOOPENER_NOREFERRER);
  }

  return rel;
}