@@ -26,16 +26,14 @@ function convertPathToPosix(filepath) {
26
26
*
27
27
* Also makes sure all path separators are POSIX style for `glob` compatibility.
28
28
*
29
- * @param {Object } [options] An options object
30
- * @param {string[] } [options.extensions=['.js']] An array of accepted extensions
31
- * @param {string } [options.cwd=process.cwd()] The cwd to use to resolve relative pathnames
29
+ * @param {string[] } [extensions=['.js']] An array of accepted extensions
32
30
* @returns {Function } A function that takes a pathname and returns a glob that
33
31
* matches all files with the provided extensions if
34
32
* pathname is a directory.
35
33
*/
36
- function processPath ( options ) {
37
- var cwd = ( options && options . cwd ) || process . cwd ( ) ;
38
- var extensions = ( options && options . requireExtension ) || [ '.js' ] ;
34
+ function processPath ( extensions ) {
35
+ var cwd = process . cwd ( ) ;
36
+ extensions = extensions || [ '.js' ] ;
39
37
40
38
extensions = extensions . map ( function ( ext ) {
41
39
return ext . replace ( / ^ \. / , '' ) ;
@@ -71,11 +69,11 @@ function processPath(options) {
71
69
/**
72
70
* Resolves any directory patterns into glob-based patterns for easier handling.
73
71
* @param {string[] } patterns File patterns (such as passed on the command line).
74
- * @param {Object } options An options object.
72
+ * @param {Array<string> } extensions A list of file extensions
75
73
* @returns {string[] } The equivalent glob patterns and filepath strings.
76
74
*/
77
- function resolveFileGlobPatterns ( patterns , options ) {
78
- var processPathExtensions = processPath ( options ) ;
75
+ function resolveFileGlobPatterns ( patterns , extensions ) {
76
+ var processPathExtensions = processPath ( extensions ) ;
79
77
return patterns . map ( processPathExtensions ) ;
80
78
}
81
79
@@ -128,9 +126,7 @@ function listFilesToProcess(globPatterns) {
128
126
129
127
function smartGlob ( indexes , extensions ) {
130
128
return listFilesToProcess (
131
- resolveFileGlobPatterns ( indexes , {
132
- extensions : extensions
133
- } )
129
+ resolveFileGlobPatterns ( indexes , extensions )
134
130
) ;
135
131
}
136
132
0 commit comments