Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw new Error(`Unable to find package.json`);
}
}
try {
config = loader.__require(path.resolve(pathToConfig));
} catch (err) {
throw new Error(`Unable to load config file: ${pathToConfig}`);
}
}
let names = scope.reduce(function (result, prop) {
return result.concat(Object.keys(config[prop] || {}));
}, []);
options.plugins.names = _.uniq(globule.match(pattern, names));
}
debug(`Plugins to load: ${options.plugins.names.join(', ')}`);
// what paths will we search?
let sourcePaths = loader[$SOURCE_PATHS] = {
waigo: WAIGO_FOLDER,
app: appFolder
};
_.each(options.plugins.names, function(name) {
let fullPath;
try {
fullPath = path.dirname(require.resolve(name));
} catch (err) {
import * as globule from 'globule';
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']);
import * as globule from 'globule';
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']);
import * as globule from 'globule';
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']);
import * as globule from 'globule';
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']);
}
opts.base = opts.base || bowerDirectory;
opts.includeDev = opts.includeDev || false;
opts.includeSelf = opts.includeSelf || false;
opts.paths = {
bowerJson: bowerJson,
bowerDirectory: bowerDirectory
};
try {
collection = new PackageCollection(opts);
files = collection.getFiles();
if (typeof opts.filter === 'string' || Array.isArray(opts.filter)) {
files = globule.match(opts.filter, files);
} else if (opts.filter instanceof RegExp) {
files = files.filter(function(file) {
return opts.filter.test(file);
});
} else if (typeof opts.filter === 'function') {
files = files.filter(opts.filter);
}
} catch (e) {
throw e;
}
return files || [];
};