stitchkit 0.15.0 → 0.15.1
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
CHANGED
|
@@ -159,7 +159,25 @@ function hasChecks(schema) {
|
|
|
159
159
|
if (!(schema instanceof z2.ZodType))
|
|
160
160
|
return false;
|
|
161
161
|
const def = schema.def;
|
|
162
|
-
|
|
162
|
+
if (isRecord(def) && Array.isArray(def.checks) && def.checks.length > 0)
|
|
163
|
+
return true;
|
|
164
|
+
if (schema instanceof z2.ZodOptional || schema instanceof z2.ZodNullable || schema instanceof z2.ZodDefault) {
|
|
165
|
+
return hasChecks(schema.unwrap());
|
|
166
|
+
}
|
|
167
|
+
if (schema instanceof z2.ZodPipe)
|
|
168
|
+
return hasChecks(schema.def.in) || hasChecks(schema.def.out);
|
|
169
|
+
if (schema instanceof z2.ZodObject)
|
|
170
|
+
return Object.values(schema.shape).some(hasChecks);
|
|
171
|
+
if (schema instanceof z2.ZodArray)
|
|
172
|
+
return hasChecks(schema.element);
|
|
173
|
+
if (schema instanceof z2.ZodUnion)
|
|
174
|
+
return schema.def.options.some(hasChecks);
|
|
175
|
+
if (schema instanceof z2.ZodRecord)
|
|
176
|
+
return hasChecks(schema.valueType);
|
|
177
|
+
if (schema instanceof z2.ZodIntersection) {
|
|
178
|
+
return hasChecks(schema.def.left) || hasChecks(schema.def.right);
|
|
179
|
+
}
|
|
180
|
+
return false;
|
|
163
181
|
}
|
|
164
182
|
function normalizedJson(schema) {
|
|
165
183
|
if (!(schema instanceof z2.ZodType))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/tools/flatten.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,CAAC,CAAC,qBAAqB,GAC7B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CA6C5B;
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/tools/flatten.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,CAAC,CAAC,qBAAqB,GAC7B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CA6C5B;AAmID;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAkDpE"}
|
package/dist/tools.js
CHANGED
package/package.json
CHANGED