import lodash from "lodash";
import { DEFAULT_LINK_VALUE } from "./../link/constants.js";
const getInitialLinkData = (options) => {
  if (!options) {
    return DEFAULT_LINK_VALUE;
  }
  const { target, nofollow, sponsored, noreferrer } = options;
  const rel = {
    ...nofollow === void 0 ? {} : { nofollow },
    ...sponsored === void 0 ? {} : { sponsored },
    ...noreferrer === void 0 ? {} : { noreferrer }
  };
  return lodash.merge({}, DEFAULT_LINK_VALUE, {
    ...target ? { target } : {},
    ...Object.keys(rel).some((key) => rel[key] !== void 0) ? { rel } : {}
  });
};
export {
  getInitialLinkData
};
//# sourceMappingURL=get-initial-link-data.js.map
