From b3f12376a97b194d0e0c7dafabdf54c56c60bc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Adem=20I=C5=9EIKLI?= Date: Sun, 24 Mar 2024 12:35:23 +0100 Subject: [PATCH] Fixed the documentation --- docs/rules.md | 20 ++++++++++---------- src/converters/confirmed.ts | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/rules.md b/docs/rules.md index 7dbe4e2..6fecf05 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -476,7 +476,7 @@ isBoolean(true); ## `confirmed` -The field under validation must have a matching field of `foo_confirmation`. For example, if the field under validation is `password`, a matching `password_confirmation` field must be present in the input. +The field under validation must have a matching field of `foo_confirmed`. For example, if the field under validation is `password`, a matching `password_confirmed` field must be present in the input. Let's assume that the value of the `password` field is `123456`. If you use the `confirmed` definition on the `password` field's rules, the truth table would look like the following example: @@ -502,15 +502,15 @@ isConfirmed("your-data"); ::: -| Field | Value | Is valid? | -| ----------------------- | ----------- | --------- | -| `password_confirmation` | `123456` | 🟢 | -| `password_confirmation` | `654321` | 🔴 | -| `password_confirmation` | `null` | 🔴 | -| `password_confirmation` | `undefined` | 🔴 | -| `password_confirmation` | `true` | 🔴 | -| `password_confirmation` | `false` | 🔴 | -| `password_confirmation` | `{}` | 🔴 | +| Field | Value | Is valid? | +| -------------------- | ----------- | --------- | +| `password_confirmed` | `123456` | 🟢 | +| `password_confirmed` | `654321` | 🔴 | +| `password_confirmed` | `null` | 🔴 | +| `password_confirmed` | `undefined` | 🔴 | +| `password_confirmed` | `true` | 🔴 | +| `password_confirmed` | `false` | 🔴 | +| `password_confirmed` | `{}` | 🔴 | ## `date:format` diff --git a/src/converters/confirmed.ts b/src/converters/confirmed.ts index 0e01574..718ae56 100644 --- a/src/converters/confirmed.ts +++ b/src/converters/confirmed.ts @@ -1,7 +1,7 @@ /** - * The field under validation must have a matching field of foo_confirmation. + * The field under validation must have a matching field of foo_confirmed. * For example, if the field under validation is password, a matching - * password_confirmation field must be present in the input. + * password_confirmed field must be present in the input. * * @example * import { confirmed } from "robust-validator"