diff options
Diffstat (limited to 'src/PursLoader/Glob.js')
-rw-r--r-- | src/PursLoader/Glob.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/PursLoader/Glob.js b/src/PursLoader/Glob.js new file mode 100644 index 0000000..960ae9a --- /dev/null +++ b/src/PursLoader/Glob.js | |||
@@ -0,0 +1,18 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | // module PursLoader.Glob | ||
4 | |||
5 | var glob = require('glob'); | ||
6 | |||
7 | var async = require('async'); | ||
8 | |||
9 | function globAllFn(patterns, errback, callback) { | ||
10 | return function(){ | ||
11 | async.map(patterns, glob, function(error, result){ | ||
12 | if (error) errback(new Error(error))(); | ||
13 | else callback(result)(); | ||
14 | }); | ||
15 | }; | ||
16 | } | ||
17 | |||
18 | exports.globAllFn = globAllFn; | ||