Skip to content

Commit 15bbdbd

Browse files
authored
docs: more explicit description for isPositive/isNegative valida… (typestack#581)
1 parent bca014c commit 15bbdbd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,8 @@ isBoolean(value);
819819
| `@IsEnum(entity: object)` | Checks if the value is an valid enum |
820820
| **Number validation decorators** |
821821
| `@IsDivisibleBy(num: number)` | Checks if the value is a number that's divisible by another. |
822-
| `@IsPositive()` | Checks if the value is a positive number. |
823-
| `@IsNegative()` | Checks if the value is a negative number. |
822+
| `@IsPositive()` | Checks if the value is a positive number greater than zero. |
823+
| `@IsNegative()` | Checks if the value is a negative number smaller than zero. |
824824
| `@Min(min: number)` | Checks if the given number is greater than or equal to given number. |
825825
| `@Max(max: number)` | Checks if the given number is less than or equal to given number. |
826826
| **Date validation decorators** |

src/decorator/number/IsNegative.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { buildMessage, ValidateBy } from "../common/ValidateBy";
44
export const IS_NEGATIVE = "isNegative";
55

66
/**
7-
* Checks if the value is a negative number.
7+
* Checks if the value is a negative number smaller than zero.
88
*/
99
export function isNegative(value: unknown): boolean {
1010
return typeof value === "number" && value < 0;
1111
}
1212

1313
/**
14-
* Checks if the value is a negative number.
14+
* Checks if the value is a negative number smaller than zero.
1515
*/
1616
export function IsNegative(validationOptions?: ValidationOptions): PropertyDecorator {
1717
return ValidateBy(

src/decorator/number/IsPositive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { buildMessage, ValidateBy } from "../common/ValidateBy";
44
export const IS_POSITIVE = "isPositive";
55

66
/**
7-
* Checks if the value is a positive number.
7+
* Checks if the value is a positive number greater than zero.
88
*/
99
export function isPositive(value: unknown): boolean {
1010
return typeof value === "number" && value > 0;
1111
}
1212

1313
/**
14-
* Checks if the value is a positive number.
14+
* Checks if the value is a positive number greater than zero.
1515
*/
1616
export function IsPositive(validationOptions?: ValidationOptions): PropertyDecorator {
1717
return ValidateBy(

0 commit comments

Comments
 (0)