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

https://github.com/charconstpointer/v


https://github.com/charconstpointer/v

fluent fluent-api fluentvalidation typescript validate validation

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# v
# 🦋 Fluent validator

```
const foo:string = "foo bar baz";
const v = new Validator();
const result = v
.addStep(s => s.length > 5, "length should be greater than 5")
.addStep(s => s.includes("foo"), "should contain 'foo'")
.validate(foo);

const isValid = result.ok;
result.errors.map(console.log);
```