File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
2
var path_1 = require ( 'path' ) ;
3
+ var isWindows = window . navigator . appVersion . indexOf ( 'Win' ) > - 1 ;
3
4
var importPathRegex = / r e q u i r e \( [ " ' ] ( B A S E .+ ) [ " ' ] \) ( [ a - z A - Z 0 - 9 \- \_ ] + ) ? | ^ i m p o r t .+ ?\s ? [ " ' ] ( B A S E .+ ) [ " ' ] ; ? $ / m;
4
5
var relativePathRegex = / ^ B A S E / ;
5
6
function fixImportPaths ( _a ) {
6
- var dir = _a . dir , content = _a . content , isWindows = _a . isWindows ;
7
+ var dir = _a . dir , content = _a . content ;
7
8
var entries = new Set ( [ ] ) ;
8
9
return content . split ( '\n' ) . map ( function ( line ) {
9
10
var isMatch = line . match ( importPathRegex ) ;
Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ import { join } from 'path';
4
4
import paths won't match the context of the test runner
5
5
fixImportPaths will replace paths with absolute paths
6
6
*/
7
+ const isWindows = window . navigator . appVersion . indexOf ( 'Win' ) > - 1 ;
7
8
8
9
// import or require statement
9
10
const importPathRegex =
10
11
/ r e q u i r e \( [ " ' ] ( B A S E .+ ) [ " ' ] \) ( [ a - z A - Z 0 - 9 \- \_ ] + ) ? | ^ i m p o r t .+ ?\s ? [ " ' ] ( B A S E .+ ) [ " ' ] ; ? $ / m;
11
12
const relativePathRegex = / ^ B A S E / ;
12
13
13
- export default function fixImportPaths ( { dir, content, isWindows } ) : string {
14
+ export default function fixImportPaths ( { dir, content} ) : string {
14
15
// collect import lines
15
16
let entries = new Set ( [ ] ) ;
16
17
Original file line number Diff line number Diff line change 18
18
"files" : [
19
19
" src/importPaths.ts" ,
20
20
" src/index.ts" ,
21
- " src/system.ts" ,
22
- " src/rewire-ts/__get__.ts" ,
23
- " src/rewire-ts/addImportsAsVars.ts" ,
24
- " src/rewire-ts/fileExists.ts" ,
25
- " src/rewire-ts/getDefinePropertySrc.ts" ,
26
- " src/rewire-ts/getImportGlobalsSrc.ts" ,
27
- " src/rewire-ts/index.ts" ,
28
- " src/rewire-ts/moduleEnv.ts" ,
29
- " src/rewire-ts/rewire.ts" ,
30
21
" src/typings/chai/chai.d.ts" ,
31
22
" src/typings/cr/cr.d.ts" ,
32
23
" src/typings/cr/globals.d.ts" ,
You can’t perform that action at this time.
0 commit comments