@devabdultech/hn-mcp-server
Version:
MCP Server for using the Hacker News API
16 lines • 470 B
JavaScript
import { z } from "zod";
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