File tree 2 files changed +6
-3
lines changed
Sources/Interaction/Manipulators/MouseRangeManipulator
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
- import { vtkObject } from '../../../interfaces' ;
2
1
import vtkCompositeMouseManipulator , {
3
2
ICompositeMouseManipulatorInitialValues ,
4
3
} from '../../../Interaction/Manipulators/CompositeMouseManipulator' ;
4
+ import { vtkObject } from '../../../interfaces' ;
5
5
6
6
export interface IMouseRangeManipulatorInitialValues
7
7
extends ICompositeMouseManipulatorInitialValues { }
Original file line number Diff line number Diff line change 1
1
module . 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;
3
3
let m ;
4
- while ( ( m = importRegex . exec ( code ) ) !== null ) {
4
+ while ( ( m = importRegex . exec ( code ) ) != null ) {
5
5
// This is necessary to avoid infinite loops with zero-width matches
6
6
if ( m . index === importRegex . lastIndex ) {
7
7
importRegex . lastIndex ++ ;
8
8
}
9
9
10
10
if ( m [ 1 ] . startsWith ( '../' ) || m [ 1 ] . startsWith ( './' ) ) {
11
11
const importPath = replaceFunc ( m [ 1 ] ) ;
12
+ const origLen = code . length ;
12
13
code = code . replace ( m [ 0 ] , `from '${ importPath } '` ) ;
14
+ const lenDiff = code . length - origLen ;
15
+ importRegex . lastIndex += lenDiff ;
13
16
}
14
17
}
15
18
return code ;
You can’t perform that action at this time.
0 commit comments