@supalive/codegen 1.22.1 → 1.22.2
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/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-Ckf5xah9.js → src-DCmLjz97.js} +7 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as emit, c as loadSchemaEnums, i as resolveConfig, n as generateToDisk, o as extractClient, r as readEntryConfig, s as SchemaEnumRegistry, t as generate } from "./src-
|
|
1
|
+
import { a as emit, c as loadSchemaEnums, i as resolveConfig, n as generateToDisk, o as extractClient, r as readEntryConfig, s as SchemaEnumRegistry, t as generate } from "./src-DCmLjz97.js";
|
|
2
2
|
export { SchemaEnumRegistry, emit, extractClient, generate, generateToDisk, loadSchemaEnums, readEntryConfig, resolveConfig };
|
|
@@ -358,7 +358,7 @@ function scanObjectSchema(schema) {
|
|
|
358
358
|
}
|
|
359
359
|
return map;
|
|
360
360
|
}
|
|
361
|
-
function topLevelZodMethods(node) {
|
|
361
|
+
function topLevelZodMethods(node, depth = 0) {
|
|
362
362
|
const methods = /* @__PURE__ */ new Set();
|
|
363
363
|
let cur = node;
|
|
364
364
|
while (cur && Node.isCallExpression(cur)) {
|
|
@@ -368,8 +368,14 @@ function topLevelZodMethods(node) {
|
|
|
368
368
|
cur = expr.getExpression();
|
|
369
369
|
} else break;
|
|
370
370
|
}
|
|
371
|
+
if (cur && Node.isIdentifier(cur) && depth < MAX_ALIAS_DEPTH) {
|
|
372
|
+
const init = resolveIdentifierInit(cur);
|
|
373
|
+
if (init) for (const m of topLevelZodMethods(init, depth + 1)) methods.add(m);
|
|
374
|
+
}
|
|
371
375
|
return methods;
|
|
372
376
|
}
|
|
377
|
+
/** Guards against a cyclic alias (`const A = B; const B = A;`) looping forever. */
|
|
378
|
+
const MAX_ALIAS_DEPTH = 8;
|
|
373
379
|
function topLevelZodDescription(node) {
|
|
374
380
|
let cur = node;
|
|
375
381
|
while (cur && Node.isCallExpression(cur)) {
|