Skip to content

Commit ef5c0fe

Browse files
author
Alok Kumar
committed
RV [CLEANUP-CI] -> added CI/CD & cleanup the code
1 parent 14f7498 commit ef5c0fe

3 files changed

Lines changed: 64 additions & 241 deletions

File tree

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
A powerful and flexible request validation library for Node.js applications, built with TypeScript. This library provides a comprehensive set of validation rules and supports both synchronous and asynchronous validation.
44

5+
[![npm version](https://img.shields.io/npm/v/@th3hero/request-validator.svg)](https://www.npmjs.com/package/@th3hero/request-validator)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7+
58
## Table of Contents
69
- [Features](#features)
710
- [Installation](#installation)
@@ -122,6 +125,9 @@ app.post('/upload', async (req: Request, res) => {
122125
| `required` | Field must be present and not empty | `username: 'required'` | "username is required" |
123126
| `nullable` | Field can be null or undefined | `middle_name: 'nullable'` | - |
124127
| `not-empty` | Field cannot be empty | `description: 'not-empty'` | "description cannot be empty" |
128+
| `numeric` | Field must be a number | `age: 'numeric'` | "age must be a number" |
129+
| `confirmed` | Field must have a matching confirmation field | `password: 'confirmed'` | "password must be confirmed" |
130+
| `digits:length` | Field must contain exactly the specified number of digits | `phone: 'digits:10'` | "phone must be exactly 10 digits" |
125131

126132
### String Rules
127133

@@ -152,6 +158,7 @@ app.post('/upload', async (req: Request, res) => {
152158
|------|-------------|---------|---------------|
153159
| `file` | Must be a file upload | `profile_picture: 'file'` | "profile_picture is required" |
154160
| `mimetype:types` | Valid MIME types | `avatar: 'mimetype:image/jpeg,image/png'` | "Invalid file format for avatar. Supported media types are image/jpeg, image/png" |
161+
| `max_size:size` | File size must not exceed the specified size | `avatar: 'max_size:2048'` | "avatar file size must not exceed 2048 bytes" |
155162

156163
### Database Rules
157164

@@ -431,4 +438,8 @@ npm run test:coverage
431438

432439
# Run tests in watch mode
433440
npm run test:watch
434-
```
441+
```
442+
443+
## License
444+
445+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)