Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.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) {
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
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();
});
});
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']);
}).filter(function(file) {
return globule.isMatch(self._patterns, file, self.options);
}).forEach(function(file) {
self.emit('added', file);
}).filter(function(file) {
return globule.isMatch(self._patterns, file, self.options);
}).forEach(function(file) {
self.emit('added', file);
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)
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)
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);
}
};
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': []
};
};