@@ -17,61 +17,50 @@ function toResolveOptions(fromPath, resolveOpts) {
17
17
return Object . assign ( { } , resolveOpts , { basedir : dirname ( fromPath ) } ) ;
18
18
}
19
19
20
- function resolveFilePathAsync ( path , filePath , resolveOpts ) {
20
+ export function resolveFilePathAsync ( path , filePath , resolveOpts ) {
21
21
let fromPath = getPathFileName ( path ) ;
22
22
let opts = toResolveOptions ( fromPath , resolveOpts ) ;
23
23
return resolveAsync ( filePath , opts ) ;
24
24
}
25
25
26
- function resolveFilePathSync ( path , filePath , resolveOpts ) {
26
+ export function resolveFilePathSync ( path , filePath , resolveOpts ) {
27
27
let fromPath = getPathFileName ( path ) ;
28
28
let opts = toResolveOptions ( fromPath , resolveOpts ) ;
29
29
return resolveSync ( filePath , opts ) ;
30
30
}
31
31
32
- function resolveImportFilePathAsync ( importDeclaration , resolveOpts ) {
32
+ export function resolveImportFilePathAsync ( importDeclaration , resolveOpts ) {
33
33
let fromPath = getPathFileName ( importDeclaration ) ;
34
34
let toPath = getImportSource ( importDeclaration ) ;
35
35
let opts = toResolveOptions ( fromPath , resolveOpts ) ;
36
36
return resolveAsync ( toPath , opts ) ;
37
37
}
38
38
39
- function resolveImportFilePathSync ( importDeclaration , resolveOpts ) {
39
+ export function resolveImportFilePathSync ( importDeclaration , resolveOpts ) {
40
40
let fromPath = getPathFileName ( importDeclaration ) ;
41
41
let toPath = getImportSource ( importDeclaration ) ;
42
42
let opts = toResolveOptions ( fromPath , resolveOpts ) ;
43
43
return resolveSync ( toPath , opts ) ;
44
44
}
45
45
46
- function loadFileAsync ( filePath , parserOpts ) {
46
+ export function loadFileAsync ( filePath , parserOpts ) {
47
47
return readFileAsync ( filePath ) . then ( buffer =>
48
48
createFile ( buffer . toString ( ) , { filename : filePath , parserOpts } )
49
49
) ;
50
50
}
51
51
52
- function loadFileSync ( filePath , parserOpts ) {
52
+ export function loadFileSync ( filePath , parserOpts ) {
53
53
let buffer = readFileSync ( filePath ) ;
54
54
return createFile ( buffer . toString ( ) , { filename : filePath , parserOpts } ) ;
55
55
}
56
56
57
- function loadImportAsync ( importDeclaration , resolveOpts , parserOpts ) {
57
+ export function loadImportAsync ( importDeclaration , resolveOpts , parserOpts ) {
58
58
return resolveImportFilePathAsync ( importDeclaration , resolveOpts ) . then ( resolved =>
59
59
loadFileAsync ( resolved , parserOpts )
60
60
) ;
61
61
}
62
62
63
- function loadImportSync ( importDeclaration , resolveOpts , parserOpts ) {
63
+ export function loadImportSync ( importDeclaration , resolveOpts , parserOpts ) {
64
64
const resolved = resolveImportFilePathSync ( importDeclaration , resolveOpts ) ;
65
65
return loadFileSync ( resolved , parserOpts ) ;
66
66
}
67
-
68
- module . exports = {
69
- resolveFilePathAsync,
70
- resolveFilePathSync,
71
- resolveImportFilePathAsync,
72
- resolveImportFilePathSync,
73
- loadFileAsync,
74
- loadFileSync,
75
- loadImportAsync,
76
- loadImportSync
77
- } ;
0 commit comments