1.0.5 • Published 5 months ago

cp-zod-schema v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

CP ZOD SCHEMA

Installation

To install the package, using npm:

npm i cp-zod-schema

Usage

Import the Schema

import { userSchema, validateUser } from 'cp-zod-schema';

Then use the schema like so:

import { userSchema } from 'cp-zod-schema';

const data = {
  name: 'John Doe',
  mobile: '1234567890',
  email: 'john@example.com',
};

const result = userSchema.safeParse(data);

if (result.success) {
  console.log('Valid data:', result.data);
} else {
  console.log('Validation failed:', result.error.errors);
}
1.0.5

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago