moonflower 1.3.5 → 1.3.7

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.
@@ -1,8 +1,8 @@
1
1
  import { SyntaxKind as e } from "ts-morph";
2
- import { Logger as m } from "../../utils/logger.mjs";
3
- import { OpenApiManager as O } from "../manager/OpenApiManager.mjs";
4
- const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
5
- const i = L.get(t);
2
+ import { Logger as K } from "../../utils/logger.mjs";
3
+ import { OpenApiManager as v } from "../manager/OpenApiManager.mjs";
4
+ const b = /* @__PURE__ */ new WeakMap(), h = (t) => {
5
+ const i = b.get(t);
6
6
  if (i)
7
7
  return i;
8
8
  if (t.getKind() === e.Identifier) {
@@ -11,31 +11,31 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
11
11
  const o = r.getParent().getLastChild();
12
12
  if (o === t)
13
13
  throw new Error("Recursive implementation found");
14
- const p = c(o);
15
- return L.set(t, p), p;
14
+ const d = h(o);
15
+ return b.set(t, d), d;
16
16
  }
17
17
  const l = t.asKind(e.Identifier).getDefinitions()[0]?.getNode();
18
18
  if (l) {
19
19
  const o = l.getParent().getLastChild();
20
20
  if (o === t)
21
21
  throw new Error("Recursive implementation found");
22
- const p = c(o);
23
- return L.set(t, p), p;
22
+ const d = h(o);
23
+ return b.set(t, d), d;
24
24
  }
25
25
  throw new Error("No implementation nor definition available");
26
26
  }
27
- return L.set(t, t), t;
28
- }, C = (t) => {
27
+ return b.set(t, t), t;
28
+ }, S = (t) => {
29
29
  const i = t.getChildrenOfKind(e.Identifier);
30
- return i.length === 2 ? c(i[1]) : t.getChildren().reverse().find(
30
+ return i.length === 2 ? h(i[1]) : t.getChildren().reverse().find(
31
31
  (l) => l.getKind() !== e.GreaterThanToken && l.getKind() !== e.CommaToken && l.getKind() !== e.SemicolonToken
32
32
  );
33
33
  }, P = (t) => {
34
34
  const i = t.getFirstChildByKind(e.SyntaxList);
35
- return i.isKind(e.SyntaxList) ? y(i.getFirstChild()) : y(i);
36
- }, y = (t) => {
35
+ return i.isKind(e.SyntaxList) ? m(i.getFirstChild()) : m(i);
36
+ }, m = (t) => {
37
37
  const i = t.getSymbol()?.getName();
38
- if (i && O.getInstance().hasExposedModel(i))
38
+ if (i && v.getInstance().hasExposedModel(i))
39
39
  return [
40
40
  {
41
41
  role: "ref",
@@ -43,7 +43,7 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
43
43
  optional: !1
44
44
  }
45
45
  ];
46
- const r = c(t);
46
+ const r = h(t);
47
47
  if (r.asKind(e.UndefinedKeyword))
48
48
  return "undefined";
49
49
  const n = r.asKind(e.LiteralType);
@@ -64,62 +64,62 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
64
64
  const s = r.asKind(e.TypeLiteral);
65
65
  if (s)
66
66
  return s.getFirstChildByKind(e.SyntaxList).getChildrenOfKind(e.PropertySignature).map((I) => {
67
- const k = I.getFirstChildByKind(e.Identifier), v = C(I), R = k.getNextSiblingIfKind(e.QuestionToken);
67
+ const k = I.getFirstChildByKind(e.Identifier), O = S(I), _ = k.getNextSiblingIfKind(e.QuestionToken);
68
68
  return {
69
69
  role: "property",
70
70
  identifier: k.getText(),
71
- shape: y(v),
72
- optional: v.getType().isNullable() || !!R
71
+ shape: m(O),
72
+ optional: O.getType().isNullable() || !!_
73
73
  };
74
74
  });
75
- const d = r.asKind(e.TypeReference);
76
- if (d)
77
- return y(d.getFirstChild());
75
+ const a = r.asKind(e.TypeReference);
76
+ if (a)
77
+ return m(a.getFirstChild());
78
78
  if (r.asKind(e.PropertyAccessExpression)) {
79
- const b = c(r.getLastChild());
80
- return f(b.asKind(e.CallExpression).getReturnType(), b);
79
+ const B = h(r.getLastChild());
80
+ return f(B.asKind(e.CallExpression).getReturnType(), B);
81
81
  }
82
- const h = r.asKind(e.UnionType);
83
- if (h)
84
- return f(h.getType(), r);
85
- const S = r.asKind(e.TypeQuery);
86
- if (S)
87
- return y(S.getLastChild());
88
- const F = r.asKind(e.QualifiedName);
82
+ const c = r.asKind(e.UnionType);
83
+ if (c)
84
+ return f(c.getType(), r);
85
+ const y = r.asKind(e.TypeQuery);
86
+ if (y)
87
+ return m(y.getLastChild());
88
+ const A = r.asKind(e.QualifiedName);
89
+ if (A)
90
+ return m(A.getLastChild());
91
+ const T = r.asKind(e.CallExpression);
92
+ if (T)
93
+ return f(T.getReturnType(), T);
94
+ const F = r.asKind(e.AwaitExpression);
89
95
  if (F)
90
- return y(F.getLastChild());
91
- const x = r.asKind(e.CallExpression);
92
- if (x)
93
- return f(x.getReturnType(), x);
94
- const B = r.asKind(e.AwaitExpression);
95
- if (B)
96
- return y(B.getChildAtIndex(1));
97
- const E = r.asKind(e.AsExpression);
98
- if (E)
99
- return y(E.getChildAtIndex(2));
100
- const D = r.getSourceFile().getFilePath().split("/").pop();
101
- return m.warn(`[${D}] Unknown node type: ${r.getKindName()}`), "unknown_1";
96
+ return m(F.getChildAtIndex(1));
97
+ const L = r.asKind(e.AsExpression);
98
+ if (L)
99
+ return m(L.getChildAtIndex(2));
100
+ const U = r.getSourceFile().getFilePath().split("/").pop();
101
+ return K.warn(`[${U}] Unknown node type: ${r.getKindName()}`), "unknown_1";
102
102
  }, z = (t) => t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).map((n) => {
103
- const o = n.getFirstChild(), p = (() => {
103
+ const o = n.getFirstChild(), d = (() => {
104
104
  if (o.isKind(e.Identifier))
105
105
  return o.getText();
106
106
  if (o.isKind(e.StringLiteral))
107
107
  return o.getLiteralText();
108
108
  const s = n.getSourceFile().getFilePath().split("/").pop();
109
- return m.warn(`[${s}] Unknown identifier name: ${o.getText()}`), "unknown_30";
110
- })(), a = n.getLastChild(), u = c(a);
109
+ return K.warn(`[${s}] Unknown identifier name: ${o.getText()}`), "unknown_30";
110
+ })(), p = n.getLastChild(), u = h(p);
111
111
  return {
112
112
  role: "property",
113
- identifier: p,
114
- shape: N(u),
113
+ identifier: d,
114
+ shape: x(u),
115
115
  optional: V(u),
116
- description: K(u, "description"),
117
- errorMessage: K(u, "errorMessage")
116
+ description: N(u, "description"),
117
+ errorMessage: N(u, "errorMessage")
118
118
  };
119
- }) || [], T = (t) => {
119
+ }) || [], C = (t) => {
120
120
  const i = t.asKind(e.CallExpression);
121
121
  return i ? (i.getReturnType().getSymbol()?.getName() ?? "").startsWith("Zod") : !1;
122
- }, A = (t) => {
122
+ }, E = (t) => {
123
123
  const i = t.asKind(e.CallExpression), l = i.getReturnType().getSymbol()?.getName() ?? "";
124
124
  if (l === "ZodNumber")
125
125
  return "number";
@@ -130,16 +130,16 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
130
130
  if (l === "ZodBigInt")
131
131
  return "bigint";
132
132
  if (l === "ZodObject") {
133
- const p = i.getFirstChildByKind(e.SyntaxList)?.getFirstChild()?.asKind(e.ObjectLiteralExpression);
134
- if (!p)
133
+ const d = i.getFirstChildByKind(e.SyntaxList)?.getFirstChild()?.asKind(e.ObjectLiteralExpression);
134
+ if (!d)
135
135
  return "unknown_zod_object";
136
- const a = p.getFirstChildByKind(e.SyntaxList);
137
- return a ? a.getChildrenOfKind(e.PropertyAssignment).map((s) => {
138
- const d = s.getFirstChildByKind(e.Identifier).getText(), g = s.getLastChild();
136
+ const p = d.getFirstChildByKind(e.SyntaxList);
137
+ return p ? p.getChildrenOfKind(e.PropertyAssignment).map((s) => {
138
+ const a = s.getFirstChildByKind(e.Identifier).getText(), g = s.getLastChild();
139
139
  return {
140
140
  role: "property",
141
- identifier: d,
142
- shape: T(g) ? A(g) : N(g),
141
+ identifier: a,
142
+ shape: C(g) ? E(g) : x(g),
143
143
  optional: !1
144
144
  };
145
145
  }) : [];
@@ -149,16 +149,16 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
149
149
  return o ? [
150
150
  {
151
151
  role: "array",
152
- shape: T(o) ? A(o) : N(o),
152
+ shape: C(o) ? E(o) : x(o),
153
153
  optional: !1
154
154
  }
155
155
  ] : "unknown_zod_array";
156
156
  }
157
157
  const n = t.getSourceFile().getFilePath().split("/").pop();
158
- return m.warn(`[${n}] Unknown zod type: ${l}`), "unknown_zod";
159
- }, N = (t) => {
160
- if (T(t))
161
- return A(t);
158
+ return K.warn(`[${n}] Unknown zod type: ${l}`), "unknown_zod";
159
+ }, x = (t) => {
160
+ if (C(t))
161
+ return E(t);
162
162
  const i = t.getParent().getFirstChildByKind(e.AsExpression);
163
163
  if (i) {
164
164
  const s = i.getLastChildByKind(e.TypeReference);
@@ -169,43 +169,43 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
169
169
  return P(r);
170
170
  if (t.getParent().getChildrenOfKind(e.SyntaxList).length >= 2) {
171
171
  const s = t.getParent().getFirstChildByKind(e.SyntaxList).getFirstChild();
172
- return y(s);
172
+ return m(s);
173
173
  }
174
174
  const l = t.getParent().getFirstChildByKind(e.CallExpression);
175
175
  if (l) {
176
- const s = c(
176
+ const s = h(
177
177
  l.getFirstChildByKind(e.SyntaxList).getFirstChild()
178
- ), d = s.getParent().getFirstChildByKind(e.TypeReference);
179
- if (d)
180
- return f(d.getType(), d, []);
178
+ ), a = s.getParent().getFirstChildByKind(e.TypeReference);
179
+ if (a)
180
+ return f(a.getType(), a, []);
181
181
  const g = s.getParent().getFirstChildByKind(e.ObjectLiteralExpression);
182
182
  if (g)
183
- return N(g);
183
+ return x(g);
184
184
  if (s.getKind() === e.CallExpression || s.getKind() === e.IntersectionType)
185
- return N(s);
186
- const h = t.getSourceFile().getFilePath().split("/").pop();
187
- return m.warn(`[${h}] Unknown call expression argument: ${s.getKindName()}`), "unknown_3";
185
+ return x(s);
186
+ const c = t.getSourceFile().getFilePath().split("/").pop();
187
+ return K.warn(`[${c}] Unknown call expression argument: ${s.getKindName()}`), "unknown_3";
188
188
  }
189
189
  const o = t.getFirstChildByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).find((s) => s.getFirstChildByKind(e.Identifier)?.getText() === "parse");
190
190
  if (o) {
191
- const s = C(o).asKind(e.ArrowFunction).getReturnType();
191
+ const s = S(o).asKind(e.ArrowFunction).getReturnType();
192
192
  return f(s, o);
193
193
  }
194
- const p = t.getFirstChildByKind(e.SyntaxList)?.getFirstChildByKind(e.ImportType);
195
- if (p) {
196
- const s = p.getLastChildByKind(e.GreaterThanToken).getChildIndex(), d = p.getChildAtIndex(s - 1);
197
- return y(d.getFirstChild());
194
+ const d = t.getFirstChildByKind(e.SyntaxList)?.getFirstChildByKind(e.ImportType);
195
+ if (d) {
196
+ const s = d.getLastChildByKind(e.GreaterThanToken).getChildIndex(), a = d.getChildAtIndex(s - 1);
197
+ return m(a.getFirstChild());
198
198
  }
199
- const a = t.isKind(e.IntersectionType) ? t : t.getParent()?.isKind(e.VariableDeclaration) ? t.getParent()?.getFirstChildByKind(e.IntersectionType) : null;
200
- if (a) {
201
- const s = a.getFirstChildByKind(e.TypeReference);
199
+ const p = t.isKind(e.IntersectionType) ? t : t.getParent()?.isKind(e.VariableDeclaration) ? t.getParent()?.getFirstChildByKind(e.IntersectionType) : null;
200
+ if (p) {
201
+ const s = p.getFirstChildByKind(e.TypeReference);
202
202
  if (s)
203
203
  return P(s);
204
204
  }
205
205
  const u = t.getSourceFile().getFilePath().split("/").pop();
206
- return m.warn(`[${u}] Unknown import type node`), "unknown_2";
206
+ return K.warn(`[${u}] Unknown import type node`), "unknown_2";
207
207
  }, V = (t) => {
208
- if (T(t))
208
+ if (C(t))
209
209
  return !1;
210
210
  const i = t.asKind(e.CallExpression);
211
211
  if (i) {
@@ -214,40 +214,40 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
214
214
  return !0;
215
215
  if (n?.getText() === "RequiredParam")
216
216
  return !1;
217
- const o = i.getFirstChildByKind(e.SyntaxList), p = c(o.getFirstChild());
218
- return V(p);
217
+ const o = i.getFirstChildByKind(e.SyntaxList), d = h(o.getFirstChild());
218
+ return V(d);
219
219
  }
220
- return t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).some((n) => n.getFirstDescendantByKind(e.Identifier).getText() === "optional" ? C(n).getKind() === e.TrueKeyword : !1);
221
- }, K = (t, i) => {
222
- if (T(t))
220
+ return t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).some((n) => n.getFirstDescendantByKind(e.Identifier).getText() === "optional" ? S(n).getKind() === e.TrueKeyword : !1);
221
+ }, N = (t, i) => {
222
+ if (C(t))
223
223
  return "";
224
- const r = c(t), l = r.asKind(e.CallExpression);
224
+ const r = h(t), l = r.asKind(e.CallExpression);
225
225
  if (l) {
226
- const d = l.getLastChildByKind(e.SyntaxList);
227
- return K(d, i);
226
+ const a = l.getLastChildByKind(e.SyntaxList);
227
+ return N(a, i);
228
228
  }
229
229
  const n = r.asKind(e.SyntaxList);
230
230
  if (n)
231
- return n.getChildren().map((g) => K(g, i)).find((g) => !!g && g !== "unknown_25") || "";
231
+ return n.getChildren().map((g) => N(g, i)).find((g) => !!g && g !== "unknown_25") || "";
232
232
  const o = r.asKind(e.ObjectLiteralExpression);
233
233
  if (o) {
234
- const g = _(o).find((h) => h.identifier === i);
234
+ const g = R(o).find((c) => c.identifier === i);
235
235
  return g ? Array.isArray(g.value) ? "array" : g.value || "" : "";
236
236
  }
237
- const p = r.asKind(e.IntersectionType);
237
+ const d = r.asKind(e.IntersectionType);
238
+ if (d)
239
+ return d.getTypeNodes().flatMap((a) => N(a, i)).filter((a) => !!a && a !== "unknown_25")[0] || "unknown_27";
240
+ const p = r.asKind(e.TypeLiteral);
238
241
  if (p)
239
- return p.getTypeNodes().flatMap((d) => K(d, i)).filter((d) => !!d && d !== "unknown_25")[0] || "unknown_27";
240
- const a = r.asKind(e.TypeLiteral);
241
- if (a)
242
- return K(a.getFirstChildByKind(e.SyntaxList), i);
242
+ return N(p.getFirstChildByKind(e.SyntaxList), i);
243
243
  const u = r.asKind(e.PropertySignature);
244
244
  if (u && r.getFirstDescendantByKind(e.Identifier).getText() === i)
245
- return C(u).getFirstDescendantByKind(
245
+ return S(u).getFirstDescendantByKind(
246
246
  e.StringLiteral
247
247
  ).getLiteralText();
248
248
  const s = r.getSourceFile().getFilePath().split("/").pop();
249
- return m.dev(`[${s}] Unknown property string value node ${r.getKindName()}`), "unknown_25";
250
- }, $ = (t) => {
249
+ return K.dev(`[${s}] Unknown property string value node ${r.getKindName()}`), "unknown_25";
250
+ }, D = (t) => {
251
251
  const i = t.getSymbol();
252
252
  if (!t.isObject() || !i)
253
253
  return !1;
@@ -255,7 +255,7 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
255
255
  return i.getName() === "Promise" && r.length === 1;
256
256
  }, f = (t, i, r = []) => {
257
257
  const l = t.getAliasSymbol()?.getName();
258
- if (l && O.getInstance().hasExposedModel(l))
258
+ if (l && v.getInstance().hasExposedModel(l))
259
259
  return [
260
260
  {
261
261
  role: "ref",
@@ -263,8 +263,8 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
263
263
  optional: !1
264
264
  }
265
265
  ];
266
- const n = $(t) ? t.getTypeArguments()[0] : t;
267
- if (r.some((a) => a === n))
266
+ const n = D(t) ? t.getTypeArguments()[0] : t;
267
+ if (r.some((s) => s === n))
268
268
  return "circular";
269
269
  const o = r.concat(n);
270
270
  if (n.getText() === "void")
@@ -305,9 +305,9 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
305
305
  return [
306
306
  {
307
307
  role: "tuple",
308
- shape: n.getTupleElements().map((a) => ({
308
+ shape: n.getTupleElements().map((s) => ({
309
309
  role: "tuple_entry",
310
- shape: f(a, i, o),
310
+ shape: f(s, i, o),
311
311
  optional: !1
312
312
  })),
313
313
  optional: !1
@@ -321,7 +321,24 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
321
321
  optional: !1
322
322
  }
323
323
  ];
324
- if (n.isObject() && n.getText() === "Buffer")
324
+ const d = n.getSymbol()?.getName(), p = /* @__PURE__ */ new Set([
325
+ "Buffer",
326
+ "Uint8Array",
327
+ "Int8Array",
328
+ "Uint8ClampedArray",
329
+ "Int16Array",
330
+ "Uint16Array",
331
+ "Int32Array",
332
+ "Uint32Array",
333
+ "Float32Array",
334
+ "Float64Array",
335
+ "BigInt64Array",
336
+ "BigUint64Array",
337
+ "ArrayBuffer",
338
+ "SharedArrayBuffer",
339
+ "ReadableStream"
340
+ ]);
341
+ if (n.isObject() && d && p.has(d))
325
342
  return [
326
343
  {
327
344
  role: "buffer",
@@ -329,75 +346,97 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
329
346
  optional: !1
330
347
  }
331
348
  ];
349
+ if (n.isObject() && d === "RegExp")
350
+ return "string";
351
+ if (n.isObject() && d === "Map") {
352
+ const a = n.getTypeArguments()[1];
353
+ return [
354
+ {
355
+ role: "record",
356
+ shape: a ? f(a, i, o) : "unknown",
357
+ optional: !1
358
+ }
359
+ ];
360
+ }
361
+ if (n.isObject() && d === "Set") {
362
+ const a = n.getTypeArguments()[0];
363
+ return [
364
+ {
365
+ role: "array",
366
+ shape: a ? f(a, i, o) : "unknown",
367
+ optional: !1
368
+ }
369
+ ];
370
+ }
332
371
  if (n.isObject() && n.getProperties().length === 0) {
333
- const a = n.getAliasTypeArguments()[1] ?? n.getStringIndexType();
334
- if (a)
372
+ const s = n.getAliasTypeArguments()[1] ?? n.getStringIndexType();
373
+ if (s)
335
374
  return [
336
375
  {
337
376
  role: "record",
338
- shape: f(a, i, o),
377
+ shape: f(s, i, o),
339
378
  optional: !1
340
379
  }
341
380
  ];
342
381
  }
343
382
  if (n.isObject())
344
- return n.getText() === "Date" ? "Date" : n.getProperties().map((a) => {
345
- const u = a.getValueDeclaration() || a.getDeclarations()[0];
346
- if (!u)
383
+ return d === "Date" || n.getText() === "Date" ? "Date" : n.getProperties().map((s) => {
384
+ const a = s.getValueDeclaration() || s.getDeclarations()[0];
385
+ if (!a)
347
386
  return {
348
387
  role: "property",
349
- identifier: a.getName(),
350
- shape: f(a.getTypeAtLocation(i), i, o),
388
+ identifier: s.getName(),
389
+ shape: f(s.getTypeAtLocation(i), i, o),
351
390
  optional: !1
352
391
  };
353
- if (!(u.asKind(e.PropertySignature) || u.asKind(e.PropertyAssignment) || u.asKind(e.ShorthandPropertyAssignment)))
392
+ if (!(a.asKind(e.PropertySignature) || a.asKind(e.PropertyAssignment) || a.asKind(e.ShorthandPropertyAssignment)))
354
393
  return {
355
394
  role: "property",
356
- identifier: a.getName(),
357
- shape: f(a.getTypeAtLocation(i), i, o),
395
+ identifier: s.getName(),
396
+ shape: f(s.getTypeAtLocation(i), i, o),
358
397
  optional: !1
359
398
  };
360
- const d = a.getTypeAtLocation(i).isNullable(), g = f(a.getTypeAtLocation(i), i, o);
399
+ const c = s.getTypeAtLocation(i).isNullable(), y = f(s.getTypeAtLocation(i), i, o);
361
400
  return {
362
401
  role: "property",
363
- identifier: a.getName(),
364
- shape: g,
365
- optional: d
402
+ identifier: s.getName(),
403
+ shape: y,
404
+ optional: c
366
405
  };
367
- }).filter((a) => a.shape !== "undefined");
406
+ }).filter((s) => s.shape !== "undefined");
368
407
  if (n.isUnion()) {
369
- const u = n.getUnionTypes().map((g) => ({
408
+ const a = n.getUnionTypes().map((y) => ({
370
409
  role: "union_entry",
371
- shape: f(g, i, o),
410
+ shape: f(y, i, o),
372
411
  optional: !1
373
412
  })).filter(
374
- (g, h, S) => !S.find((F, x) => F.shape === g.shape && x > h)
375
- ), s = u.some((g) => g.shape === "undefined"), d = u.filter((g) => g.shape !== "undefined");
376
- return d.length === 1 ? d[0].shape : [
413
+ (y, A, T) => !T.find((F, L) => F.shape === y.shape && L > A)
414
+ ), g = a.some((y) => y.shape === "undefined"), c = a.filter((y) => y.shape !== "undefined");
415
+ return c.length === 1 ? c[0].shape : [
377
416
  {
378
417
  role: "union",
379
- shape: d,
380
- optional: s
418
+ shape: c,
419
+ optional: g
381
420
  }
382
421
  ];
383
422
  }
384
423
  if (n.isIntersection())
385
- return n.getIntersectionTypes().map((s) => f(s, i, o)).filter((s) => typeof s != "string").reduce((s, d) => [...s, ...d], []);
386
- const p = i.getSourceFile().getFilePath().split("/").pop();
387
- return m.warn(`[${p}] Unknown type shape node ${t.getText()}`), "unknown_5";
424
+ return n.getIntersectionTypes().map((g) => f(g, i, o)).filter((g) => typeof g != "string").reduce((g, c) => [...g, ...c], []);
425
+ const u = i.getSourceFile().getFilePath().split("/").pop();
426
+ return K.warn(`[${u}] Unknown type shape node ${t.getText()}`), "unknown_5";
388
427
  }, w = (t) => {
389
428
  if (t.isKind(e.Identifier))
390
- return w(c(t));
429
+ return w(h(t));
391
430
  if (t.isKind(e.StringLiteral))
392
431
  return t.getLiteralValue();
393
432
  if (t.isKind(e.ArrayLiteralExpression))
394
433
  return t.forEachChildAsArray().map((r) => w(r));
395
434
  if (t.isKind(e.PropertyAccessExpression))
396
- return w(C(t));
435
+ return w(S(t));
397
436
  if (t.isKind(e.ObjectLiteralExpression))
398
- return _(t);
437
+ return R(t);
399
438
  const i = t.getSourceFile().getFilePath().split("/").pop();
400
- return m.dev(`[${i}] Unknown literal value node ${t.getKindName()}`), "unknown_6";
439
+ return K.dev(`[${i}] Unknown literal value node ${t.getKindName()}`), "unknown_6";
401
440
  }, Q = (t) => {
402
441
  const i = t.getFirstDescendantByKind(e.CallExpression);
403
442
  if (!i) return null;
@@ -405,24 +444,24 @@ const L = /* @__PURE__ */ new WeakMap(), c = (t) => {
405
444
  if (!r) return null;
406
445
  const l = r.getType();
407
446
  return l.isStringLiteral() ? l.getLiteralValue() : null;
408
- }, _ = (t) => t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).map((n) => {
409
- const p = n.getFirstDescendantByKind(e.Identifier).getText(), a = n.getLastChild(), u = c(a), s = w(u);
447
+ }, R = (t) => t.getFirstDescendantByKind(e.SyntaxList).getChildrenOfKind(e.PropertyAssignment).map((n) => {
448
+ const d = n.getFirstDescendantByKind(e.Identifier).getText(), p = n.getLastChild(), u = h(p), s = w(u);
410
449
  return {
411
- identifier: p,
450
+ identifier: d,
412
451
  value: s
413
452
  };
414
453
  }) || [];
415
454
  export {
416
- c as findNodeImplementation,
417
- C as findPropertyAssignmentValueNode,
455
+ h as findNodeImplementation,
456
+ S as findPropertyAssignmentValueNode,
418
457
  f as getProperTypeShape,
419
- y as getRecursiveNodeShape,
458
+ m as getRecursiveNodeShape,
420
459
  z as getShapeOfValidatorLiteral,
421
460
  P as getTypeReferenceShape,
422
461
  V as getValidatorPropertyOptionality,
423
- N as getValidatorPropertyShape,
424
- K as getValidatorPropertyStringValue,
425
- _ as getValuesOfObjectLiteral,
462
+ x as getValidatorPropertyShape,
463
+ N as getValidatorPropertyStringValue,
464
+ R as getValuesOfObjectLiteral,
426
465
  Q as resolveEndpointPath
427
466
  };
428
467
  //# sourceMappingURL=nodeParsers.mjs.map