forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PMM-12971 fix validation and rds parameter
- Loading branch information
1 parent
f40197c
commit f116cb3
Showing
3 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { INT_32 } from '../../core'; | ||
|
||
import { lessThan, greaterThan } from '.'; | ||
export const int32 = (value: string) => { | ||
const num = parseFloat(value); | ||
if (Number.isFinite(num) && Number.isInteger(num) && num > INT_32.min - 1 && num < INT_32.max + 1) { | ||
return undefined; | ||
} | ||
|
||
export const int32 = [greaterThan(INT_32.min - 1), lessThan(INT_32.max + 1)]; | ||
return `Must be an Integer number`; | ||
}; |