astro-ghostcms/.pnpm-store/v3/files/dc/885c14ee93b59a32badba2b10e3...

24 lines
715 B
Plaintext

import { renderElement } from "./util.js";
function renderScriptElement({ props, children }) {
return renderElement("script", {
props,
children
});
}
function renderUniqueStylesheet(result, sheet) {
if (sheet.type === "external") {
if (Array.from(result.styles).some((s) => s.props.href === sheet.src))
return "";
return renderElement("link", { props: { rel: "stylesheet", href: sheet.src }, children: "" });
}
if (sheet.type === "inline") {
if (Array.from(result.styles).some((s) => s.children.includes(sheet.content)))
return "";
return renderElement("style", { props: {}, children: sheet.content });
}
}
export {
renderScriptElement,
renderUniqueStylesheet
};