@capgo/cli
Version:
A CLI to upload to capgo servers
13 lines (12 loc) • 565 B
TypeScript
import type { ZodSchema } from 'zod';
/**
* Validate options using a Zod schema with CLI-friendly error messages.
* Preserves the existing silent/log.error pattern used across all commands.
*
* @param schema - The Zod schema to validate against
* @param data - The data to validate
* @param silent - If true, suppresses log output (for SDK usage)
* @returns The parsed and validated data
* @throws Error with a descriptive message if validation fails
*/
export declare function validateOptions<T>(schema: ZodSchema<T>, data: unknown, silent?: boolean): T;