# complete-validator

> JavaScript validation inspired by Laravel validation

Latest version **1.0.4** (published 2019-03-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install complete-validator
pnpm add complete-validator
yarn add complete-validator
bun add complete-validator
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-03-28 |
| First published | 2019-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 66 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | lulliezy |
| Keywords | validation, validate, browser, browser-validation, laravel, laravel-validation, schema, complete-validator |

## Links

- npm: https://www.npmjs.com/package/complete-validator
- npm.io page: https://npm.io/package/complete-validator

## Dependencies (1)

- [moment-timezone](https://npm.io/package/moment-timezone.md) ^0.5.23

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2019-03-28
- 1.0.3 — 2019-03-26
- 1.0.2 — 2019-03-26
- 1.0.1 — 2019-03-26
- 1.0.0 — 2019-03-26
- 0.1.1 — 2019-02-05
- 0.1.0 — 2019-02-05
- 0.0.3 — 2019-01-24
- 0.0.2 — 2019-01-21
- 0.0.1 — 2019-01-17

## README

# complete-validator

* [Installation](#installation)
* [Usage](#usage)
* [Api](#api)
* [Validation Rules](#validation-rules)

## Installation

``` sh
$ npm install complete-validator 
```

## Usage

``` js
const validator = require('complete-validator');

const results = validator(object, schema, customMessages, arrayValuesOrMomentOrDateArgument);
```

The validator function returns an object with `value` and `errors` properties.

* **value** - contains a copy of the original object with its values optimised according to their types
* **error** - contains array of validation errors if any or `null` if non.

## API

For now, refer to [Laravel validation docs](https://laravel.com/docs/5.7/validation#available-validation-rules), validation API will be updated in the next release.

An extra feature added is `clean` which works strings only. Arguments can be either or both of `spaces` and `case`.
* **spaces** - Removes spaces in the value, its arguments can be `begin` which removes spaces at beginning of value, `end` which removes spaces at end of value, `between_single` which replaces multiple spaces and/or new lines and tabs with a single space, `between_none` which removes spaces in between and `both` which trims value on both ends.
* **case** - Updates the value according to case provided which can either be `upper`, `lower` or `title`.

Sub arguments are provided in dot format i.e.
```js
'spaces.both.between_single,case.title'
```

**NB: Please bear with me, documentation coming up next**

## Licence
**MIT**

---
_Source: https://npm.io/package/complete-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
