@kirha/planner 0.1.4 → 0.1.5
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/index.js +17 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20853,13 +20853,27 @@ function getSchemaAtPath(schema, path2) {
|
|
|
20853
20853
|
if (!(unwrapped instanceof exports_external.ZodObject)) {
|
|
20854
20854
|
return;
|
|
20855
20855
|
}
|
|
20856
|
-
const
|
|
20857
|
-
const childSchema = shape[segment];
|
|
20856
|
+
const childSchema = getObjectChildSchema(unwrapped, segment);
|
|
20858
20857
|
if (!childSchema) {
|
|
20859
20858
|
return;
|
|
20860
20859
|
}
|
|
20861
20860
|
return getSchemaAtPath(childSchema, remainingPath);
|
|
20862
20861
|
}
|
|
20862
|
+
function getObjectChildSchema(schema, segment) {
|
|
20863
|
+
const shape = schema.shape;
|
|
20864
|
+
const direct = shape[segment];
|
|
20865
|
+
if (direct) {
|
|
20866
|
+
return direct;
|
|
20867
|
+
}
|
|
20868
|
+
const catchall = schema.def.catchall;
|
|
20869
|
+
if (!isUsableCatchall(catchall)) {
|
|
20870
|
+
return;
|
|
20871
|
+
}
|
|
20872
|
+
return catchall;
|
|
20873
|
+
}
|
|
20874
|
+
function isUsableCatchall(schema) {
|
|
20875
|
+
return Boolean(schema && !(schema instanceof exports_external.ZodUnknown || schema instanceof exports_external.ZodAny || schema instanceof exports_external.ZodNever));
|
|
20876
|
+
}
|
|
20863
20877
|
function unwrapSchema(schema) {
|
|
20864
20878
|
if (schema instanceof exports_external.ZodOptional || schema instanceof exports_external.ZodDefault || schema instanceof exports_external.ZodNullable) {
|
|
20865
20879
|
return unwrapSchema(schema.def.innerType);
|
|
@@ -20924,6 +20938,7 @@ function isOptionalField(schema) {
|
|
|
20924
20938
|
}
|
|
20925
20939
|
var KNOWN_ZOD_TYPES = [
|
|
20926
20940
|
[exports_external.ZodAny, "any"],
|
|
20941
|
+
[exports_external.ZodUnknown, "any"],
|
|
20927
20942
|
[exports_external.ZodString, "string"],
|
|
20928
20943
|
[exports_external.ZodNumber, "number"],
|
|
20929
20944
|
[exports_external.ZodBoolean, "boolean"],
|