// @ts-check import getAttributesString from "./getAttributesString.js"; export default function getLinkElement({ images = [], preload = "", imagesizes = "", linkAttributes, }) { const imagesrcset = preload && images[images.length - 1]?.sources.find( ({ format: fmt }) => fmt === preload )?.srcset; const attributesString = getAttributesString({ element: "link", attributes: linkAttributes, excludeArray: ["as", "rel", "imagesizes", "imagesrcset"], }); const linkElement = preload && images.length ? `` : ""; return linkElement; }