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) {
50
50
if ( str . length > 100 ) {
51
51
return ;
52
52
}
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 (
54
54
str
55
55
) ;
56
56
if ( ! match ) {
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ describe('ms(string)', function() {
55
55
56
56
it ( 'should return NaN if invalid' , function ( ) {
57
57
expect ( isNaN ( ms ( '☃' ) ) ) . to . be ( true ) ;
58
+ expect ( isNaN ( ms ( '10-.5' ) ) ) . to . be ( true ) ;
58
59
} ) ;
59
60
60
61
it ( 'should be case-insensitive' , function ( ) {
You can’t perform that action at this time.
0 commit comments