@@ -15,8 +15,8 @@ const {FlowParser} = require('../../parsers/flow/parser');
1515const { TypeScriptParser} = require ( '../../parsers/typescript/parser' ) ;
1616const { filterJSFile} = require ( './combine-utils' ) ;
1717const fs = require ( 'fs' ) ;
18- const glob = require ( 'glob' ) ;
1918const path = require ( 'path' ) ;
19+ const { globSync} = require ( 'tinyglobby' ) ;
2020
2121const flowParser = new FlowParser ( ) ;
2222const typescriptParser = new TypeScriptParser ( ) ;
@@ -66,13 +66,11 @@ function expandDirectoriesIntoFiles(
6666 if ( ! fs . lstatSync ( file ) . isDirectory ( ) ) {
6767 return [ file ] ;
6868 }
69- const filePattern = path . sep === '\\' ? file . replace ( / \\ / g, '/' ) : file ;
70- return glob . sync ( `${ filePattern } /**/*{,.fb}.{js,ts,tsx}` , {
71- nodir : true ,
72- // TODO: This will remove the need of slash substitution above for Windows,
73- // but it requires glob@v 9+; with the package currenlty relying on
74- // glob@7.1.1; and flow-typed repo not having definitions for glob@9+.
75- // windowsPathsNoEscape: true,
69+ return globSync ( '**/*{,.fb}.{js,ts,tsx}' , {
70+ expandDirectories : false ,
71+ onlyFiles : true ,
72+ absolute : true ,
73+ cwd : file ,
7674 } ) ;
7775 } )
7876 . filter ( element => filterJSFile ( element , platform , exclude ) ) ;
0 commit comments