nl_tokens: Return an array of files that match the given glob pattern .
pl_tokens: function match ( files , <mask> , opts ) { if ( utils . typeOf ( files ) !== 'string' && ! Array . isArray ( files ) ) { throw new Error ( msg ( 'match' , 'files' , 'a string or array' ) ) ; } files = utils . arrayify ( files ) ; opts = opts || { } ; var negate = opts . negate || false ; var orig = pattern ; if ( typeof pattern === 'string' ) { negate = pattern . charAt ( 0 ) === '!' ; if ( negate ) { pattern = pattern . slice ( 1 ) ; } // we need to remove the character regardless, // so the above logic is still needed if ( opts . nonegate === true ) { negate = false ; } } var _isMatch = matcher ( pattern , opts ) ; var len = files . length , i = 0 ; var res = [ ] ; while ( i < len ) { var file = files [ i ++ ] ; var fp = utils . unixify ( file , opts ) ; if ( ! _isMatch ( fp ) ) { continue ; } res . push ( fp ) ; } if ( res . length === 0 ) { if ( opts . failglob === true ) { throw new Error ( 'micromatch.match() found no matches for: "' + orig + '".' ) ; } if ( opts . nonull || opts . nullglob ) { res . push ( utils . unescapeGlob ( orig ) ) ; } } // if `negate` was defined, diff negated files if ( negate ) { res = utils . diff ( files , res ) ; } // if `ignore` was defined, diff ignored filed if ( opts . ignore && opts . ignore . length ) { pattern = opts . ignore ; opts = utils . omit ( opts , [ 'ignore' ] ) ; res = utils . diff ( res , micromatch ( res , pattern , opts ) ) ; } if ( opts . nodupes ) { return utils . unique ( res ) ; } return res ; }