@@ -17,61 +17,50 @@ function toResolveOptions(fromPath, resolveOpts) {
1717 return Object . assign ( { } , resolveOpts , { basedir : dirname ( fromPath ) } ) ;
1818}
1919
20- function resolveFilePathAsync ( path , filePath , resolveOpts ) {
20+ export function resolveFilePathAsync ( path , filePath , resolveOpts ) {
2121 let fromPath = getPathFileName ( path ) ;
2222 let opts = toResolveOptions ( fromPath , resolveOpts ) ;
2323 return resolveAsync ( filePath , opts ) ;
2424}
2525
26- function resolveFilePathSync ( path , filePath , resolveOpts ) {
26+ export function resolveFilePathSync ( path , filePath , resolveOpts ) {
2727 let fromPath = getPathFileName ( path ) ;
2828 let opts = toResolveOptions ( fromPath , resolveOpts ) ;
2929 return resolveSync ( filePath , opts ) ;
3030}
3131
32- function resolveImportFilePathAsync ( importDeclaration , resolveOpts ) {
32+ export function resolveImportFilePathAsync ( importDeclaration , resolveOpts ) {
3333 let fromPath = getPathFileName ( importDeclaration ) ;
3434 let toPath = getImportSource ( importDeclaration ) ;
3535 let opts = toResolveOptions ( fromPath , resolveOpts ) ;
3636 return resolveAsync ( toPath , opts ) ;
3737}
3838
39- function resolveImportFilePathSync ( importDeclaration , resolveOpts ) {
39+ export function resolveImportFilePathSync ( importDeclaration , resolveOpts ) {
4040 let fromPath = getPathFileName ( importDeclaration ) ;
4141 let toPath = getImportSource ( importDeclaration ) ;
4242 let opts = toResolveOptions ( fromPath , resolveOpts ) ;
4343 return resolveSync ( toPath , opts ) ;
4444}
4545
46- function loadFileAsync ( filePath , parserOpts ) {
46+ export function loadFileAsync ( filePath , parserOpts ) {
4747 return readFileAsync ( filePath ) . then ( buffer =>
4848 createFile ( buffer . toString ( ) , { filename : filePath , parserOpts } )
4949 ) ;
5050}
5151
52- function loadFileSync ( filePath , parserOpts ) {
52+ export function loadFileSync ( filePath , parserOpts ) {
5353 let buffer = readFileSync ( filePath ) ;
5454 return createFile ( buffer . toString ( ) , { filename : filePath , parserOpts } ) ;
5555}
5656
57- function loadImportAsync ( importDeclaration , resolveOpts , parserOpts ) {
57+ export function loadImportAsync ( importDeclaration , resolveOpts , parserOpts ) {
5858 return resolveImportFilePathAsync ( importDeclaration , resolveOpts ) . then ( resolved =>
5959 loadFileAsync ( resolved , parserOpts )
6060 ) ;
6161}
6262
63- function loadImportSync ( importDeclaration , resolveOpts , parserOpts ) {
63+ export function loadImportSync ( importDeclaration , resolveOpts , parserOpts ) {
6464 const resolved = resolveImportFilePathSync ( importDeclaration , resolveOpts ) ;
6565 return loadFileSync ( resolved , parserOpts ) ;
6666}
67-
68- module . exports = {
69- resolveFilePathAsync,
70- resolveFilePathSync,
71- resolveImportFilePathAsync,
72- resolveImportFilePathSync,
73- loadFileAsync,
74- loadFileSync,
75- loadImportAsync,
76- loadImportSync
77- } ;
0 commit comments