Skip to content

Commit

Permalink
Fix positiveInt validation when changing routes
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits committed Apr 2, 2024
1 parent a1c35fc commit 332364b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/validate/methods/positiveInt.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const positiveInt = (value: string) => {
if (value.charAt(0) === "-") {
if (value.toString().charAt(0) === "-") {
return "Expected a positive number or zero.";
} else if (!value.match(/^[0-9]*$/g)) {
} else if (!value.toString().match(/^[0-9]*$/g)) {
return "Expected a whole number.";
}

Expand Down

0 comments on commit 332364b

Please sign in to comment.