How to use the globule.isMatch function in globule

To help you get started, we’ve selected a few globule examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tivac / yui-configger / lib / configger.js View on Github external
.filter(function(file) {
                // All files are cool if CSS is enabled
                if(options.css) {
                    return true;
                }

                // Otherwise filter out CSS modules
                return globule.isMatch(options.extensions.js, file);
            })
            .map(function(file) {
github AtomLinter / linter-jscs / src / linter-jscs.js View on Github external
editorHandlers.add(editor.getBuffer().onWillSave(() => {
        const scope = editor.getGrammar().scopeName;
        if (
          (
            atom.workspace.getActiveTextEditor().id === editor.id
            && (grammarScopes.indexOf(scope) !== -1 && scope !== 'text.html.basic')
          )
          || this.testFixOnSave
        ) {
          // Exclude `excludeFiles` for fix on save
          const config = getConfig(filePath);
          const exclude = globule.isMatch(
            config && config.excludeFiles,
            getFilePath(filePath),
          );

          if ((fixOnSave && !exclude) || this.testFixOnSave) {
            fixString(editor);
          }
        }
      }));
      // Remove all disposables associated with this editor
github shama / gaze / lib / gaze.js View on Github external
helper.forEachSeries(current, function(file, next) {
      var filepath = path.join(dir, file);
      if (!fs.existsSync(filepath)) return next();
      var stat = fs.lstatSync(filepath);
      if ((dirstat.mtime - stat.mtime) <= 0) {
        var relpath = path.relative(self.options.cwd, filepath);
        if (stat.isDirectory()) {
          // If it was a dir, watch the dir and emit that it was added
          platform(filepath, self._trigger.bind(self));
          if (globule.isMatch(self._patterns, relpath, self.options)) {
            self._emitAll('added', filepath);
          }
          self._wasAddedSub(filepath);
        } else if (globule.isMatch(self._patterns, relpath, self.options)) {
          // Otherwise if the file matches, emit added
          platform(filepath, self._trigger.bind(self));
          if (globule.isMatch(self._patterns, relpath, self.options)) {
            self._emitAll('added', filepath);
          }
        }
      }
      next();
    });
  });
github DefinitelyTyped / DefinitelyTyped / types / globule / globule-tests.ts View on Github external
let filepaths: string[];

filepaths = globule.find('**/*.js');
filepaths = globule.find(['**/*.js']);
filepaths = globule.find('**/*.js', '**/*.less');
filepaths = globule.find('*.js', { matchBase: true });
filepaths = globule.find('**/*.js', '**/*.less', { filter: 'isFile' });
filepaths = globule.find('**/*.js', '**/*.less', { filter: /jQuery/i.test });
filepaths = globule.find({ src: '**/*.js' });

filepaths = globule.match('*.js', '/home/code');
filepaths = globule.match('*.js', '/home/code', { matchBase: true });

let bResult: boolean;
bResult = globule.isMatch('*.js', '/home/code');
bResult = globule.isMatch('*.js', '/home/code', { matchBase: true });

let mappings = globule.mapping(['*.js']);
const len = mappings.length;
const src = mappings[0].src;
const dest = mappings[0].dest;

mappings = globule.mapping(['*.js'], { srcBase: '/home/code' });
mappings = globule.mapping(['*.js', '*.less']);
mappings = globule.mapping(['*.js'], ['*.less']);
github jasonsanjose / brackets-sass / node / 2.0.3 / node_modules / node-sass / node_modules / gaze / lib / gaze.js View on Github external
}).filter(function(file) {
        return globule.isMatch(self._patterns, file, self.options);
      }).forEach(function(file) {
        self.emit('added', file);
github chrishumboldt / Webplate / webplate / core / grunt / node_modules / grunt-contrib-watch / node_modules / gaze / lib / gaze.js View on Github external
}).filter(function(file) {
        return globule.isMatch(self._patterns, file, self.options);
      }).forEach(function(file) {
        self.emit('added', file);
github zaaack / ELaunch / app / plugins / app / win32 / index.js View on Github external
let items = apps.filter(app => {
      try {
        return globule.isMatch(patt, app.name.toLocaleLowerCase()) || globule.isMatch(patt, app.en_name.toLocaleLowerCase())
      } catch (e) {
        console.error(app,e);
      }
    })
    event.sender.send('exec-reply', items)
github zaaack / ELaunch / app / plugins / app / darwin / index.js View on Github external
const items = apps.filter(app => {
      try {
        return globule.isMatch(patt, app.name.toLocaleLowerCase())
          || globule.isMatch(patt, app.nameEn.toLocaleLowerCase())
      } catch (e) {
        console.error(app, e);
      }
      return false
    }).slice(0, 20)
    event.sender.send('exec-reply', items)
github publiclab / Leaflet.DistortableImage / node_modules / gaze / lib / gaze.js View on Github external
Gaze.prototype._internalAdd = function (file, done) {
  var files = [];
  if (helper.isDir(file)) {
    files = [helper.markDir(file)].concat(globule.find(this._patterns, this.options));
  } else {
    if (globule.isMatch(this._patterns, file, this.options)) {
      files = [file];
    }
  }
  if (files.length > 0) {
    this._addToWatched(files);
    this.close(false);
    this._initWatched(done);
  }
};
github EightShapes / contrast-grid / node_modules / sass-lint / index.js View on Github external
sassLint.lintFileText = function (file, options, configPath) {
  var config = this.getConfig(options, configPath),
      ignores = config.files ? config.files.ignore : [];

  if (!globule.isMatch(ignores, file.filename)) {
    return this.lintText(file, options, configPath);
  }

  return {
    'filePath': file.filename,
    'warningCount': 0,
    'errorCount': 0,
    'messages': []
  };
};

globule

An easy-to-use wildcard globbing library.

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis