frontend/.pnpm-store/v3/files/f4/2afac9adc4dab09eaee4f428682178d640b584e6374cdcc67cb7e781982fd91ec8c425dcaa20dd9db492ab844512b16be7c09aed3cb55427a256532e3d7b40

33 lines
1.1 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: ()=>cloneNodes
});
function cloneNodes(nodes, source = undefined, raws = undefined) {
return nodes.map((node)=>{
var _node_raws_tailwind;
let cloned = node.clone();
// We always want override the source map
// except when explicitly told not to
let shouldOverwriteSource = ((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.preserveSource) !== true || !cloned.source;
if (source !== undefined && shouldOverwriteSource) {
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;
});
}