File tree Expand file tree Collapse file tree 3 files changed +100
-85
lines changed
Expand file tree Collapse file tree 3 files changed +100
-85
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ export class Source {
6767
6868 switch ( type ) {
6969 case 'NumericLiteral' :
70- case 'StringLiteral' : {
70+ case 'StringLiteral' :
71+ case 'RegExpLiteral' : {
7172 const raw = this . text . slice ( node . start , node . end ) ;
7273 const { value } = node as unknown as
7374 | babel . NumericLiteral
Original file line number Diff line number Diff line change @@ -384,6 +384,18 @@ class Transformer extends Source {
384384 }
385385 }
386386
387+ if ( node instanceof angular . RegularExpressionLiteral ) {
388+ return this . #create< babel . RegExpLiteral > (
389+ {
390+ type : 'RegExpLiteral' ,
391+ pattern : node . body ,
392+ flags : node . flags ?? '' ,
393+ ...node . sourceSpan ,
394+ } ,
395+ { hasParentParens : isInParentParens } ,
396+ ) ;
397+ }
398+
387399 if ( node instanceof angular . Call || node instanceof angular . SafeCall ) {
388400 const isOptionalType = node instanceof angular . SafeCall ;
389401 const { receiver, args } = node ;
You can’t perform that action at this time.
0 commit comments