Package Exports
- zod-ir
Readme
Zod Iranian Utils
A lightweight, type-safe Zod extension for validating Iranian specific data. Compatible with React Hook Form, Next.js, and Node.js backends.
Features ✨
- ✅ National Code (Code Melli): Validates using the official checksum algorithm.
- 💳 Bank Card: Validates 16-digit card numbers using the Luhn algorithm.
- 📱 Mobile Number: Validates Iranian mobile formats (
09xx,+989xx,9xx). - 🌍 Bilingual: Built-in error messages in Persian (Farsi) and English.
- 🌲 Tree-shakable: Import only what you need.
- 🛡️ Zero Dependency: (Only requires
zodas a peer dependency).
Installation 📦
You need to install zod and zod-ir:
npm install zod zod-ir
# or
yarn add zod zod-ir
# or
pnpm add zod zod-ir