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
- Host: GitHub
- URL: https://github.com/charconstpointer/v
- Owner: charconstpointer
- Created: 2020-12-11T20:16:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-11T20:22:02.000Z (about 5 years ago)
- Last Synced: 2024-12-27T09:29:53.915Z (12 months ago)
- Topics: fluent, fluent-api, fluentvalidation, typescript, validate, validation
- Language: TypeScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
```