You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
672 B
26 lines
672 B
2 years ago
|
"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;
|
||
|
});
|
||
|
}
|