nl_tokens: Find items in array that match a set of patterns Adapted from https : // github . com / sindresorhus / multimatch
pl_tokens: function match ( list , patterns , options ) { list = list || [ ] ; patterns = patterns || [ ] ; if ( _ . isString ( patterns ) ) { patterns = [ patterns ] ; } if ( list . length === 0 || patterns . length === 0 ) { return [ ] ; } options = options || { } ; return patterns . reduce ( function ( ret , pattern ) { var process = _ . union if ( pattern [ 0 ] === '!' ) { pattern = pattern . slice ( 1 ) ; process = _ . difference ; } return process ( ret , minimatch . <mask> ( list , pattern , options ) ) ; } , [ ] ) ; }