bpms_site/.svn/pristine/4a/4abb6221b5b28be77a0ea6204f5eb50008fa76b5.svn-base
2025-11-02 16:38:49 +03:30

26 lines
843 B
Plaintext

export default function AmpAttributePatcher() {
return {
visitor: {
JSXOpeningElement (path) {
const openingElement = path.node;
const { name, attributes } = openingElement;
if (!(name && name.type === "JSXIdentifier")) {
return;
}
if (!name.name.startsWith("amp-")) {
return;
}
for (const attribute of attributes){
if (attribute.type !== "JSXAttribute") {
continue;
}
if (attribute.name.name === "className") {
attribute.name.name = "class";
}
}
}
}
};
}
//# sourceMappingURL=amp-attributes.js.map