@anonymous961/imailbox
v1.0.3
Published
Common folder for imailbox
Downloads
7
Readme
@anonymous961/imailbox
This module provides type definitions for various input schemas used in the iMailbox application. These definitions are created using the zod library, ensuring robust input validation and type safety.
Available Type Definitions
signupInput
- Schema for validating the input of the sign-up form.
- Fields:
email: A valid email address (string).password: A password with a minimum length of 6 characters (string).name: An optional name field (string).
signinInput
- Schema for validating the input of the sign-in form.
- Fields:
email: A valid email address (string).password: A password with a minimum length of 6 characters (string).
Installation
To install the module, use npm or yarn:
npm install @anonymous961/imailboxor
yarn add @anonymous961/imailboxUsage
Import the required type definitions and use them in your project:
import { signupInput, signinInput } from "@anonymous961/imailbox";
// Example usage:
const signupData = {
email: "[email protected]",
password: "password123",
name: "John Doe",
};
const validationResult = signupInput.safeParse(signupData);
if (!validationResult.success) {
console.error(validationResult.error);
} else {
console.log("Signup data is valid:", validationResult.data);
}This ensures that your input data adheres to the defined schemas, improving reliability and type safety in your application.
