json-to-spec 19.1.0 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/dist/min.js +275 -118
- package/docs/dist/v20/min.js +321 -0
- package/package.json +1 -1
- package/samples/dataList1/index.html +31 -0
- package/samples/dataList1/index.js +62 -0
- package/samples/dataList1/input/data.json +5043 -0
- package/samples/dataList1/input/structure.json +38 -0
- package/samples/form1/index.html +29 -0
- package/samples/form1/index.js +64 -0
- package/samples/form1/input/data.json +38 -0
- package/samples/form1/input/structure.json +278 -0
- package/samples/table/index.html +14 -0
- package/samples/table/index.js +9 -11
- package/samples/table/input/data.json +7 -35284
- package/samples/table/input/structure.json +10 -82
- package/samples/table1/index.html +43 -0
- package/samples/table1/index.js +59 -0
- package/samples/table1/input/data.json +10 -0
- package/samples/table1/input/structure.json +11 -0
- package/samples/table2/index.html +40 -0
- package/samples/table2/index.js +59 -0
- package/samples/table2/input/data.json +17 -0
- package/samples/table2/input/structure.json +19 -0
- package/samples/table3/index.html +35 -0
- package/samples/table3/index.js +60 -0
- package/samples/table3/input/data.json +31 -0
- package/samples/table3/input/structure.json +45 -0
- package/src/index.js +2 -2
- package/src/v19/index.js +19 -28
- package/src/v19/walk/loopArray/v1/createChildren.js +27 -0
- package/src/v19/walk/loopArray/v1/index.js +33 -0
- package/src/v19/walk/loopObject/v1/createChildren.js +27 -0
- package/src/v19/walk/loopObject/v1/index.js +25 -0
- package/src/v19/walk/loopObject/v2/createChildren.js +32 -0
- package/src/v19/walk/loopObject/v2/index.js +29 -0
- package/src/v19/walk/replaceWithArray/v1/index.js +15 -0
- package/src/v19/walk/replaceWithArray/v1/replaceAttributes.js +26 -0
- package/src/v19/walk/replaceWithArray/v1/replaceCommon.js +23 -0
- package/src/v19/walk/replaceWithArray/v1/replaceNodeValue.js +17 -0
- package/src/v19/walk/replaceWithObject/v1/index.js +15 -0
- package/src/v19/walk/replaceWithObject/v1/replaceAttributes.js +28 -0
- package/src/v19/walk/replaceWithObject/v1/replaceCommon.js +23 -0
- package/src/v19/walk/replaceWithObject/v1/replaceNodeValue.js +18 -0
- package/src/v19/walk/walk.js +37 -2
- package/src/v20/index.js +46 -0
- package/src/v20/meta.js +7 -0
- package/src/v20/registerGlobal.js +17 -0
- package/src/v20/replace.js +18 -0
- package/src/v20/resolvePath.js +29 -0
- package/src/v20/walk/iterate/v1/index.js +42 -0
- package/src/v20/walk/iterate/v2/index.js +32 -0
- package/src/v20/walk/iterate/v3/index.js +46 -0
- package/src/v20/walk/iterate/v4/createChildren.js +27 -0
- package/src/v20/walk/iterate/v4/index.js +25 -0
- package/src/v20/walk/loopArray/v1/createChildren.js +42 -0
- package/src/v20/walk/loopArray/v1/index.js +33 -0
- package/src/v20/walk/loopArray/v2/createChildren.js +48 -0
- package/src/v20/walk/loopArray/v2/index.js +33 -0
- package/src/v20/walk/loopObject/v1/createChildren.js +27 -0
- package/src/v20/walk/loopObject/v1/index.js +25 -0
- package/src/v20/walk/loopObject/v2/createChildren.js +32 -0
- package/src/v20/walk/loopObject/v2/index.js +29 -0
- package/src/v20/walk/replaceWithArray/v1/index.js +15 -0
- package/src/v20/walk/replaceWithArray/v1/replaceAttributes.js +26 -0
- package/src/v20/walk/replaceWithArray/v1/replaceCommon.js +23 -0
- package/src/v20/walk/replaceWithArray/v1/replaceTextContent.js +42 -0
- package/src/v20/walk/replaceWithData/v1/index.js +42 -0
- package/src/v20/walk/replaceWithData/v1/replaceCommon.js +21 -0
- package/src/v20/walk/replaceWithData/v2/index.js +105 -0
- package/src/v20/walk/replaceWithData/v2/replaceCommon.js +21 -0
- package/src/v20/walk/replaceWithData/v3/index.js +15 -0
- package/src/v20/walk/replaceWithData/v3/replaceAttributes.js +29 -0
- package/src/v20/walk/replaceWithData/v3/replaceCommon.js +23 -0
- package/src/v20/walk/replaceWithData/v3/replaceNodeValue.js +27 -0
- package/src/v20/walk/replaceWithObject/v1/index.js +15 -0
- package/src/v20/walk/replaceWithObject/v1/replaceAttributes.js +28 -0
- package/src/v20/walk/replaceWithObject/v1/replaceCommon.js +23 -0
- package/src/v20/walk/replaceWithObject/v1/replaceNodeValue.js +18 -0
- package/src/v20/walk/walk.js +132 -0
package/docs/dist/min.js
CHANGED
|
@@ -1,164 +1,321 @@
|
|
|
1
|
-
const
|
|
1
|
+
const f = {
|
|
2
2
|
version: "19.0.0",
|
|
3
3
|
name: "json-to-spec/v19",
|
|
4
4
|
description: "Minimalist 2-layer compiler: pure value replace + jsonToSpec iterate"
|
|
5
|
-
},
|
|
6
|
-
typeof globalThis > "u" || !
|
|
7
|
-
meta:
|
|
8
|
-
compile:
|
|
5
|
+
}, b = (n) => {
|
|
6
|
+
typeof globalThis > "u" || !n || (globalThis.ks ?? (globalThis.ks = {}), globalThis.ks["json-to-spec"] = {
|
|
7
|
+
meta: f,
|
|
8
|
+
compile: n
|
|
9
9
|
});
|
|
10
|
-
},
|
|
11
|
-
const t =
|
|
12
|
-
if (t === "") return
|
|
13
|
-
let
|
|
14
|
-
return t.includes(".") && (
|
|
15
|
-
(
|
|
16
|
-
|
|
17
|
-
)),
|
|
18
|
-
},
|
|
19
|
-
inNode:
|
|
20
|
-
inData:
|
|
21
|
-
} = {}) => {
|
|
22
|
-
const t =
|
|
10
|
+
}, d = ({ inData: n, inDataKey: r }) => {
|
|
11
|
+
const t = r;
|
|
12
|
+
if (t === "") return n;
|
|
13
|
+
let e = n[t];
|
|
14
|
+
return t.includes(".") && (e = t.split(".").reduce(
|
|
15
|
+
(c, a) => c == null ? void 0 : c[a],
|
|
16
|
+
n
|
|
17
|
+
)), e;
|
|
18
|
+
}, O = ({
|
|
19
|
+
inNode: n,
|
|
20
|
+
inData: r
|
|
21
|
+
} = {}) => {
|
|
22
|
+
const t = n, e = r;
|
|
23
23
|
if (!(t != null && t.textContent)) return "no-textContent";
|
|
24
24
|
if (typeof t.textContent != "string") return "not-a-string";
|
|
25
25
|
if (!t.textContent.includes("${")) return "no-template-token";
|
|
26
|
-
const
|
|
27
|
-
t.textContent =
|
|
28
|
-
inData:
|
|
29
|
-
inDataKey:
|
|
26
|
+
const o = t.textContent.replace(/^\$\{/, "").replace(/\}$/, "");
|
|
27
|
+
t.textContent = d({
|
|
28
|
+
inData: e,
|
|
29
|
+
inDataKey: o
|
|
30
30
|
});
|
|
31
|
-
},
|
|
32
|
-
inNode:
|
|
33
|
-
inData:
|
|
31
|
+
}, C = ({
|
|
32
|
+
inNode: n,
|
|
33
|
+
inData: r
|
|
34
34
|
} = {}) => {
|
|
35
|
-
const t =
|
|
35
|
+
const t = n, e = r;
|
|
36
36
|
if ("attributes" in t) {
|
|
37
|
-
const
|
|
38
|
-
Object.entries(t.attributes || {}).map(([
|
|
39
|
-
|
|
40
|
-
typeof
|
|
41
|
-
inData:
|
|
42
|
-
inDataKey:
|
|
43
|
-
}) :
|
|
37
|
+
const o = Object.fromEntries(
|
|
38
|
+
Object.entries(t.attributes || {}).map(([s, c]) => [
|
|
39
|
+
s,
|
|
40
|
+
typeof c == "string" && c.includes("${") ? d({
|
|
41
|
+
inData: e,
|
|
42
|
+
inDataKey: c.replace(/^\$\{/, "").replace(/\}$/, "")
|
|
43
|
+
}) : c
|
|
44
44
|
])
|
|
45
45
|
);
|
|
46
|
-
t.attributes = { ...
|
|
46
|
+
t.attributes = { ...o };
|
|
47
47
|
}
|
|
48
|
-
},
|
|
49
|
-
inNode:
|
|
50
|
-
inData:
|
|
48
|
+
}, $ = ({
|
|
49
|
+
inNode: n,
|
|
50
|
+
inData: r
|
|
51
51
|
} = {}) => {
|
|
52
|
-
const t =
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
inTemplate:
|
|
56
|
-
inSourceValues:
|
|
57
|
-
} = {}) => {
|
|
58
|
-
const t =
|
|
59
|
-
return t === void 0 ? void 0 : t.map((
|
|
60
|
-
const
|
|
61
|
-
return
|
|
62
|
-
inNode:
|
|
63
|
-
inData:
|
|
52
|
+
const t = n, e = r;
|
|
53
|
+
O({ inNode: t, inData: e }), C({ inNode: t, inData: e });
|
|
54
|
+
}, T = ({
|
|
55
|
+
inTemplate: n,
|
|
56
|
+
inSourceValues: r
|
|
57
|
+
} = {}) => {
|
|
58
|
+
const t = r;
|
|
59
|
+
return t === void 0 ? void 0 : t.map((o) => {
|
|
60
|
+
const s = structuredClone(n);
|
|
61
|
+
return l({
|
|
62
|
+
inNode: s,
|
|
63
|
+
inData: o,
|
|
64
64
|
inOperation: "replace"
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
+
}, k = ({
|
|
68
|
+
inNode: n,
|
|
69
|
+
inData: r,
|
|
70
|
+
inShowLog: t
|
|
71
|
+
} = {}) => {
|
|
72
|
+
const e = n, o = r;
|
|
73
|
+
if (!("jsonToSpec" in e) || !("operation" in e.jsonToSpec) || e.jsonToSpec.operation !== "iterate" || !("source" in e.jsonToSpec)) return;
|
|
74
|
+
const s = o[e.jsonToSpec.source], c = T({
|
|
75
|
+
inTemplate: e.jsonToSpec.template,
|
|
76
|
+
inSourceValues: s
|
|
77
|
+
});
|
|
78
|
+
e.children = c;
|
|
79
|
+
}, A = ({
|
|
80
|
+
inNode: n,
|
|
81
|
+
inData: r
|
|
82
|
+
} = {}) => {
|
|
83
|
+
const t = n;
|
|
84
|
+
if (!(t != null && t.textContent)) return "no-textContent";
|
|
85
|
+
if (typeof t.textContent != "string") return "not-a-string";
|
|
86
|
+
if (!t.textContent.includes("${")) return "no-template-token";
|
|
87
|
+
t.textContent === "${key}" && (t.textContent = r.key), t.textContent === "${value}" && (t.textContent = r.value);
|
|
88
|
+
}, x = ({
|
|
89
|
+
inNode: n,
|
|
90
|
+
inData: r
|
|
91
|
+
} = {}) => {
|
|
92
|
+
const t = n;
|
|
93
|
+
if ("attributes" in t) {
|
|
94
|
+
const e = Object.fromEntries(
|
|
95
|
+
Object.entries(t.attributes).map(([o, s]) => {
|
|
96
|
+
let c = s;
|
|
97
|
+
return s === "${key}" ? c = r.key : s === "${value}" && (c = r.value), [o, c];
|
|
98
|
+
})
|
|
99
|
+
);
|
|
100
|
+
t.attributes = { ...e };
|
|
101
|
+
}
|
|
102
|
+
}, j = ({
|
|
103
|
+
inNode: n,
|
|
104
|
+
inData: r
|
|
105
|
+
} = {}) => {
|
|
106
|
+
const t = n, e = r;
|
|
107
|
+
A({ inNode: t, inData: e }), x({ inNode: t, inData: e });
|
|
108
|
+
};
|
|
109
|
+
function m(n) {
|
|
110
|
+
return n !== null && typeof n == "object" && Object.getPrototypeOf(n) === Object.prototype;
|
|
111
|
+
}
|
|
112
|
+
const h = ({
|
|
113
|
+
inTemplate: n,
|
|
114
|
+
inSourceValues: r,
|
|
115
|
+
inShowLog: t
|
|
116
|
+
} = {}) => {
|
|
117
|
+
const e = r;
|
|
118
|
+
if (e === void 0 || !m(e)) return;
|
|
119
|
+
t && console.log("loopObject:createChildren:1 ", n, r);
|
|
120
|
+
let o = [];
|
|
121
|
+
for (const [s, c] of Object.entries(e)) {
|
|
122
|
+
const a = structuredClone(n);
|
|
123
|
+
j({ inNode: a, inData: { key: s, value: c } }), o.push(a);
|
|
124
|
+
}
|
|
125
|
+
return o;
|
|
67
126
|
}, D = ({
|
|
68
|
-
inNode:
|
|
69
|
-
inData:
|
|
127
|
+
inNode: n,
|
|
128
|
+
inData: r,
|
|
129
|
+
inShowLog: t
|
|
130
|
+
} = {}) => {
|
|
131
|
+
const e = n, o = r;
|
|
132
|
+
if (t && console.log("loopObject:1 ", n, r), !("jsonToSpec" in e) || !("operation" in e.jsonToSpec) || e.jsonToSpec.operation !== "loopObject" || !("source" in e.jsonToSpec)) return;
|
|
133
|
+
t && console.log("loopObject:2 ", n, r);
|
|
134
|
+
const s = o[e.jsonToSpec.source], c = h({
|
|
135
|
+
inTemplate: e.jsonToSpec.template,
|
|
136
|
+
inSourceValues: s,
|
|
137
|
+
inShowLog: t
|
|
138
|
+
});
|
|
139
|
+
e.children = c;
|
|
140
|
+
};
|
|
141
|
+
function S(n) {
|
|
142
|
+
return n !== null && typeof n == "object" && Object.getPrototypeOf(n) === Object.prototype;
|
|
143
|
+
}
|
|
144
|
+
const g = ({
|
|
145
|
+
inNode: n,
|
|
146
|
+
inData: r
|
|
147
|
+
} = {}) => {
|
|
148
|
+
if (Object.keys(r).map((o) => `\${${o}}`).includes(n.textContent)) {
|
|
149
|
+
const o = n.textContent.slice(2, -1);
|
|
150
|
+
n.textContent = r[o];
|
|
151
|
+
}
|
|
152
|
+
}, F = ({
|
|
153
|
+
inNode: n,
|
|
154
|
+
inData: r
|
|
155
|
+
} = {}) => {
|
|
156
|
+
const t = n, e = r;
|
|
157
|
+
if (console.log("localData------- : ", e), !(t != null && t.textContent)) return "no-textContent";
|
|
158
|
+
if (typeof t.textContent != "string") return "not-a-string";
|
|
159
|
+
if (!t.textContent.includes("${")) return "no-template-token";
|
|
160
|
+
S(e) ? g({ inNode: n, inData: r }) : t.textContent === "${}" && (t.textContent = e);
|
|
161
|
+
}, N = ({
|
|
162
|
+
inNode: n,
|
|
163
|
+
inData: r
|
|
164
|
+
} = {}) => {
|
|
165
|
+
const t = n;
|
|
166
|
+
if ("attributes" in t) {
|
|
167
|
+
const e = Object.fromEntries(
|
|
168
|
+
Object.entries(t.attributes).map(([o, s]) => {
|
|
169
|
+
let c = s;
|
|
170
|
+
return s === "${}" && (c = r.key), [o, c];
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
t.attributes = { ...e };
|
|
174
|
+
}
|
|
175
|
+
}, V = ({
|
|
176
|
+
inNode: n,
|
|
177
|
+
inData: r
|
|
178
|
+
} = {}) => {
|
|
179
|
+
const t = n, e = r;
|
|
180
|
+
F({ inNode: t, inData: e }), N({ inNode: t, inData: e });
|
|
181
|
+
}, w = ({
|
|
182
|
+
inTemplate: n,
|
|
183
|
+
inSourceValuesAsArray: r,
|
|
184
|
+
inShowLog: t
|
|
185
|
+
} = {}) => {
|
|
186
|
+
const e = r;
|
|
187
|
+
if (e === void 0 || !Array.isArray(e)) return;
|
|
188
|
+
t && console.log("loopObject:createChildren:1 ", n, inSourceValues);
|
|
189
|
+
let o = [];
|
|
190
|
+
return e.forEach((s) => {
|
|
191
|
+
var a, i;
|
|
192
|
+
const c = structuredClone(n);
|
|
193
|
+
if ("jsonToSpec" in c) {
|
|
194
|
+
const y = (a = c == null ? void 0 : c.jsonToSpec) == null ? void 0 : a.source;
|
|
195
|
+
let u = {};
|
|
196
|
+
u[y] = s, l({
|
|
197
|
+
inNode: c,
|
|
198
|
+
inData: u,
|
|
199
|
+
inOperation: (i = c == null ? void 0 : c.jsonToSpec) == null ? void 0 : i.operation,
|
|
200
|
+
inShowLog: t
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
V({ inNode: c, inData: s }), o.push(c);
|
|
204
|
+
}), o;
|
|
205
|
+
}, K = ({
|
|
206
|
+
inNode: n,
|
|
207
|
+
inData: r,
|
|
70
208
|
inShowLog: t
|
|
71
209
|
} = {}) => {
|
|
72
|
-
const
|
|
73
|
-
if (!("jsonToSpec" in
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
210
|
+
const e = n, o = r;
|
|
211
|
+
if (console.log("loopArray:1 ", n, r), t && console.log("loopObject:1 ", n, r), !("jsonToSpec" in e) || !("operation" in e.jsonToSpec) || e.jsonToSpec.operation !== "loopArray" || !("source" in e.jsonToSpec)) return;
|
|
212
|
+
const s = o[e.jsonToSpec.source];
|
|
213
|
+
if (!Array.isArray(s)) return;
|
|
214
|
+
t && console.log("loopObject:2 ", n, r);
|
|
215
|
+
const c = w({
|
|
216
|
+
inTemplate: e.jsonToSpec.template,
|
|
217
|
+
inSourceValuesAsArray: s,
|
|
218
|
+
inShowLog: t
|
|
77
219
|
});
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
const n = r,
|
|
81
|
-
if (Array.isArray(
|
|
82
|
-
const
|
|
83
|
-
for (const
|
|
84
|
-
const
|
|
85
|
-
inNode:
|
|
220
|
+
e.children = c;
|
|
221
|
+
}, p = ({ inNode: n, inData: r, inOperation: t }) => {
|
|
222
|
+
const e = n, o = r, s = t;
|
|
223
|
+
if (Array.isArray(e)) {
|
|
224
|
+
const c = [];
|
|
225
|
+
for (const a of e) {
|
|
226
|
+
const i = l({
|
|
227
|
+
inNode: a,
|
|
86
228
|
inData: o,
|
|
87
|
-
inOperation:
|
|
229
|
+
inOperation: s
|
|
88
230
|
});
|
|
89
|
-
Array.isArray(
|
|
231
|
+
Array.isArray(i) ? c.push(...i) : i != null && c.push(i);
|
|
90
232
|
}
|
|
91
|
-
return
|
|
233
|
+
return c;
|
|
92
234
|
}
|
|
93
|
-
},
|
|
94
|
-
inNode:
|
|
95
|
-
inData:
|
|
235
|
+
}, l = ({
|
|
236
|
+
inNode: n,
|
|
237
|
+
inData: r = {},
|
|
96
238
|
inOperation: t,
|
|
97
|
-
inShowLog:
|
|
239
|
+
inShowLog: e = !1
|
|
98
240
|
} = {}) => {
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
return
|
|
102
|
-
if (Array.isArray(
|
|
103
|
-
return
|
|
104
|
-
inNode:
|
|
105
|
-
inData:
|
|
106
|
-
inOperation:
|
|
241
|
+
const o = n, s = r, c = t;
|
|
242
|
+
if (e && console.log("walk ", n, r, t), o == null)
|
|
243
|
+
return o;
|
|
244
|
+
if (Array.isArray(o))
|
|
245
|
+
return p({
|
|
246
|
+
inNode: o,
|
|
247
|
+
inData: r,
|
|
248
|
+
inOperation: c
|
|
107
249
|
});
|
|
108
|
-
if ("children" in
|
|
109
|
-
inNode:
|
|
110
|
-
inData:
|
|
111
|
-
inOperation:
|
|
112
|
-
})), typeof
|
|
113
|
-
return
|
|
114
|
-
switch (
|
|
250
|
+
if ("children" in o && Array.isArray(o == null ? void 0 : o.children) && (o.children = p({
|
|
251
|
+
inNode: o == null ? void 0 : o.children,
|
|
252
|
+
inData: r,
|
|
253
|
+
inOperation: c
|
|
254
|
+
})), typeof o != "object")
|
|
255
|
+
return o;
|
|
256
|
+
switch (e && console.log("localOperation ", c), c) {
|
|
115
257
|
case "replace":
|
|
116
|
-
typeof
|
|
117
|
-
inNode:
|
|
118
|
-
inData:
|
|
258
|
+
typeof o == "object" && $({
|
|
259
|
+
inNode: o,
|
|
260
|
+
inData: r
|
|
261
|
+
});
|
|
262
|
+
break;
|
|
263
|
+
case "replaceObject":
|
|
264
|
+
typeof o == "object" && j({
|
|
265
|
+
inNode: o,
|
|
266
|
+
inData: r
|
|
119
267
|
});
|
|
120
268
|
break;
|
|
121
269
|
case "iterateDo":
|
|
270
|
+
k({
|
|
271
|
+
inNode: o,
|
|
272
|
+
inData: s,
|
|
273
|
+
inShowLog: e
|
|
274
|
+
});
|
|
275
|
+
break;
|
|
276
|
+
case "loopObject":
|
|
122
277
|
D({
|
|
123
|
-
inNode:
|
|
124
|
-
inData:
|
|
125
|
-
inShowLog:
|
|
278
|
+
inNode: o,
|
|
279
|
+
inData: s,
|
|
280
|
+
inShowLog: e
|
|
281
|
+
});
|
|
282
|
+
break;
|
|
283
|
+
case "loopArray":
|
|
284
|
+
K({
|
|
285
|
+
inNode: o,
|
|
286
|
+
inData: s,
|
|
287
|
+
inShowLog: e
|
|
126
288
|
});
|
|
289
|
+
break;
|
|
127
290
|
}
|
|
128
|
-
return
|
|
129
|
-
},
|
|
291
|
+
return o;
|
|
292
|
+
}, E = ({ inStructureAsJson: n, inDataAsJson: r, inOperation: t, inShowLog: e }) => {
|
|
130
293
|
try {
|
|
131
|
-
return
|
|
132
|
-
inNode:
|
|
133
|
-
inData:
|
|
294
|
+
return l({
|
|
295
|
+
inNode: n,
|
|
296
|
+
inData: r,
|
|
134
297
|
inOperation: t,
|
|
135
|
-
inShowLog:
|
|
298
|
+
inShowLog: e
|
|
136
299
|
});
|
|
137
|
-
} catch (
|
|
138
|
-
throw console.error("[json-to-spec/v17] replace error:",
|
|
300
|
+
} catch (o) {
|
|
301
|
+
throw console.error("[json-to-spec/v17] replace error:", o), o;
|
|
139
302
|
}
|
|
140
|
-
},
|
|
141
|
-
let
|
|
142
|
-
t && console.log(
|
|
303
|
+
}, P = (n, r = {}, t = !1) => {
|
|
304
|
+
let e = n, o = r;
|
|
305
|
+
t && console.log(f.name, e, o);
|
|
143
306
|
try {
|
|
144
|
-
|
|
145
|
-
inStructureAsJson:
|
|
146
|
-
inDataAsJson:
|
|
147
|
-
inOperation: "
|
|
148
|
-
inShowLog: t
|
|
149
|
-
}), s = u({
|
|
150
|
-
inStructureAsJson: a,
|
|
151
|
-
inDataAsJson: e,
|
|
152
|
-
inOperation: "replace",
|
|
307
|
+
return E({
|
|
308
|
+
inStructureAsJson: e,
|
|
309
|
+
inDataAsJson: o,
|
|
310
|
+
inOperation: "loopArray",
|
|
153
311
|
inShowLog: t
|
|
154
312
|
});
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
throw console.error("[json-to-spec/v19] compile error:", a), a;
|
|
313
|
+
} catch (s) {
|
|
314
|
+
throw console.error("[json-to-spec/v19] compile error:", s), s;
|
|
158
315
|
}
|
|
159
316
|
};
|
|
160
|
-
|
|
317
|
+
b(P);
|
|
161
318
|
export {
|
|
162
|
-
|
|
163
|
-
|
|
319
|
+
P as compile,
|
|
320
|
+
P as default
|
|
164
321
|
};
|