@luna-park/plugin 1.8.0 → 2.0.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/dist/dist-CZjmIqBC.mjs +894 -0
- package/dist/eslint.d.mts +1 -2
- package/dist/eslint.mjs +11 -4
- package/dist/extractor.d.mts +3 -13
- package/dist/extractor.mjs +31 -40
- package/dist/{index-76yMHag4.d.mts → index-B4kxQtaL.d.mts} +163 -145
- package/dist/index.d.mts +538 -459
- package/dist/index.mjs +1349 -212
- package/dist/preview.d.mts +1 -3
- package/dist/preview.mjs +2 -4
- package/package.json +30 -23
- package/dist/dist-BoFOku7q.mjs +0 -608
|
@@ -0,0 +1,894 @@
|
|
|
1
|
+
// ../utils/dist/index.mjs
|
|
2
|
+
function cloneDeep(object) {
|
|
3
|
+
if (typeof object !== "object") return object;
|
|
4
|
+
const strategies = [
|
|
5
|
+
() => JSON.parse(JSON.stringify(object)),
|
|
6
|
+
() => structuredClone(object),
|
|
7
|
+
() => safeClone(object)
|
|
8
|
+
];
|
|
9
|
+
let lastError;
|
|
10
|
+
for (const strategy of strategies) try {
|
|
11
|
+
return strategy();
|
|
12
|
+
} catch (error) {
|
|
13
|
+
lastError = error;
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
console.error("Failed to deep clone object:", object);
|
|
17
|
+
throw new Error(String(lastError));
|
|
18
|
+
}
|
|
19
|
+
function safeClone(object) {
|
|
20
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
21
|
+
return recursiveClone(object);
|
|
22
|
+
function recursiveClone(object) {
|
|
23
|
+
if (typeof object !== "object" || object === null) return object;
|
|
24
|
+
if (seen.has(object)) return { recursive: true };
|
|
25
|
+
seen.add(object);
|
|
26
|
+
if (Array.isArray(object)) return object.map((element) => recursiveClone(element));
|
|
27
|
+
const clone = {};
|
|
28
|
+
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(object))) clone[key] = recursiveClone(descriptor.value);
|
|
29
|
+
return clone;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function cloneWithFunctions(object) {
|
|
33
|
+
if (Array.isArray(object)) return object.map(cloneWithFunctions);
|
|
34
|
+
if (typeof object !== "object" || object === null) return object;
|
|
35
|
+
const clone = {};
|
|
36
|
+
for (const [key, value] of Object.entries(object)) clone[key] = typeof value === "function" ? value : cloneWithFunctions(value);
|
|
37
|
+
return clone;
|
|
38
|
+
}
|
|
39
|
+
function assertType(_arg) {}
|
|
40
|
+
function objectMap(source, func) {
|
|
41
|
+
if (!source) return {};
|
|
42
|
+
return Object.fromEntries(Object.entries(source).map(([key, value]) => [key, func({
|
|
43
|
+
key,
|
|
44
|
+
value
|
|
45
|
+
})]));
|
|
46
|
+
}
|
|
47
|
+
function objectFilter(source, func) {
|
|
48
|
+
if (!source) return {};
|
|
49
|
+
return Object.fromEntries(Object.entries(source).filter(([key, value]) => func({
|
|
50
|
+
key,
|
|
51
|
+
value
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
function objectFullMap(source, func) {
|
|
55
|
+
if (!source) return {};
|
|
56
|
+
return Object.fromEntries(Object.entries(source).map(([key, value]) => {
|
|
57
|
+
const result = func({
|
|
58
|
+
key,
|
|
59
|
+
value
|
|
60
|
+
});
|
|
61
|
+
return [result.key, result.value];
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
function cleanObject(target) {
|
|
65
|
+
const record = cloneDeep(target);
|
|
66
|
+
for (const key in record) cleanDeep(record, key);
|
|
67
|
+
function cleanDeep(value, key) {
|
|
68
|
+
const child = value[key];
|
|
69
|
+
if (child && typeof child === "object") {
|
|
70
|
+
for (const childKey in child) cleanDeep(child, childKey);
|
|
71
|
+
if (Object.keys(child).length === 0) delete value[key];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return record;
|
|
75
|
+
}
|
|
76
|
+
function isRawObject(target) {
|
|
77
|
+
if (target !== null && typeof target === "object") return Object.getPrototypeOf(target) === Object.prototype;
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
// ../logicnodes/dist/index.mjs
|
|
81
|
+
const interfaceConfigs = {};
|
|
82
|
+
function isInterfaceConstant(value) {
|
|
83
|
+
return isRawObject(value) && typeof value._interface === "string";
|
|
84
|
+
}
|
|
85
|
+
let EVarType = /* @__PURE__ */ function(EVarType) {
|
|
86
|
+
EVarType["exec"] = "exec";
|
|
87
|
+
EVarType["number"] = "number";
|
|
88
|
+
EVarType["string"] = "string";
|
|
89
|
+
EVarType["boolean"] = "boolean";
|
|
90
|
+
EVarType["object"] = "object";
|
|
91
|
+
EVarType["record"] = "record";
|
|
92
|
+
EVarType["array"] = "array";
|
|
93
|
+
EVarType["interface"] = "interface";
|
|
94
|
+
EVarType["type"] = "type";
|
|
95
|
+
EVarType["function"] = "function";
|
|
96
|
+
EVarType["union"] = "union";
|
|
97
|
+
EVarType["intersection"] = "intersection";
|
|
98
|
+
EVarType["unknown"] = "unknown";
|
|
99
|
+
EVarType["undefined"] = "undefined";
|
|
100
|
+
EVarType["void"] = "void";
|
|
101
|
+
return EVarType;
|
|
102
|
+
}({});
|
|
103
|
+
const LogicType = {
|
|
104
|
+
array: (items, args = {}) => {
|
|
105
|
+
return {
|
|
106
|
+
...args,
|
|
107
|
+
items,
|
|
108
|
+
type: "array"
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
boolean: (args = {}) => {
|
|
112
|
+
return {
|
|
113
|
+
...args,
|
|
114
|
+
type: "boolean"
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
exec: (args = {}) => {
|
|
118
|
+
return {
|
|
119
|
+
...args,
|
|
120
|
+
type: "exec"
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
function: createFunction,
|
|
124
|
+
interface: (interfaceClass, args = {}) => {
|
|
125
|
+
return {
|
|
126
|
+
...args,
|
|
127
|
+
className: typeof interfaceClass === "string" ? interfaceClass : interfaceClass.name,
|
|
128
|
+
type: "interface"
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
intersection: (elements, args = {}) => {
|
|
132
|
+
return {
|
|
133
|
+
...args,
|
|
134
|
+
elements,
|
|
135
|
+
type: "intersection"
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
number: (args = {}) => {
|
|
139
|
+
return {
|
|
140
|
+
...args,
|
|
141
|
+
type: "number"
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
object: (properties = {}, args = {}) => {
|
|
145
|
+
return {
|
|
146
|
+
...args,
|
|
147
|
+
properties,
|
|
148
|
+
type: "object"
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
record: (key, value, args = {}) => {
|
|
152
|
+
return {
|
|
153
|
+
...args,
|
|
154
|
+
key,
|
|
155
|
+
type: "record",
|
|
156
|
+
value
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
string: (args = {}) => {
|
|
160
|
+
return {
|
|
161
|
+
...args,
|
|
162
|
+
type: "string"
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
type: createType,
|
|
166
|
+
undefined: (args = {}) => {
|
|
167
|
+
return {
|
|
168
|
+
...args,
|
|
169
|
+
type: "undefined"
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
union: (elements, args = {}) => {
|
|
173
|
+
return {
|
|
174
|
+
...args,
|
|
175
|
+
elements,
|
|
176
|
+
type: "union"
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
unknown: (args = {}) => {
|
|
180
|
+
return {
|
|
181
|
+
...args,
|
|
182
|
+
type: "unknown"
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
void: (args = {}) => {
|
|
186
|
+
return {
|
|
187
|
+
...args,
|
|
188
|
+
type: "void"
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
function createFunction(inputs = [], output = LogicType.void(), args = {}) {
|
|
193
|
+
if (Array.isArray(inputs)) return createFunction(LogicType.object(Object.fromEntries(inputs)), output, args);
|
|
194
|
+
return {
|
|
195
|
+
...args,
|
|
196
|
+
inputs,
|
|
197
|
+
output,
|
|
198
|
+
type: "function"
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function createType(target, args = {}) {
|
|
202
|
+
return {
|
|
203
|
+
...args,
|
|
204
|
+
target,
|
|
205
|
+
type: "type"
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const LogicUtil = {
|
|
209
|
+
omit(target, keys) {
|
|
210
|
+
return {
|
|
211
|
+
...target,
|
|
212
|
+
properties: objectFilter(target.properties, ({ key }) => !keys.includes(key))
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
partial(target, force = false) {
|
|
216
|
+
return {
|
|
217
|
+
...target,
|
|
218
|
+
properties: objectMap(target.properties, ({ value }) => ({
|
|
219
|
+
...value,
|
|
220
|
+
optional: !force || !value.required
|
|
221
|
+
}))
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
pick(target, keys) {
|
|
225
|
+
return {
|
|
226
|
+
...target,
|
|
227
|
+
properties: objectFilter(target.properties, ({ key }) => keys.includes(key))
|
|
228
|
+
};
|
|
229
|
+
},
|
|
230
|
+
promise(target) {
|
|
231
|
+
return {
|
|
232
|
+
...target,
|
|
233
|
+
promise: true
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
required(target) {
|
|
237
|
+
return {
|
|
238
|
+
...target,
|
|
239
|
+
properties: objectMap(target.properties, ({ value }) => ({
|
|
240
|
+
...value,
|
|
241
|
+
optional: false
|
|
242
|
+
}))
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
function isSchemaCompatible(source, target) {
|
|
247
|
+
return !!getSchemaCompatibilityScore(source, target);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Get the compatibility score between two schemas
|
|
251
|
+
* @param source - The source schema (strict)
|
|
252
|
+
* @param target - The target schema (loose)
|
|
253
|
+
*/
|
|
254
|
+
function getSchemaCompatibilityScore(source, target) {
|
|
255
|
+
if (!target || !source) return 1;
|
|
256
|
+
if (target.type === "unknown") return source.type !== "exec" ? 1 : 0;
|
|
257
|
+
if (source.type === "unknown" && source.customizable) return 1;
|
|
258
|
+
if (target.type === "type" && source.type === "type") return getTypeReferenceKey(target) === getTypeReferenceKey(source) ? 5 : 0;
|
|
259
|
+
if (target.type === "union") return Math.max(...target.elements.map((element) => getSchemaCompatibilityScore(source, element)));
|
|
260
|
+
if (target.type === "intersection") return Math.min(...target.elements.map((element) => getSchemaCompatibilityScore(source, element)));
|
|
261
|
+
if (source.type === "intersection") {
|
|
262
|
+
const merged = mergeIntersection(source);
|
|
263
|
+
if (merged.type === "object") return getSchemaCompatibilityScore(merged, target);
|
|
264
|
+
return Math.max(...source.elements.map((element) => getSchemaCompatibilityScore(element, target)));
|
|
265
|
+
}
|
|
266
|
+
if (target.type === "record" && source.type === "object") {
|
|
267
|
+
if (source.customizable) return 1;
|
|
268
|
+
const properties = Object.entries(source.properties ?? {});
|
|
269
|
+
if (properties.some(([key, property]) => !isRecordKeyCompatible(property.name || key, target.key))) return 0;
|
|
270
|
+
return Math.min(5, ...properties.map(([, property]) => getSchemaCompatibilityScore(property, target.value)));
|
|
271
|
+
}
|
|
272
|
+
if (target.type === "object" && source.type === "record") return Object.keys(target.properties ?? {}).length ? 0 : 2;
|
|
273
|
+
if (target.type !== source.type) return 0;
|
|
274
|
+
if (target.type === source.type) {
|
|
275
|
+
if (source.customizable && ![
|
|
276
|
+
"function",
|
|
277
|
+
"array",
|
|
278
|
+
"object",
|
|
279
|
+
"record"
|
|
280
|
+
].includes(source.type)) return 2;
|
|
281
|
+
}
|
|
282
|
+
if (source.type === "function" && target.type === "function") return Math.min(getSchemaCompatibilityScore({
|
|
283
|
+
...source.inputs,
|
|
284
|
+
customizable: source.customizable
|
|
285
|
+
}, target.inputs), getSchemaCompatibilityScore({
|
|
286
|
+
...source.output,
|
|
287
|
+
customizable: source.customizable
|
|
288
|
+
}, target.output)) + 1;
|
|
289
|
+
if (source.type === "array" && target.type === "array") {
|
|
290
|
+
if (source.customizable && (!source.items || source.items.type === "unknown")) return 1;
|
|
291
|
+
return getSchemaCompatibilityScore(source.items, target.items);
|
|
292
|
+
}
|
|
293
|
+
if (source.type === "record" && target.type === "record") {
|
|
294
|
+
if (source.customizable && (!source.value || source.value.type === "unknown")) return 1;
|
|
295
|
+
return Math.min(getSchemaCompatibilityScore(source.key, target.key), getSchemaCompatibilityScore(source.value, target.value));
|
|
296
|
+
}
|
|
297
|
+
if (source.type === "object" && target.type === "object") {
|
|
298
|
+
if (source === target) return 5;
|
|
299
|
+
if (!target.properties) target.properties = {};
|
|
300
|
+
if (!source.properties) source.properties = {};
|
|
301
|
+
if (source.customizable) return 5;
|
|
302
|
+
return Math.min(5, ...Object.keys(target.properties).filter((key) => !target.properties[key].optional).map((key) => {
|
|
303
|
+
const name = target.properties[key].name;
|
|
304
|
+
let toKey = key;
|
|
305
|
+
if (!source.properties[toKey] && name) toKey = name;
|
|
306
|
+
if (!source.properties[toKey]) {
|
|
307
|
+
const matchingKey = Object.keys(source.properties).find((sourceKey) => {
|
|
308
|
+
const sourceName = source.properties[sourceKey].name;
|
|
309
|
+
return sourceName === key || sourceName === name;
|
|
310
|
+
});
|
|
311
|
+
if (!matchingKey) return 0;
|
|
312
|
+
toKey = matchingKey;
|
|
313
|
+
}
|
|
314
|
+
return getSchemaCompatibilityScore(source.properties[toKey], target.properties[key]);
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
if (source.type === "interface" && source.className) {
|
|
318
|
+
if (target.type !== "interface") return 0;
|
|
319
|
+
if (source.className === target.className) return 5;
|
|
320
|
+
if (getExtendedInterface(source.className).includes(target.className)) return 4;
|
|
321
|
+
return 0;
|
|
322
|
+
}
|
|
323
|
+
return 2;
|
|
324
|
+
function getExtendedInterface(interfaceName) {
|
|
325
|
+
const extendedInterface = interfaceConfigs[interfaceName]?.extends;
|
|
326
|
+
if (!extendedInterface) return [];
|
|
327
|
+
return extendedInterface.map((extend) => [extend, getExtendedInterface(extend)].flat()).flat();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function getTypeReferenceKey(schema) {
|
|
331
|
+
return [...schema.target, ...schema.path ?? []].join("/");
|
|
332
|
+
}
|
|
333
|
+
function getIndexedSchema(schema, key) {
|
|
334
|
+
if (key === "[]") return schema.type === "array" ? schema.items : void 0;
|
|
335
|
+
if (schema.type !== "object") return;
|
|
336
|
+
return schema.properties[key] ?? Object.values(schema.properties).find((property) => property.name === key);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Merge the members of an intersection into a single object schema; a later member's property wins over an earlier one with the same name
|
|
340
|
+
* @param schema - The intersection
|
|
341
|
+
* @param resolve - Resolves type references to their target schema
|
|
342
|
+
*/
|
|
343
|
+
function mergeIntersection(schema, resolve = (schema) => schema) {
|
|
344
|
+
const properties = /* @__PURE__ */ new Map();
|
|
345
|
+
for (const element of schema.elements ?? []) {
|
|
346
|
+
const resolved = resolve(element);
|
|
347
|
+
const member = resolved.type === "intersection" ? mergeIntersection(resolved, resolve) : resolved;
|
|
348
|
+
if (member.type !== "object") return LogicType.unknown({
|
|
349
|
+
description: schema.description,
|
|
350
|
+
name: schema.name,
|
|
351
|
+
optional: schema.optional
|
|
352
|
+
});
|
|
353
|
+
for (const [key, property] of Object.entries(member.properties)) properties.set(property.name || key, [key, property]);
|
|
354
|
+
}
|
|
355
|
+
return LogicType.object(Object.fromEntries(properties.values()), {
|
|
356
|
+
description: schema.description,
|
|
357
|
+
name: schema.name,
|
|
358
|
+
optional: schema.optional
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
function isRecordKeyCompatible(key, schema) {
|
|
362
|
+
switch (schema?.type) {
|
|
363
|
+
case "number": return key.trim() !== "" && !Number.isNaN(Number(key));
|
|
364
|
+
default: return true;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function objectToSchema(object, args = {}) {
|
|
368
|
+
switch (typeof object) {
|
|
369
|
+
case "object":
|
|
370
|
+
if (Array.isArray(object)) {
|
|
371
|
+
if (object.length === 0) return LogicType.array(LogicType.unknown(), {
|
|
372
|
+
...args,
|
|
373
|
+
customizable: true
|
|
374
|
+
});
|
|
375
|
+
return LogicType.array(objectToSchema(object[0]), args);
|
|
376
|
+
}
|
|
377
|
+
if (object instanceof Date) return LogicType.interface("Date", args);
|
|
378
|
+
if (object === null) return LogicType.unknown(args);
|
|
379
|
+
if (isInterfaceConstant(object)) return LogicType.interface(object._interface, args);
|
|
380
|
+
if (object._dynamic) return LogicType.unknown(args);
|
|
381
|
+
return LogicType.object(objectMap(object, ({ key, value }) => objectToSchema(value, { name: key })), args);
|
|
382
|
+
case "boolean": return LogicType.boolean(args);
|
|
383
|
+
case "number": return LogicType.number(args);
|
|
384
|
+
case "string": return LogicType.string(args);
|
|
385
|
+
default: return LogicType.unknown(args);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function isValueSchemaCompatible(value, schema) {
|
|
389
|
+
return isSchemaCompatible(objectToSchema(value), schema);
|
|
390
|
+
}
|
|
391
|
+
let ELogicType = /* @__PURE__ */ function(ELogicType) {
|
|
392
|
+
ELogicType["function"] = "function";
|
|
393
|
+
ELogicType["macro"] = "macro";
|
|
394
|
+
ELogicType["operation"] = "operation";
|
|
395
|
+
return ELogicType;
|
|
396
|
+
}({});
|
|
397
|
+
let ELogicScope = /* @__PURE__ */ function(ELogicScope) {
|
|
398
|
+
ELogicScope["Frontend"] = "frontend";
|
|
399
|
+
ELogicScope["Backend"] = "backend";
|
|
400
|
+
ELogicScope["Desktop"] = "desktop";
|
|
401
|
+
ELogicScope["Shared"] = "shared";
|
|
402
|
+
return ELogicScope;
|
|
403
|
+
}({});
|
|
404
|
+
function makeLogicNode(node) {
|
|
405
|
+
return node;
|
|
406
|
+
}
|
|
407
|
+
const wrappers = [
|
|
408
|
+
["(", ")"],
|
|
409
|
+
["[", "]"],
|
|
410
|
+
["{", "}"],
|
|
411
|
+
["<", ">"],
|
|
412
|
+
["'", "'"],
|
|
413
|
+
["\"", "\""]
|
|
414
|
+
];
|
|
415
|
+
function lexer(scan) {
|
|
416
|
+
return cleanArray(splitUntil(scan, ";"));
|
|
417
|
+
}
|
|
418
|
+
function asLexerNode(element) {
|
|
419
|
+
return typeof element === "object" && !Array.isArray(element) ? element : void 0;
|
|
420
|
+
}
|
|
421
|
+
function getUntil(scan, until, depth = 1) {
|
|
422
|
+
const result = [];
|
|
423
|
+
const opening = wrappers.find((wrapper) => wrapper[1] === until)?.[0];
|
|
424
|
+
while (scan.length) {
|
|
425
|
+
if (scan[0] === opening) {}
|
|
426
|
+
if (scan[0] === until) {
|
|
427
|
+
depth--;
|
|
428
|
+
if (depth <= 0) break;
|
|
429
|
+
}
|
|
430
|
+
const element = getFirstElement(scan);
|
|
431
|
+
result.push(element);
|
|
432
|
+
const node = asLexerNode(element);
|
|
433
|
+
if (depth === 0 && node?.type === "wrap" && node.style?.endsWith(until)) break;
|
|
434
|
+
}
|
|
435
|
+
scan.shift();
|
|
436
|
+
return result;
|
|
437
|
+
}
|
|
438
|
+
function eraseUntil(scan, until) {
|
|
439
|
+
while (scan.length) {
|
|
440
|
+
if (scan[0] === until) {
|
|
441
|
+
scan.shift();
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
scan.shift();
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
function splitUntil(scan, until) {
|
|
448
|
+
const result = [[]];
|
|
449
|
+
while (scan.length) {
|
|
450
|
+
if (scan[0] === until) {
|
|
451
|
+
result.push([]);
|
|
452
|
+
scan.shift();
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
result[result.length - 1].push(getFirstElement(scan));
|
|
456
|
+
}
|
|
457
|
+
return result.filter((chunk) => chunk.length);
|
|
458
|
+
}
|
|
459
|
+
function getFirstElement(scan) {
|
|
460
|
+
let element = scan.shift();
|
|
461
|
+
let exportFlag = false;
|
|
462
|
+
if (element === "export") {
|
|
463
|
+
exportFlag = true;
|
|
464
|
+
element = scan.shift();
|
|
465
|
+
if (element === "=") return {
|
|
466
|
+
content: scan.shift(),
|
|
467
|
+
type: "export"
|
|
468
|
+
};
|
|
469
|
+
if (element === "as") {
|
|
470
|
+
eraseUntil(scan, ";");
|
|
471
|
+
return getFirstElement(scan);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
if (element === "declare") element = scan.shift();
|
|
475
|
+
if (element === "namespace") {
|
|
476
|
+
const name = scan.shift();
|
|
477
|
+
scan.shift();
|
|
478
|
+
const content = splitUntil(getUntil(scan, "}", 0), ";");
|
|
479
|
+
scan.unshift(";");
|
|
480
|
+
return {
|
|
481
|
+
content,
|
|
482
|
+
export: exportFlag,
|
|
483
|
+
name,
|
|
484
|
+
type: "namespace"
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
if (element === "function") {
|
|
488
|
+
const name = scan.shift();
|
|
489
|
+
const then = scan.shift();
|
|
490
|
+
const result = {
|
|
491
|
+
name,
|
|
492
|
+
type: "function"
|
|
493
|
+
};
|
|
494
|
+
if (then === "<") {
|
|
495
|
+
result.template = getUntil(scan, ">");
|
|
496
|
+
scan.shift();
|
|
497
|
+
}
|
|
498
|
+
const params = splitUntil(getUntil(scan, ")", 0), ",");
|
|
499
|
+
result.export = exportFlag;
|
|
500
|
+
result.params = params;
|
|
501
|
+
if (scan[0] === ":") {
|
|
502
|
+
scan.shift();
|
|
503
|
+
result.returns = getUntil(scan, ";");
|
|
504
|
+
}
|
|
505
|
+
scan.unshift(";");
|
|
506
|
+
return result;
|
|
507
|
+
}
|
|
508
|
+
if (element === "interface") {
|
|
509
|
+
const name = scan.shift();
|
|
510
|
+
scan.shift();
|
|
511
|
+
const content = splitUntil(getUntil(scan, "}", 0), ";");
|
|
512
|
+
scan.unshift(";");
|
|
513
|
+
return {
|
|
514
|
+
content,
|
|
515
|
+
name,
|
|
516
|
+
type: "interface"
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
if (element === "type" && /^[A-Za-z0-9]*$/.test(String(scan[0]))) {
|
|
520
|
+
const name = scan.shift();
|
|
521
|
+
const then = scan.shift();
|
|
522
|
+
const result = {
|
|
523
|
+
name,
|
|
524
|
+
type: "type"
|
|
525
|
+
};
|
|
526
|
+
if (then === "<") {
|
|
527
|
+
result.template = getUntil(scan, ">");
|
|
528
|
+
scan.shift();
|
|
529
|
+
}
|
|
530
|
+
result.content = getUntil(scan, ";");
|
|
531
|
+
scan.unshift(";");
|
|
532
|
+
return result;
|
|
533
|
+
}
|
|
534
|
+
if (element === "enum") {
|
|
535
|
+
const name = scan.shift();
|
|
536
|
+
scan.shift();
|
|
537
|
+
const content = getUntil(scan, "}");
|
|
538
|
+
scan.unshift(";");
|
|
539
|
+
return {
|
|
540
|
+
name,
|
|
541
|
+
options: Object.fromEntries(content.join("").split(",").filter((item) => item.trim()).map((item) => {
|
|
542
|
+
if (item.includes("=")) {
|
|
543
|
+
const [name, value] = item.split("=");
|
|
544
|
+
return [JSON.parse(value), name];
|
|
545
|
+
}
|
|
546
|
+
return [name, name];
|
|
547
|
+
})),
|
|
548
|
+
type: "enum"
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
if (typeof element === "string" && element.startsWith("/*")) return {
|
|
552
|
+
content: cleanComment(element),
|
|
553
|
+
type: "comment"
|
|
554
|
+
};
|
|
555
|
+
for (const wrapper of wrappers) if (element === wrapper[0]) return {
|
|
556
|
+
content: splitUntil(getUntil(scan, wrapper[1]), ";").map((item) => splitUntil(item, ",")).map((item) => splitUntil(item, "|")),
|
|
557
|
+
style: wrapper.join(""),
|
|
558
|
+
type: "wrap"
|
|
559
|
+
};
|
|
560
|
+
return element;
|
|
561
|
+
}
|
|
562
|
+
function cleanArray(input) {
|
|
563
|
+
if (Array.isArray(input)) {
|
|
564
|
+
if (input.length === 1) return cleanArray(input[0]);
|
|
565
|
+
return input.map((element) => cleanArray(element));
|
|
566
|
+
}
|
|
567
|
+
if (typeof input === "object" && input !== null) return objectMap(input, ({ value }) => cleanArray(value));
|
|
568
|
+
return input;
|
|
569
|
+
}
|
|
570
|
+
function cleanComment(comment) {
|
|
571
|
+
comment = comment.trim();
|
|
572
|
+
if (!(comment.startsWith("/**") && comment.endsWith("*/"))) return comment;
|
|
573
|
+
comment = comment.slice(3, -2).split("\n").map((line) => {
|
|
574
|
+
const trim = line.trim();
|
|
575
|
+
if (trim.startsWith("* ")) return trim.slice(2);
|
|
576
|
+
return trim;
|
|
577
|
+
}).join("\n").trim();
|
|
578
|
+
return comment.trim();
|
|
579
|
+
}
|
|
580
|
+
function cleanUnion(schema) {
|
|
581
|
+
if (schema.elements.find((element) => ["undefined", "void"].includes(element.type))) {
|
|
582
|
+
schema.optional = true;
|
|
583
|
+
schema.elements = schema.elements.filter((element) => !["undefined", "void"].includes(element.type));
|
|
584
|
+
}
|
|
585
|
+
const childUnions = schema.elements.filter((element) => element.type === "union");
|
|
586
|
+
if (childUnions.length > 0) {
|
|
587
|
+
schema.elements = schema.elements.filter((element) => element.type !== "union");
|
|
588
|
+
for (const childUnion of childUnions) schema.elements = [...schema.elements, ...childUnion.elements];
|
|
589
|
+
}
|
|
590
|
+
const stringElements = schema.elements.filter((element) => element.type === "string");
|
|
591
|
+
if (stringElements.length > 1) {
|
|
592
|
+
const enumValues = [];
|
|
593
|
+
let anyFlag = false;
|
|
594
|
+
for (const element of stringElements) if (element.enum) enumValues.push(...element.enum);
|
|
595
|
+
else anyFlag = true;
|
|
596
|
+
schema.elements = [...schema.elements.filter((element) => element.type !== "string"), anyFlag ? LogicType.string() : LogicType.string({ enum: enumValues })];
|
|
597
|
+
}
|
|
598
|
+
const numberElements = schema.elements.filter((element) => element.type === "number");
|
|
599
|
+
if (numberElements.length > 1) {
|
|
600
|
+
const enumValues = [];
|
|
601
|
+
let anyFlag = false;
|
|
602
|
+
for (const element of numberElements) if (element.enum) enumValues.push(...element.enum);
|
|
603
|
+
else anyFlag = true;
|
|
604
|
+
schema.elements = [...schema.elements.filter((element) => element.type !== "number"), anyFlag ? LogicType.number() : LogicType.number({ enum: enumValues })];
|
|
605
|
+
}
|
|
606
|
+
if (schema.elements.length === 1) {
|
|
607
|
+
const simpleSchema = schema.elements[0];
|
|
608
|
+
simpleSchema.optional = schema.optional;
|
|
609
|
+
return simpleSchema;
|
|
610
|
+
}
|
|
611
|
+
if (schema.elements.length === 0) return LogicType.void();
|
|
612
|
+
return schema;
|
|
613
|
+
}
|
|
614
|
+
function cleanInterface(schema) {
|
|
615
|
+
const template = schema.options?.template ?? [];
|
|
616
|
+
if (schema.className === "Array") return LogicType.array(template[0]);
|
|
617
|
+
if (schema.className === "Type" && template[0]?.enum?.length) {
|
|
618
|
+
const reference = template[0].enum[0];
|
|
619
|
+
const target = (Array.isArray(reference) ? reference.join("") : String(reference)).split("/");
|
|
620
|
+
return LogicType.type(target, schema.optional ? { optional: true } : {});
|
|
621
|
+
}
|
|
622
|
+
if (schema.className === "keyof") return LogicType.string();
|
|
623
|
+
if (schema.className === "Record") return LogicType.object({});
|
|
624
|
+
if (schema.className === "PropertyKey") return LogicType.union([LogicType.string(), LogicType.number()]);
|
|
625
|
+
if ([
|
|
626
|
+
"Promise",
|
|
627
|
+
"Partial",
|
|
628
|
+
"Required"
|
|
629
|
+
].includes(schema.className)) {
|
|
630
|
+
const transform = LogicUtil[schema.className.toLocaleLowerCase()];
|
|
631
|
+
return transform(template[0]);
|
|
632
|
+
}
|
|
633
|
+
if (["Omit", "Pick"].includes(schema.className)) {
|
|
634
|
+
const transform = LogicUtil[schema.className.toLocaleLowerCase()];
|
|
635
|
+
return transform(template[0], template[1]?.enum);
|
|
636
|
+
}
|
|
637
|
+
return schema;
|
|
638
|
+
}
|
|
639
|
+
function scanner(input) {
|
|
640
|
+
const elements = [];
|
|
641
|
+
input = input.replaceAll(/ +/g, " ");
|
|
642
|
+
input = input.replaceAll(/\s*\n\s*/g, "\n");
|
|
643
|
+
while (input.length) {
|
|
644
|
+
if ([" ", "\n"].includes(input[0])) {
|
|
645
|
+
input = input.slice(1);
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
if (input.startsWith("/*")) {
|
|
649
|
+
const commentEnd = input.indexOf("*/");
|
|
650
|
+
elements.push(input.slice(0, commentEnd + 2));
|
|
651
|
+
input = input.slice(commentEnd + 2);
|
|
652
|
+
continue;
|
|
653
|
+
}
|
|
654
|
+
if (["'", "\""].includes(input[0])) {
|
|
655
|
+
const quote = input[0];
|
|
656
|
+
const literal = input.match(quote === "'" ? /^'((?:[^'\\]|\\.)*)'/ : /^"((?:[^"\\]|\\.)*)"/);
|
|
657
|
+
if (literal) {
|
|
658
|
+
elements.push(quote, ...literal[1] ? [literal[1].replaceAll(/\\(.)/g, "$1")] : [], quote);
|
|
659
|
+
input = input.slice(literal[0].length);
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
const startingWord = input.match(/^([a-zA-Z_][a-zA-Z0-9_.]*)/)?.[0];
|
|
664
|
+
if (startingWord) {
|
|
665
|
+
input = input.slice(startingWord.length);
|
|
666
|
+
elements.push(startingWord);
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
const startingNumber = input.match(/^([0-9]+)/)?.[0];
|
|
670
|
+
if (startingNumber) {
|
|
671
|
+
input = input.slice(startingNumber.length);
|
|
672
|
+
elements.push(startingNumber);
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
if (input[0] === ">" && elements.at(-1) === "=") {
|
|
676
|
+
elements.pop();
|
|
677
|
+
elements.push("=>");
|
|
678
|
+
input = input.slice(1);
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
elements.push(input[0]);
|
|
682
|
+
input = input.slice(1);
|
|
683
|
+
}
|
|
684
|
+
return elements;
|
|
685
|
+
}
|
|
686
|
+
function parser(element, options = {}) {
|
|
687
|
+
if (typeof element === "string") {
|
|
688
|
+
if (element === "string") return LogicType.string(options);
|
|
689
|
+
if (element === "number") return LogicType.number(options);
|
|
690
|
+
if (element === "boolean") return LogicType.boolean(options);
|
|
691
|
+
if (element === "undefined") return LogicType.void(options);
|
|
692
|
+
if (["unknown", "any"].includes(element)) return LogicType.unknown(options);
|
|
693
|
+
if (["undefined", "null"].includes(element)) return LogicType.undefined(options);
|
|
694
|
+
return cleanInterface(LogicType.interface(element, options));
|
|
695
|
+
}
|
|
696
|
+
if (Array.isArray(element)) {
|
|
697
|
+
if (element[0] === "readonly") element.shift();
|
|
698
|
+
if (element.length === 1) return parser(element[0], options);
|
|
699
|
+
if (element.includes("|")) return cleanUnion(LogicType.union(separate(element, (element) => element === "|").map((element) => parser(element)), options));
|
|
700
|
+
if (element.includes("&")) {
|
|
701
|
+
const members = separate(element, (element) => element === "&").map((element) => parser(element));
|
|
702
|
+
if (members.every((member) => [
|
|
703
|
+
"object",
|
|
704
|
+
"type",
|
|
705
|
+
"intersection"
|
|
706
|
+
].includes(member.type))) return LogicType.intersection(members.flatMap((member) => member.type === "intersection" ? member.elements : [member]), options);
|
|
707
|
+
return cleanUnion(LogicType.union(members, options));
|
|
708
|
+
}
|
|
709
|
+
const last = asLexerNode(element.at(-1));
|
|
710
|
+
if (last?.type === "wrap" && last.style === "[]") {
|
|
711
|
+
const base = parser(element.slice(0, -1));
|
|
712
|
+
const key = getIndexKey(last.content);
|
|
713
|
+
if (key === void 0) return LogicType.array(base, options);
|
|
714
|
+
return withOptional(getIndexedType(base, key), options);
|
|
715
|
+
}
|
|
716
|
+
if (element[0] === "import" && element[2] === ".") return parser(element.slice(3), options);
|
|
717
|
+
if (element.length === 2) {
|
|
718
|
+
const generic = asLexerNode(element[1]);
|
|
719
|
+
if (generic?.type === "wrap" && generic.style === "<>") {
|
|
720
|
+
let template = Array.isArray(generic.content) ? generic.content : [generic.content];
|
|
721
|
+
if (!Array.isArray(template[0])) {
|
|
722
|
+
if (template.some((element) => isWrap(element, "[]")) || template.some((element) => isWrap(element, "<>")) || template.includes("&") || template.includes("|")) template = [template];
|
|
723
|
+
else template = template.map((element) => [element]);
|
|
724
|
+
}
|
|
725
|
+
return cleanInterface(LogicType.interface(element[0], {
|
|
726
|
+
...options,
|
|
727
|
+
options: { template: template.map((element) => parser(element)) }
|
|
728
|
+
}));
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
if (element.length === 3) {
|
|
732
|
+
if (element[1] === "=>") {
|
|
733
|
+
const content = asLexerNode(element[0])?.content ?? [];
|
|
734
|
+
const parameters = !content.length || Array.isArray(content[0]) ? content : [content];
|
|
735
|
+
return LogicType.function(LogicType.object(Object.fromEntries(parameters.map((parameter) => {
|
|
736
|
+
return [parameter[0], parser(parameter.slice(2))];
|
|
737
|
+
}))), parser(element[2]));
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return parser(element[0], options);
|
|
741
|
+
}
|
|
742
|
+
if (element.type === "wrap") {
|
|
743
|
+
const style = element.style ?? "";
|
|
744
|
+
if (["''", "\"\""].includes(style)) return LogicType.string({
|
|
745
|
+
...options,
|
|
746
|
+
enum: [element.content]
|
|
747
|
+
});
|
|
748
|
+
if (style === "{}") {
|
|
749
|
+
const content = element.content;
|
|
750
|
+
const properties = !content.length || Array.isArray(content[0]) ? content : [content];
|
|
751
|
+
return LogicType.object(Object.fromEntries(properties.map((property) => [getPropertyKey(property[0]), property]).filter((entry) => entry[0] !== void 0).map(([key, property]) => [key, property[1] === "?" ? parser(property.slice(3), { optional: true }) : parser(property.slice(2))])), options);
|
|
752
|
+
}
|
|
753
|
+
if (style === "[]") {
|
|
754
|
+
const content = element.content;
|
|
755
|
+
if (content[1] === ":") return LogicType.array(parser(content.slice(2)), options);
|
|
756
|
+
return LogicType.array(parser(content), options);
|
|
757
|
+
}
|
|
758
|
+
if (style === "()") return parser(element.content, options);
|
|
759
|
+
}
|
|
760
|
+
console.log("Unknown element");
|
|
761
|
+
console.log(element);
|
|
762
|
+
return LogicType.unknown();
|
|
763
|
+
}
|
|
764
|
+
function getIndexKey(content) {
|
|
765
|
+
if (content === "number") return "[]";
|
|
766
|
+
return getQuotedString(content);
|
|
767
|
+
}
|
|
768
|
+
function getPropertyKey(element) {
|
|
769
|
+
return typeof element === "string" ? element : getQuotedString(element);
|
|
770
|
+
}
|
|
771
|
+
function getQuotedString(element) {
|
|
772
|
+
const node = asLexerNode(element);
|
|
773
|
+
if (node?.type === "wrap" && ["''", "\"\""].includes(node.style ?? "") && typeof node.content === "string") return node.content;
|
|
774
|
+
}
|
|
775
|
+
function getIndexedType(base, key) {
|
|
776
|
+
if (base.type === "type") return {
|
|
777
|
+
...base,
|
|
778
|
+
path: [...base.path ?? [], key]
|
|
779
|
+
};
|
|
780
|
+
return getIndexedSchema(base, key) ?? LogicType.unknown();
|
|
781
|
+
}
|
|
782
|
+
function withOptional(schema, options) {
|
|
783
|
+
return options.optional ? {
|
|
784
|
+
...schema,
|
|
785
|
+
optional: true
|
|
786
|
+
} : schema;
|
|
787
|
+
}
|
|
788
|
+
function isWrap(element, style) {
|
|
789
|
+
const node = asLexerNode(element);
|
|
790
|
+
return node?.type === "wrap" && node.style === style;
|
|
791
|
+
}
|
|
792
|
+
function separate(result, separator) {
|
|
793
|
+
const output = [[]];
|
|
794
|
+
for (const element of result) if (separator(element)) output.push([]);
|
|
795
|
+
else output[output.length - 1].push(element);
|
|
796
|
+
return output;
|
|
797
|
+
}
|
|
798
|
+
function typeToSchema(type) {
|
|
799
|
+
try {
|
|
800
|
+
if (/^[A-Za-z]+\??:/.test(type)) {
|
|
801
|
+
const [, name, optional, rest] = type.match(/([A-Za-z]+)(\??):(.*)/);
|
|
802
|
+
const schema = parser(lexer(scanner(rest)));
|
|
803
|
+
schema.name = name;
|
|
804
|
+
if (optional === "?") schema.optional = true;
|
|
805
|
+
return schema;
|
|
806
|
+
}
|
|
807
|
+
return parser(lexer(scanner(type)));
|
|
808
|
+
} catch (error) {
|
|
809
|
+
console.error("Failed to parse type", type);
|
|
810
|
+
console.error(error);
|
|
811
|
+
return LogicType.unknown();
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
function schemaLoop(schema, func, key) {
|
|
815
|
+
schema = func({
|
|
816
|
+
key,
|
|
817
|
+
schema
|
|
818
|
+
}) || schema;
|
|
819
|
+
if (schema.type === "object") for (const key in schema.properties) schema.properties[key] = schemaLoop(schema.properties[key], func, key);
|
|
820
|
+
if (schema.type === "array") schema.items = schemaLoop(schema.items, func);
|
|
821
|
+
if (schema.type === "record") schema.value = schemaLoop(schema.value, func);
|
|
822
|
+
if (schema.type === "function") {
|
|
823
|
+
schema.inputs = schemaLoop(schema.inputs, func);
|
|
824
|
+
schema.output = schemaLoop(schema.output, func);
|
|
825
|
+
}
|
|
826
|
+
if (["union", "intersection"].includes(schema.type)) for (const key in schema.elements) schema.elements[key] = schemaLoop(schema.elements[key], func);
|
|
827
|
+
return schema;
|
|
828
|
+
}
|
|
829
|
+
function getSubSchema(schema) {
|
|
830
|
+
while (schema?.sub) schema = schema.sub;
|
|
831
|
+
return schema;
|
|
832
|
+
}
|
|
833
|
+
function getSchemaDefault(schema) {
|
|
834
|
+
if (!schema.default) return getDefaultValue(schema);
|
|
835
|
+
return getValueDefault(schema.default, schema, "name");
|
|
836
|
+
}
|
|
837
|
+
function getValueDefault(value, schema, keyType = "id") {
|
|
838
|
+
if (schema.type === "object") return getObjectDefault(value || {}, schema);
|
|
839
|
+
if (schema.type === "array") return getArrayDefault(value ? cloneDeep(value) : [], schema);
|
|
840
|
+
if (schema.type === "record") return getRecordDefault(value || {}, schema);
|
|
841
|
+
if (schema.type === "interface" && !isInterfaceConstant(value) && window[schema.className]) return createInterfaceInstance(schema.className);
|
|
842
|
+
return value ?? getDefaultValue(schema);
|
|
843
|
+
function getObjectDefault(value, schema) {
|
|
844
|
+
return objectFullMap(schema.properties || {}, ({ key, value: schemaValue }) => ({
|
|
845
|
+
key: keyType === "id" ? key : schemaValue.name || key,
|
|
846
|
+
value: getValueDefault(value[key] ?? value[schemaValue.name], schemaValue, keyType)
|
|
847
|
+
}));
|
|
848
|
+
}
|
|
849
|
+
function getArrayDefault(value, schema) {
|
|
850
|
+
return value.map((item) => getValueDefault(item, schema.items, keyType));
|
|
851
|
+
}
|
|
852
|
+
function getRecordDefault(value, schema) {
|
|
853
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, getValueDefault(item, schema.value, keyType)]));
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
function getDefaultValue(schema, keyType = "id") {
|
|
857
|
+
if (!schema) return;
|
|
858
|
+
if (schema.type === "unknown") schema = getSubSchema(schema);
|
|
859
|
+
if (schema.default !== void 0) {
|
|
860
|
+
if (isValueSchemaCompatible(schema.default, schema)) return cloneDeep(schema.default);
|
|
861
|
+
}
|
|
862
|
+
switch (schema.type) {
|
|
863
|
+
case "string":
|
|
864
|
+
if (schema.format === "color") return "#000000";
|
|
865
|
+
return "";
|
|
866
|
+
case "number": return 0;
|
|
867
|
+
case "boolean": return false;
|
|
868
|
+
case "object": {
|
|
869
|
+
const result = {};
|
|
870
|
+
for (const key in schema.properties) {
|
|
871
|
+
if (schema.properties[key].optional) continue;
|
|
872
|
+
if (keyType === "name") result[schema.properties[key].name || key] = getDefaultValue(schema.properties[key], keyType);
|
|
873
|
+
else result[key] = getDefaultValue(schema.properties[key], keyType);
|
|
874
|
+
}
|
|
875
|
+
return result;
|
|
876
|
+
}
|
|
877
|
+
case "array": return [];
|
|
878
|
+
case "record": return {};
|
|
879
|
+
case "interface": return createInterfaceInstance(schema.className);
|
|
880
|
+
case "union": return getDefaultValue(schema.elements[0], keyType);
|
|
881
|
+
case "intersection": return Object.assign({}, ...schema.elements.map((element) => getDefaultValue(element, keyType)));
|
|
882
|
+
default: return;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
function createInterfaceInstance(className) {
|
|
886
|
+
const constructor = globalThis[className];
|
|
887
|
+
if (typeof constructor !== "function") return;
|
|
888
|
+
try {
|
|
889
|
+
return new constructor();
|
|
890
|
+
} catch {
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
export { LogicUtil as a, mergeIntersection as c, assertType as d, cleanObject as f, LogicType as i, schemaLoop as l, objectMap as m, ELogicType as n, getSchemaDefault as o, cloneWithFunctions as p, EVarType as r, makeLogicNode as s, ELogicScope as t, typeToSchema as u };
|