@sudheer0071/validations
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Zod inference and validation package

A collections of zod schemas for validating input data in js/ts applications it contains the validations for following schemas:

1.signupSchema 2.signinSchema 3.createBlogSchema 4.updateBlogSchema

This package is created by using the zod infer in typerscript, which allows us to valid with same varaibles/constants in frontend and backend.

Installation

npm install @sudheer0071/validations

Usage

By using signupInput in frontend and singupSchema in backend

import { signupSchema, signupInput } from '@sudheer0071/validations';

const data: signupInput = {
  email: 'example@example.com',
  password: 'password',
  name: 'John Doe'
};

const result = signupSchema.parse(data);

By using signinInput in frontend and singinSchema in backend

import { signupSchema, signupInput } from '@sudheer0071/validations';

const data: signupInput = {
  email: 'example@example.com',
  password: 'password',
  name: 'John Doe'
};

const result = signupSchema.parse(data);

By using createblogInput in frontend and createBlogSchema in backend

import { signupSchema, signupInput } from '@sudheer0071/validations';

const data: signupInput = {
  email: 'example@example.com',
  password: 'password',
  name: 'John Doe'
};

const result = signupSchema.parse(data);

By using updateblogInput in frontend and updateBlogSchema in backend

import { signupSchema, signupInput } from '@sudheer0071/validations';

const data: signupInput = {
  email: 'example@example.com',
  password: 'password',
  name: 'John Doe'
};

const result = signupSchema.parse(data);

License

This package is licensed under the MIT License. See the LICENSE file for details.

My github

Readme

Keywords

none

Package Sidebar

Install

npm i @sudheer0071/validations

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

16.6 kB

Total Files

5

Last publish

Collaborators

  • sudheer0071