src/utils.js
function (options, patterns) {
				// Return all matching filepaths.
				var matches = processPatterns(patterns, function (pattern) {
					// Find all matching files for this pattern.
					return glob.sync(pattern, options);
				});

				// Filter result set?
				if (options.filter) {
					matches = matches.filter(function (filepath) {
						filepath = path.join(options.cwd || '', filepath);

						try {
							if (typeof options.filter === 'function') {
								return options.filter(filepath);
							} else {
								// If the file is of the right type and exists, this should work.
								return fs.statSync(filepath)[options.filter]();
							}
						} catch (e) {
							// Otherwise, it's probably not the right type.
							return false;
						}
					});
				}

				return matches;
			}
function (options, patterns) {
				// Return all matching filepaths.
				var matches = processPatterns(patterns, function (pattern) {
					// Find all matching files for this pattern.
					return glob.sync(pattern, options);
				});

				// Filter result set?
				if (options.filter) {
					matches = matches.filter(function (filepath) {
						filepath = path.join(options.cwd || '', filepath);

						try {
							if (typeof options.filter === 'function') {
								return options.filter(filepath);
							} else {
								// If the file is of the right type and exists, this should work.
								return fs.statSync(filepath)[options.filter]();
							}
						} catch (e) {
							// Otherwise, it's probably not the right type.
							return false;
						}
					});
				}

				return matches;
			}
function ( options , patterns ) { // Return all matching filepaths. var matches = processPatterns ( patterns , function ( pattern ) { // Find all matching files for this pattern. return glob . sync ( pattern , options ) ; } ) ; // Filter result set? if ( options . filter ) { matches = matches . filter ( function ( filepath ) { filepath = path . join ( options . cwd || '' , filepath ) ; try { if ( typeof options . filter === 'function' ) { return options . filter ( filepath ) ; } else { // If the file is of the right type and exists, this should work. return fs . statSync ( filepath ) [ options . filter ] ( ) ; } } catch ( e ) { // Otherwise, it's probably not the right type. return false ; } } ) ; } return matches ; }
Return an array of all file paths that match the given wildcard patterns.
Return an array of all file paths that match the given wildcard patterns .