-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(isPort): Invalid leading zeros (#2208)
- Loading branch information
1 parent
edb6b1c
commit b34a335
Showing
3 changed files
with
3 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import isInt from './isInt'; | ||
|
||
export default function isPort(str) { | ||
return isInt(str, { min: 0, max: 65535 }); | ||
return isInt(str, { allow_leading_zeroes: false, min: 0, max: 65535 }); | ||
} |
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 |
---|---|---|
|
@@ -2892,6 +2892,7 @@ describe('Validators', () => { | |
'', | ||
'-1', | ||
'65536', | ||
'0080', | ||
], | ||
}); | ||
}); | ||
|