Urara-Blog/node_modules/.pnpm-store/v3/files/aa/703794a90c8b07827752eac9d8ae989c8ef6585f115fabc4a4899d991e9b8c8e2ffa4fad6f53bd8cab0de52a3931bb506094edc6c233da00d556fc05bda9c6
2022-08-14 01:14:53 +08:00

32 lines
1 KiB
Text

"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 ref;
let cloned = node.clone();
// We always want override the source map
// except when explicitly told not to
let shouldOverwriteSource = ((ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.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;
});
}