zod arg parse 작업 진행

This commit is contained in:
2026-01-15 15:01:58 +00:00
parent 24fbace987
commit f12d3cf4fe
4 changed files with 27 additions and 18 deletions
@@ -0,0 +1,6 @@
import type { ZodType } from 'zod';
export const parseArgsWithSchema = <T>(schema: ZodType<T>, raw: unknown): T | null => {
const result = schema.safeParse(raw);
return result.success ? result.data : null;
};