1 | /**
|
2 | * Expand glob file patterns.
|
3 | * @function _expandGlob
|
4 | * @param {string|string[]} patterns - Patterns to expand.
|
5 | * @returns {string[]} - Expanded file names.
|
6 | */
|
7 |
|
8 | ;
|
9 |
|
10 | var path = require('path'),
|
11 | glob = require('glob'),
|
12 | arrayreduce = require('arrayreduce');
|
13 |
|
14 | /** @lends _expandGlob */
|
15 | function _expandGlob(pattern) {
|
16 | return [].concat(pattern)
|
17 | .map(function (filename) {
|
18 | return glob.sync(path.resolve(filename));
|
19 | })
|
20 | .reduce(arrayreduce.arrayConcat(), [])
|
21 | }
|
22 |
|
23 | module.exports = _expandGlob; |
\ | No newline at end of file |