Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f370455

Browse files
committedDec 17, 2016
glob-util -> smart-glob, pass extensions around
1 parent 4ec1e79 commit f370455

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed
 

Diff for: ‎lib/input/dependency.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var babelify = require('babelify');
77
var filterJS = require('../filter_js');
88
var concat = require('concat-stream');
99
var moduleFilters = require('../../lib/module_filters');
10-
var globUtil = require('../glob_util.js');
10+
var smartGlob = require('../smart_glob.js');
1111

1212
/**
1313
* Returns a readable stream of dependencies, given an array of entry
@@ -57,9 +57,7 @@ function dependencyStream(indexes, options, callback) {
5757
})],
5858
postFilter: moduleFilters.externals(indexes, options)
5959
});
60-
globUtil.listFilesToProcess(
61-
globUtil.resolveFileGlobPatterns(indexes)
62-
).forEach(function (index) {
60+
smartGlob(indexes, options.extension).forEach(function (index) {
6361
md.write(path.resolve(index));
6462
});
6563
md.end();

Diff for: ‎lib/input/shallow.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var globUtil = require('../glob_util.js');
3+
var smartGlob = require('../smart_glob.js');
44

55
/**
66
* A readable source for content that doesn't do dependency resolution, but
@@ -31,7 +31,5 @@ module.exports = function (indexes, options, callback) {
3131
throw new Error('indexes should be either strings or objects');
3232
}
3333
});
34-
return callback(null, objects.concat(globUtil.listFilesToProcess(
35-
globUtil.resolveFileGlobPatterns(strings)
36-
)));
34+
return callback(null, objects.concat(smartGlob(strings, options.extension)));
3735
};

Diff for: ‎lib/glob_util.js renamed to ‎lib/smart_glob.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ function listFilesToProcess(globPatterns) {
126126
return files;
127127
}
128128

129-
module.exports = {
130-
resolveFileGlobPatterns: resolveFileGlobPatterns,
131-
listFilesToProcess: listFilesToProcess
132-
};
129+
function smartGlob(indexes, extensions) {
130+
return listFilesToProcess(
131+
resolveFileGlobPatterns(indexes, {
132+
extensions: extensions
133+
})
134+
);
135+
}
136+
137+
module.exports = smartGlob;

0 commit comments

Comments
 (0)
Please sign in to comment.