Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/m-sardari/validator

Rq-Rs Validation with support from array of Objects
https://github.com/m-sardari/validator

Last synced: about 1 month ago
JSON representation

Rq-Rs Validation with support from array of Objects

Awesome Lists containing this project

README

        


Nest Logo

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

A progressive Node.js framework for building efficient and scalable server-side applications.



NPM Version
Package License
NPM Downloads
CircleCI
Coverage
Discord
Backers on Open Collective
Sponsors on Open Collective

Support us




# Description

Rq-Rs Validation with support from array of Objects

## install

```bash
$ npm install gadin-validator
```
## usage

### @Validator({ propName, required, type },isArray?)

Checks for a valid value of the given type.

@Validator({ title: 'عنوان', required: true|false, type: 'boolean' })
@Validator({ title: 'عنوان', required: true|false, type: 'date' })
@Validator({ title: 'عنوان', required: true|false, type: 'object' })
@Validator({ title: 'عنوان', required: true|false, type: 'number' })
@Validator({ title: 'عنوان', required: true|false, type: 'any' })
@Validator({ title: 'عنوان', required: true|false, type: 'string[]' })

//If the type value is not entered, the 'string' is considered by default

@Validator({ title: 'عنوان', required: true|false })

//For array of Objects

@Validator({ title: 'عنوان', required: true|false, type: 'number' }, true)

## license

Author: Mohammad Sardari