You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most validation libraries are either hard to use, missing key features, or no longer maintained. It’s tough to find one that lets you reuse rules, supports multiple languages, and still feels easy to work with.
4
+
5
+
Robust Validator was built to solve that. It makes validation simple, reusable, and flexible. You can define your rules once and use them anywhere, and it works great with multiple languages out of the box.
6
+
7
+
If you want a validation library that just works, is easy to read, and stays up to date, Robust Validator is a solid choice.
Copy file name to clipboardExpand all lines: readme.md
+63-8Lines changed: 63 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,15 +26,15 @@ Rule-based data validation in JS. Extendable, function-oriented, i18n-supported
26
26
27
27
[Documentation](https://validator.axe-api.com/)
28
28
29
-
## 💡 Why?
29
+
## Why?
30
30
31
-
Discovering a data validation library that seamlessly combines ease of use, the ability to store validation rules for future use, and robust internationalization (i18n) support is a formidable challenge. While numerous data validation libraries exist, finding one that fulfills all these criteria is often elusive. Some libraries that do meet these requirements are unfortunately no longer actively maintained.
31
+
Most validation libraries are either hard to use, missing key features, or no longer maintained. It’s tough to find one that lets you reuse rules, supports multiple languages, and still feels easy to work with.
32
32
33
-
Robust Validator was born out of the need for a versatile data validation solution that not only simplifies the validation process but also empowers developers with the flexibility to preserve and reuse validation rules. This library aims to bridge the gap by offering a user-friendly experience, ensuring your validation needs are met comprehensively.
33
+
Robust Validator was built to solve that. It makes validation simple, reusable, and flexible. You can define your rules once and use them anywhere, and it works great with multiple languages out of the box.
34
34
35
-
Why choose Robust Validator? It's more than just a data validation tool; it's a commitment to providing a reliable, well-maintained, and feature-rich solution for developers who value simplicity and effectiveness in their projects.
35
+
If you want a validation library that just works, is easy to read, and stays up to date, Robust Validator is a solid choice.
36
36
37
-
## 🤞 Principles
37
+
## Principles
38
38
39
39
I decided on some fundamental rules while building this library:
40
40
@@ -53,7 +53,7 @@ The library can be installed into an existing project:
53
53
$ npm install --save robust-validator
54
54
```
55
55
56
-
## 💪 Usage
56
+
## Usage
57
57
58
58
Using robust-validator is very simple.
59
59
@@ -80,14 +80,69 @@ const result = await validate(data, definition);
80
80
console.log(result);
81
81
```
82
82
83
-
## 🤝 Contributors
83
+
## Nested data validation
84
+
85
+
This feature allows dynamic traversal of nested data structures, supporting complex validation rules for paths like `users.*.addresses.*.city`.
86
+
87
+
It is inspired by Laravel's validation system and works seamlessly with arrays and objects, including deeply nested data.
88
+
89
+
```ts
90
+
import { validate, setLocales, en } from"robust-validator";
0 commit comments