zod-ir 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
# Zod Iranian Utils
|
|
1
|
+
# Zod Iranian Utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- 📱 **Mobile Number** validation (supports +98, 09xx, 9xx).
|
|
10
|
-
- 🌍 **Bilingual Error Messages** (Persian & English).
|
|
11
|
-
- 🌲 **Tree-shakable** & Type-safe.
|
|
9
|
+
**A lightweight, type-safe Zod extension for validating Iranian specific data.**
|
|
10
|
+
Compatible with **React Hook Form**, **Next.js**, and Node.js backends.
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
## Features ✨
|
|
15
|
+
|
|
16
|
+
- ✅ **National Code (Code Melli):** Validates using the official checksum algorithm.
|
|
17
|
+
- 💳 **Bank Card:** Validates 16-digit card numbers using the Luhn algorithm.
|
|
18
|
+
- 📱 **Mobile Number:** Validates Iranian mobile formats (`09xx`, `+989xx`, `9xx`).
|
|
19
|
+
- 🌍 **Bilingual:** Built-in error messages in **Persian (Farsi)** and **English**.
|
|
20
|
+
- 🌲 **Tree-shakable:** Import only what you need.
|
|
21
|
+
- 🛡️ **Zero Dependency:** (Only requires `zod` as a peer dependency).
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Installation 📦
|
|
26
|
+
|
|
27
|
+
You need to install `zod` and `zod-ir`:
|
|
14
28
|
|
|
15
29
|
```bash
|
|
16
|
-
npm install zod zod-
|
|
30
|
+
npm install zod zod-ir
|
|
31
|
+
# or
|
|
32
|
+
yarn add zod zod-ir
|
|
17
33
|
# or
|
|
18
|
-
|
|
34
|
+
pnpm add zod zod-ir
|