Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Sep 21, 2023
1 parent d0739fd commit aa8ba80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export const integer: Decoder<number> = number.refine(
*/
export const positiveNumber: Decoder<number> = number
.refine((n) => n >= 0, 'Number must be positive')
.transform(Math.abs);
.transform(Math.abs); // Just here to handle the -0 case

/**
* Accepts only non-negative (zero or positive) finite whole numbers.
*/
export const positiveInteger: Decoder<number> = integer
.refine((n) => n >= 0, 'Number must be positive')
.transform(Math.abs);
.transform(Math.abs); // Just here to handle the -0 case

0 comments on commit aa8ba80

Please sign in to comment.