Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,236 changes: 678 additions & 558 deletions demo/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"@types/react-syntax-highlighter": "^15.5.11",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react": "^4.6.0",
"eslint": "^8.55.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.2.2",
"vite": "^5.4.14"
"vite": "^7.0.4"
}
}
24 changes: 15 additions & 9 deletions docs/.vitepress/cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
{
"hash": "bfe1ecba",
"hash": "bb37bddd",
"configHash": "2fa44bc9",
"lockfileHash": "0d34f974",
"browserHash": "8d1b5fb5",
"lockfileHash": "4c538c6c",
"browserHash": "f1603d0d",
"optimized": {
"vue": {
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "332bface",
"fileHash": "23a543ee",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../node_modules/@vue/devtools-api/dist/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "90b167cf",
"fileHash": "32e47d13",
"needsInterop": false
},
"vitepress > @vueuse/core": {
"src": "../../../node_modules/@vueuse/core/index.mjs",
"file": "vitepress___@vueuse_core.js",
"fileHash": "36a42d21",
"fileHash": "2147df0c",
"needsInterop": false
},
"vitepress > @vueuse/integrations/useFocusTrap": {
"src": "../../../node_modules/@vueuse/integrations/useFocusTrap.mjs",
"file": "vitepress___@vueuse_integrations_useFocusTrap.js",
"fileHash": "9055373c",
"fileHash": "707bdc70",
"needsInterop": false
},
"vitepress > mark.js/src/vanilla.js": {
"src": "../../../node_modules/mark.js/src/vanilla.js",
"file": "vitepress___mark__js_src_vanilla__js.js",
"fileHash": "dd1672a4",
"fileHash": "2f20afac",
"needsInterop": false
},
"vitepress > minisearch": {
"src": "../../../node_modules/minisearch/dist/es/index.js",
"file": "vitepress___minisearch.js",
"fileHash": "cddffe65",
"fileHash": "50b0d357",
"needsInterop": false
},
"vanilla-cookieconsent": {
"src": "../../../node_modules/vanilla-cookieconsent/dist/cookieconsent.esm.js",
"file": "vanilla-cookieconsent.js",
"fileHash": "e64a112a",
"needsInterop": false
}
},
Expand Down
13 changes: 9 additions & 4 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,34 @@ export default defineConfig({
],

footer: {
message: "Released under the MIT License.",
message:
'Released under the MIT License. | <a href="/privacy-policy">Privacy Policy</a> | <a href="/cookie-policy">Cookie Policy</a> | <a style="cursor: pointer" data-cc="show-preferencesModal">Cookie preferences</a>',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using inline styles is generally discouraged for maintainability. It's better to keep styles in CSS files.

You could move the cursor: pointer style to a custom CSS file, for example docs/.vitepress/theme/custom.css, which seems to be already set up.

Example for custom.css:

[data-cc="show-preferencesModal"] {
  cursor: pointer;
}
        'Released under the MIT License. | <a href="/privacy-policy">Privacy Policy</a> | <a href="/cookie-policy">Cookie Policy</a> | <a data-cc="show-preferencesModal">Cookie preferences</a>',

copyright: "Copyright © 2020-present",
},

search: { provider: "local" },
},

head: [
["link", { rel: "stylesheet", href: "/cookieconsent.css" }],
["script", { defer: "", src: "/init.js" }],
[
"script",
{
src: "https://www.googletagmanager.com/gtag/js?id=G-67G9G0VBCC",
type: "text/plain",
"data-category": "analytics",
async: "",
"data-src": "https://www.googletagmanager.com/gtag/js?id=G-67G9G0VBCC",
},
],
[
"script",
{},
{ type: "text/plain", "data-category": "analytics" },
`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-67G9G0VBCC');
gtag('config', 'G-67G9G0VBCC', { anonymize_ip: true });
`,
],
],
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { observeCodeBlocks } from "./observe-code-blocks";

export default {
...DefaultTheme,

enhanceApp({ router }) {
if (typeof window !== "undefined") {
onMounted(() => {
Expand Down
70 changes: 70 additions & 0 deletions docs/cookie-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
sidebar: false
editLink: false
outline: false
prev: false
next: false
---

# Cookie Policy

_Last updated: July 12, 2025_

This website uses cookies to enhance your browsing experience and to collect anonymous analytics data. This policy explains what cookies are, which ones we use, and how you can manage your preferences.

## 1. What are cookies?

Cookies are small text files stored on your device when you visit a website. They allow websites to remember your actions and preferences (such as language or session settings) over a period of time.

Cookies can be:

- **First-party cookies** – set by the website you are visiting
- **Third-party cookies** – set by an external provider (like Google Analytics)

They can also be:

- **Session cookies** – deleted when you close your browser
- **Persistent cookies** – stored for a defined period

## 2. How we use cookies

This site uses only the following types of cookies:

### Strictly necessary cookies

These cookies are required for basic functionality, such as remembering your cookie preferences. They do not track you or store any personally identifiable information.

| Name | Domain | Expiration | Description |
| --------- | --------------------- | ---------- | ---------------------------------- |
| cc_cookie | validator.axe-api.com | 6 months | Remembers your cookie preferences. |

### Performance and analytics cookies

These cookies help us understand how visitors use the site so we can improve it. All data collected is anonymized. These cookies are set **only if you accept analytics cookies** via the cookie banner.

| Name | Domain | Expiration | Description |
| ------ | ---------- | ---------- | ---------------------------------------------------------------------------- |
| ^\_ga | google.com | 2 years | Used to distinguish users by assigning a unique client ID. |
| ^_ga_ | google.com | 2 years | Used by Google Analytics 4 to persist session state for a specific property. |
| ^\_gid | google.com | 24 hours | Used to distinguish users and track user behavior for 24 hours. |
| ^\_gat | google.com | 1 minute | Used to throttle request rate to Google Analytics servers. |

All Google Analytics cookies are configured to **anonymize IP addresses**.

For more information, see [Google’s cookie usage documentation](https://developers.google.com/analytics/devguides/collection/gtagjs/cookie-usage).

## 3. How to manage your preferences

You can change or withdraw your cookie consent at any time by clicking the **“Cookie preferences”** link in the footer of the site.

You can also delete or block cookies via your browser settings. For guidance on how to do this, visit [www.aboutcookies.org](https://www.aboutcookies.org/).

Please note that blocking certain cookies may affect the functionality of the site.

## 4. Changes to this policy

We may update this Cookie Policy from time to time. Changes will be posted on this page with an updated revision date.

---

If you have any questions about our use of cookies, feel free to contact us at [[email protected]](mailto:[email protected]).
73 changes: 14 additions & 59 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
footer: true
---

# Getting started

## Installation
Expand All @@ -21,11 +25,7 @@ import { validate, setLocales, en } from "robust-validator";

setLocales(en);

const data = {
email: "not-a-valid-email",
name: "John",
surname: "Doe",
};
const data = { email: "not-a-valid-email", name: "John", surname: "Doe" };

const definition = {
email: "required|email",
Expand All @@ -50,11 +50,7 @@ import {

setLocales(en);

const data = {
email: "not-a-valid-email",
name: "John",
surname: "Doe",
};
const data = { email: "not-a-valid-email", name: "John", surname: "Doe" };

const definition = {
email: [required(), email()],
Expand All @@ -74,18 +70,9 @@ By the example, you would get the following response:
{
"isValid": false,
"isInvalid": true,
"fields": {
"email": false,
"name": true,
"surname": true
},
"fields": { "email": false, "name": true, "surname": true },
"errors": {
"email": [
{
"rule": "required",
"message": "The field is required."
}
]
"email": [{ "rule": "required", "message": "The field is required." }]
}
}
```
Expand All @@ -104,31 +91,10 @@ setLocales(en);
const data = {
secret: "some secret",
users: [
{
addresses: [
{
city: "New York",
},
{
city: "Istanbul",
},
],
},
{
addresses: [
{
city: "New York",
},
{
street: "Wall Street",
},
],
},
{ addresses: [{ city: "New York" }, { city: "Istanbul" }] },
{ addresses: [{ city: "New York" }, { street: "Wall Street" }] },
],
permissons: {
read: true,
write: true,
},
permissons: { read: true, write: true },
};

const definition = {
Expand All @@ -155,23 +121,12 @@ And this is the content of the `result` variable:
"permissons.delete": false
},
"errors": {
"secret": [
{
"rule": "min",
"message": "The field must be at least 100."
}
],
"secret": [{ "rule": "min", "message": "The field must be at least 100." }],
"users.1.addresses.1.city": [
{
"rule": "required",
"message": "The field is required."
}
{ "rule": "required", "message": "The field is required." }
],
"permissons.delete": [
{
"rule": "required",
"message": "The field is required."
}
{ "rule": "required", "message": "The field is required." }
]
}
}
Expand Down
14 changes: 10 additions & 4 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"docs:preview": "vitepress preview"
},
"dependencies": {
"sitemap-ts": "^1.6.1"
"sitemap-ts": "^1.6.1",
"vanilla-cookieconsent": "^3.1.0"
},
"devDependencies": {
"sass": "^1.89.2",
Expand Down
Loading