UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

25 lines (20 loc) 481 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; const createRel = ({ rel, href, external }) => { const relValues = rel ? rel.split(" ") : []; // add noopener whenever external if (external && href) { if (!relValues.includes("noopener")) { relValues.push("noopener"); } } return relValues.length > 0 ? relValues.join(" ") : undefined; }; var _default = createRel; exports.default = _default;