File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function parse(str) {
5050 if ( str . length > 100 ) {
5151 return ;
5252 }
53- var match = / ^ ( (?: \d + ) ? - ? (?: \d + ) ? \. ? \d + ) * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | w e e k s ? | w | y e a r s ? | y r s ? | y ) ? $ / i. exec (
53+ var match = / ^ ( - ? (?: \d + ) ? \. ? \d + ) * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | w e e k s ? | w | y e a r s ? | y r s ? | y ) ? $ / i. exec (
5454 str
5555 ) ;
5656 if ( ! match ) {
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ describe('ms(string)', function() {
5555
5656 it ( 'should return NaN if invalid' , function ( ) {
5757 expect ( isNaN ( ms ( '☃' ) ) ) . to . be ( true ) ;
58+ expect ( isNaN ( ms ( '10-.5' ) ) ) . to . be ( true ) ;
5859 } ) ;
5960
6061 it ( 'should be case-insensitive' , function ( ) {
You can’t perform that action at this time.
0 commit comments