Skip to content

Commit

Permalink
Fixed the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ozziest committed Mar 24, 2024
1 parent fcb7392 commit b3f1237
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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`

Expand Down
4 changes: 2 additions & 2 deletions src/converters/confirmed.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit b3f1237

Please sign in to comment.