File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ export interface matchPatternResult {
2222 endIndex : number ;
2323}
2424
25- const createRegExp = ( patternString : string ) : RegExp => {
25+ export const createRegExp = ( patternString : string , defaultFlag : string = DEFAULT_FLAGS ) : RegExp => {
2626 if ( patternString . length === 0 ) {
27- throw new Error ( "Empty string can not includes " ) ;
27+ throw new Error ( "Empty string can not handled " ) ;
2828 }
2929 if ( isRegExpString ( patternString ) ) {
3030 const regExpStructure = parseRegExpString ( patternString ) ;
@@ -36,7 +36,7 @@ const createRegExp = (patternString: string): RegExp => {
3636 }
3737 throw new Error ( `"${ patternString } " can not parse as RegExp.` ) ;
3838 } else {
39- return new RegExp ( escapeStringRegexp ( patternString ) , DEFAULT_FLAGS ) ;
39+ return new RegExp ( escapeStringRegexp ( patternString ) , defaultFlag ) ;
4040 }
4141} ;
4242
Original file line number Diff line number Diff line change 88 "target" : " es5" ,
99 "sourceMap" : true ,
1010 "declaration" : true ,
11+ "esModuleInterop" : true ,
1112 "jsx" : " preserve" ,
1213 "lib" : [
1314 " es2017" ,
3233 " .git" ,
3334 " node_modules"
3435 ]
35- }
36+ }
You can’t perform that action at this time.
0 commit comments