Skip to content

Commit

Permalink
Readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
beedyboy committed May 31, 2020
1 parent 660aeee commit 089724a
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,10 @@ MIT - See LICENSE.md
```
$ npm install -g data-hero
```

Then

```js
var Validator = require( 'data-hero.js' );
```



## Validate a string

```js
var is = require( 'validator.js' ).Assert;
var validator = require( 'validator.js' ).validator();

validator.validate( 'foo', is.ofLength( { min: 4 } ) );
validator.validate( 'foo', [ is.ofLength( { min: 4 } ), is.email() ] );
```

will return `true` if validation passes, a `Violation`'s array otherwise.



## Validate an object

```ts
Expand Down Expand Up @@ -76,7 +59,5 @@ const data = {
```

will return `true` if validation passes, `{ email: [ Violation ], firstname: [ Violation ] }` in this case.

## Validation groups



0 comments on commit 089724a

Please sign in to comment.