Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private findElmFilesInFolder(element: [string, boolean]): IFolder[] {
// Cleanup the path on windows, as globby does not like backslashes
const globUri = element[0].replace(/\\/g, "/");
return globby
.sync(`${globUri}/**/*.elm`, { suppressErrors: true })
.map(matchingPath => ({ path: matchingPath, writable: element[1] }));
}
paths = _.filter(paths, (pathName) => {
const exclude = _.endsWith(pathName, '/') === true;
if (exclude) {
appendPaths.push(pathName + '**/*.js');
appendPaths.push(pathName + '**/*.css');
appendPaths.push(pathName + '**/*.scss');
}
return !exclude;
});
paths = paths.concat(appendPaths);
paths = _.uniq(paths);
paths = glob.sync(paths);
// @todo Test whether glob.sync can return non-unique file paths.
// paths = _.unique(paths);
paths = _.map(paths, resolveAbsolutePath);
return paths;
};
'!**/wallaby.js',
'!**/karma-test-shim.js',
'!**/karma.conf.js',
'!**/test.ts',
'!**/tsconfig.app.json',
'!**/*stackblitz.*'
];
// exclude all specs if no spec is mentioned in `files[]`
if (!includeSpec) {
defaultExcludes.push('!**/*.spec.*','!**/spec.js');
}
gpaths.push(...defaultExcludes);
config.fileNames = globby.sync(gpaths, { ignore: ["**/node_modules/**"] });
return config;
}
}
function getTestsFor(srcFiles) {
const allUnitTests = globby.sync(unitTestPaths);
return allUnitTests.filter(testFile => {
return shouldRunTest(testFile, srcFiles);
});
}
function getFiles() /*: Array */ {
const allFiles = glob.sync(
[
'**/test.js',
'**/*.spec.js',
'**/*.test.js',
...testPathIgnorePatterns.map(pattern => `!${pattern}`),
],
{gitignore: true}
);
const filesPerJob = Math.ceil(allFiles.length / JOB_COUNT);
const startIndex = filesPerJob * JOB_INDEX;
return allFiles.slice(startIndex, startIndex + filesPerJob);
}
var globJsSource = function(javascripts) {
var myScripts = javascripts || paths.javascripts.src;
console.log(cwd, myScripts);
myScripts = globby.sync(myScripts, {cwd: cwd});
console.log(myScripts);
return myScripts
};
function collect (ps) {
return globby.sync(
ps, { dot: true }
);
}
function glob(path, patterns) {
return globby.sync(patterns, { cwd: path }).map(file => toFile(path, file));
}
packagesPath.forEach(root => {
const { name } = importCwd(`./${root}/package.json`);
const hasTests = globby.sync(`${root}/**/${testExt}`).length > 0;
const testGlob = [`${root}/**/${testExt}`];
const srcGlob = [`${root}/src/**/${srcExt}`];
packagesMap.set(name, {
root,
hasTests,
testGlob,
srcGlob,
});
});
return packagesMap;