How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • var matcher = anymatch(matchers);
    
    matcher('path/to/file.js'); // true
    matcher('path/anyjs/baz.js', true); // 1
    
    ['foo.js', 'bar.js'].filter(matcher); // ['foo.js']
    Docs
  • const anymatch = require('anymatch');
    
    const matchers = [ 'path/to/file.js', 'path/anyjs/**/*.js', /foo.js$/, string => string.includes('bar') && string.length > 10 ] ;
    
    anymatch(matchers, 'path/to/file.js'); // true
    anymatch(matchers, 'path/anyjs/baz.js'); // true
    anymatch(matchers, 'path/to/foo.js'); // true
    anymatch(matchers, 'path/to/bar.js'); // true
    anymatch(matchers, 'bar.js'); // false
    
    // returnIndex = true
    anymatch(matchers, 'foo.js', {returnIndex: true}); // 2
    anymatch(matchers, 'path/anyjs/foo.js', {returnIndex: true}); // 1
    
    // any picomatc
    
    // using globs to match directories and their children
    anymatch('node_modules', 'node_modules'); // true
    anymatch('node_modules', 'node_modules/somelib/index.js'); // false
    anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true
    anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false
    anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true
    
    const matcher = anymatch(matchers);
    ['foo.js', 'bar.js'].filter(matcher);  // [ 'foo.js' ]
    anymatch master*
    Docs
  • onCompile(changedFiles) {
        const enabled = this.enabled;
        const conns = this.connections;
        if (!enabled) return;
    
        const didCompile = changedFiles.length > 0;
        const isCss = file => anymatch(this.cssMatch, file.path);
        const isJs = file => anymatch(this.jsMatch, file.path);
        const isJsOrCss = file => isJs(file) || isCss(file);
    
        const allCss = didCompile && changedFiles.every(isCss);
        const allJs = this.hot && didCompile && changedFiles.every(isJs);
        
        //...
    }
    
      
    /brunch/auto-reload-brunch MIT
  • history.forEach(update => {
        if (anymatch(view.filePattern, update.path)) {
          updates[update.path] = update
        }
      })
    
      
    /beakerbrowser/dat-archive-map-reduce mit
  • constructor(config) {
        
        //...
    opts.sourceMaps = !!config.sourceMaps;
    
        if (opts.pattern) {
          this.pattern = opts.pattern;
          delete opts.pattern;
        }
    
        this.isIgnored = anymatch(options.ignore || /^(bower_components|vendor)/);
        this.options = opts;
      }
    
      
    /babel/babel-brunch isc
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples