File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,15 @@ import { getType, isString } from './common.js';
1010
1111/* constants */
1212const BASE = 10 ;
13- const INT = '(?: 0|[1-9]\\d*) ' ;
14- const ALPHA_NUM = '\\d*[A-z-][A-z\\d-]*' ;
13+ const INT = '0|[1-9]\\d*' ;
14+ const ALPHA_NUM = '\\d*[A-Za- z-][A-Za -z\\d-]*' ;
1515const PRE_PART = `(?:${ ALPHA_NUM } |${ INT } )` ;
1616const PRE = `${ PRE_PART } (?:\\.${ PRE_PART } )*` ;
1717const BUILD_PART = `(?:${ ALPHA_NUM } |\\d+)` ;
1818const BUILD = `${ BUILD_PART } (?:\\.${ BUILD_PART } )*` ;
19- const SEMVER = `(${ INT } (?:\\.${ INT } ){2})(?:-(${ PRE } ))?(?:\\+(${ BUILD } ))?` ;
20- const REGEXP_INT = new RegExp ( `^${ INT } $` ) ;
19+ const SEMVER =
20+ `((?:${ INT } )(?:\\.(?:${ INT } )){2})(?:-(${ PRE } ))?(?:\\+(${ BUILD } ))?` ;
21+ const REGEXP_INT = new RegExp ( `^(?:${ INT } )$` ) ;
2122const REGEXP_SEMVER = new RegExp ( `^v?${ SEMVER } $` ) ;
2223const REGEXP_SEMVER_STRICT = new RegExp ( `^${ SEMVER } $` ) ;
2324
You can’t perform that action at this time.
0 commit comments