1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", {
|
3 | value: true
|
4 | });
|
5 | Object.defineProperty(exports, "default", {
|
6 | enumerable: true,
|
7 | get: ()=>cloneNodes
|
8 | });
|
9 | function cloneNodes(nodes, source = undefined, raws = undefined) {
|
10 | return nodes.map((node)=>{
|
11 | var ref;
|
12 | let cloned = node.clone();
|
13 |
|
14 |
|
15 | let shouldOverwriteSource = ((ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.preserveSource) !== true || !cloned.source;
|
16 | if (source !== undefined && shouldOverwriteSource) {
|
17 | cloned.source = source;
|
18 | if ("walk" in cloned) {
|
19 | cloned.walk((child)=>{
|
20 | child.source = source;
|
21 | });
|
22 | }
|
23 | }
|
24 | if (raws !== undefined) {
|
25 | cloned.raws.tailwind = {
|
26 | ...cloned.raws.tailwind,
|
27 | ...raws
|
28 | };
|
29 | }
|
30 | return cloned;
|
31 | });
|
32 | }
|