www_hero/node_modules/tailwindcss/lib/util/cloneNodes.js
sasha-astiadi 324d5960af hero_web
2024-05-03 06:39:20 +02:00

26 lines
672 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneNodes;
function cloneNodes(nodes, source = undefined, raws = undefined) {
return nodes.map((node)=>{
let cloned = node.clone();
if (source !== undefined) {
cloned.source = source;
if ("walk" in cloned) {
cloned.walk((child)=>{
child.source = source;
});
}
}
if (raws !== undefined) {
cloned.raws.tailwind = {
...cloned.raws.tailwind,
...raws
};
}
return cloned;
});
}