Zod-based validator implementation.

Provides type-safe validation using Zod schemas with Result pattern.

import { z } from 'zod';
import { ZodValidator } from '@stratix/validation';

const userSchema = z.object({
name: z.string().min(2),
email: z.string().email(),
age: z.number().int().positive()
});

const validator = ZodValidator.create(userSchema);
const result = validator.validate({ name: 'John', email: 'john@example.com', age: 30 });

if (result.success) {
console.log(result.data);
} else {
console.error(result.errors);
}

Type Parameters

  • T

Implements

Constructors

Methods