UNPKG

@microagents/server-hackernews

Version:

MCP server for Hacker News API integration

19 lines 517 B
import { z } from "zod"; /** * Validate input against a Zod schema */ export function validateInput(schema, input) { try { return schema.parse(input); } catch (error) { if (error instanceof z.ZodError) { const issues = error.issues .map((issue) => `${issue.path.join(".")}: ${issue.message}`) .join(", "); throw new Error(`Validation error: ${issues}`); } throw error; } } //# sourceMappingURL=validation.js.map