Skip to content

Commit

Permalink
Allow prepended zeroes in toInt()
Browse files Browse the repository at this point in the history
  • Loading branch information
theartoflogic committed May 27, 2016
1 parent 0882fa4 commit 4e8827b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/isInt.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assertString from './util/assertString';

const int = /^(?:[-+]?(?:0|[1-9][0-9]*))$/;
const int = /^[-+]?[0-9]+$/;

export default function isInt(str, options) {
assertString(str);
Expand Down
4 changes: 2 additions & 2 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,11 @@ describe('Validators', function () {
'123',
'-0',
'+1',
],
invalid: [
'01',
'-01',
'000',
],
invalid: [
'100e10',
'123.123',
' ',
Expand Down

0 comments on commit 4e8827b

Please sign in to comment.