Marketplace móvil para negocios locales mexicanos. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React Web) - apps/mobile (Expo/React Native) - apps/mcp-server (Claude MCP Server) - apps/whatsapp-service (WhatsApp Business API) - database/ (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
22 lines
623 B
JavaScript
22 lines
623 B
JavaScript
import { parseDef } from "../parseDef.js";
|
|
import { parseAnyDef } from "./any.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: parseAnyDef(refs),
|
|
},
|
|
innerSchema,
|
|
],
|
|
}
|
|
: parseAnyDef(refs);
|
|
};
|