index.js
function compose(patterns, options, matcher) {
  let matchers;

  return memoize('compose', String(patterns), options, function() {
    return function(file) {
      // delay composition until it's invoked the first time,
      // after that it won't be called again
      if (!matchers) {
        matchers = [];
        for (var i = 0; i < patterns.length; i++) {
          matchers.push(matcher(patterns[i], options));
        }
      }

      let len = matchers.length;
      while (len--) {
        if (matchers[len](file) === true) {
          return true;
        }
      }
      return false;
    };
  });
}
function compose(patterns, options, matcher) {
  let matchers;

  return memoize('compose', String(patterns), options, function() {
    return function(file) {
      // delay composition until it's invoked the first time,
      // after that it won't be called again
      if (!matchers) {
        matchers = [];
        for (var i = 0; i < patterns.length; i++) {
          matchers.push(matcher(patterns[i], options));
        }
      }

      let len = matchers.length;
      while (len--) {
        if (matchers[len](file) === true) {
          return true;
        }
      }
      return false;
    };
  });
}
function compose ( patterns , options , matcher ) { let matchers ; return memoize ( 'compose' , String ( patterns ) , options , function ( ) { return function ( file ) { // delay composition until it's invoked the first time, // after that it won't be called again if ( ! matchers ) { matchers = [ ] ; for ( var i = 0 ; i < patterns . length ; i ++ ) { matchers . push ( matcher ( patterns [ i ] , options ) ) ; } } let len = matchers . length ; while ( len -- ) { if ( matchers [ len ] ( file ) === true ) { return true ; } } return false ; } ; } ) ; }
Compose a matcher function with the given patterns.
This allows matcher functions to be compiled once and
called multiple times.
Compose a matcher function with the given patterns . This allows matcher functions to be compiled once and called multiple times .