File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
core/test/bundling/animations-standalone Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,18 @@ export function resolveTiming(
6565 : parseTimeExpression ( < string | number > timings , errors , allowNegativeValues ) ;
6666}
6767
68+ const PARSE_TIME_EXPRESSION_REGEX =
69+ / ^ ( - ? [ \. \d ] + ) ( m ? s ) (?: \s + ( - ? [ \. \d ] + ) ( m ? s ) ) ? (?: \s + ( [ - a - z ] + (?: \( .+ ?\) ) ? ) ) ? $ / i;
6870function parseTimeExpression (
6971 exp : string | number ,
7072 errors : Error [ ] ,
7173 allowNegativeValues ?: boolean ,
7274) : AnimateTimings {
73- const regex = / ^ ( - ? [ \. \d ] + ) ( m ? s ) (?: \s + ( - ? [ \. \d ] + ) ( m ? s ) ) ? (?: \s + ( [ - a - z ] + (?: \( .+ ?\) ) ? ) ) ? $ / i;
7475 let duration : number ;
7576 let delay : number = 0 ;
7677 let easing : string = '' ;
7778 if ( typeof exp === 'string' ) {
78- const matches = exp . match ( regex ) ;
79+ const matches = exp . match ( PARSE_TIME_EXPRESSION_REGEX ) ;
7980 if ( matches === null ) {
8081 errors . push ( invalidTimingValue ( exp ) ) ;
8182 return { duration : 0 , delay : 0 , easing : '' } ;
Original file line number Diff line number Diff line change 192192 " OperatorSubscriber" ,
193193 " PARAM_REGEX" ,
194194 " PARENT" ,
195+ " PARSE_TIME_EXPRESSION_REGEX" ,
195196 " PLATFORM_BROWSER_ID" ,
196197 " PLATFORM_DESTROY_LISTENERS" ,
197198 " PLATFORM_ID" ,
You can’t perform that action at this time.
0 commit comments