File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Sources/Interaction/Manipulators/MouseRangeManipulator Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1- import { vtkObject } from '../../../interfaces' ;
21import vtkCompositeMouseManipulator , {
32 ICompositeMouseManipulatorInitialValues ,
43} from '../../../Interaction/Manipulators/CompositeMouseManipulator' ;
4+ import { vtkObject } from '../../../interfaces' ;
55
66export interface IMouseRangeManipulatorInitialValues
77 extends ICompositeMouseManipulatorInitialValues { }
Original file line number Diff line number Diff line change 11module . exports = ( code , replaceFunc ) => {
2- const importRegex = / (?: i m p o r t | f r o m ) [ ' " ] ( [ ^ ' " ] * ) [ ' " ] / g;
2+ const importRegex = / (?: i m p o r t | f r o m ) \s + [ ' " ] ( [ ^ ' " ] * ) [ ' " ] / g;
33 let m ;
4- while ( ( m = importRegex . exec ( code ) ) !== null ) {
4+ while ( ( m = importRegex . exec ( code ) ) != null ) {
55 // This is necessary to avoid infinite loops with zero-width matches
66 if ( m . index === importRegex . lastIndex ) {
77 importRegex . lastIndex ++ ;
88 }
99
1010 if ( m [ 1 ] . startsWith ( '../' ) || m [ 1 ] . startsWith ( './' ) ) {
1111 const importPath = replaceFunc ( m [ 1 ] ) ;
12+ const origLen = code . length ;
1213 code = code . replace ( m [ 0 ] , `from '${ importPath } '` ) ;
14+ const lenDiff = code . length - origLen ;
15+ importRegex . lastIndex += lenDiff ;
1316 }
1417 }
1518 return code ;
You can’t perform that action at this time.
0 commit comments