Files
planilla/mcp/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
josedario87 b5e40cf4ac
All checks were successful
build-and-push / build (push) Successful in 17s
build-and-push / deploy (push) Successful in 19s
se supone que mcp server up
2025-05-02 19:33:50 -06:00

21 lines
553 B
JavaScript

import { parseDef } from "../parseDef.js";
export const parseOptionalDef = (def, refs) => {
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
return parseDef(def.innerType._def, refs);
}
const innerSchema = parseDef(def.innerType._def, {
...refs,
currentPath: [...refs.currentPath, "anyOf", "1"],
});
return innerSchema
? {
anyOf: [
{
not: {},
},
innerSchema,
],
}
: {};
};