Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
paths.forEach(pathItem => {
if (byString(pathItem)) {
pathItem = toAbsolutePath(pathItem);
if (!byDirectory(pathItem)) {
throw new Error(
`${
this.loggingPrefix
}args.paths contained a value that was not a path to a directory`
);
}
routes = routes.concat(
fsRoutes(pathItem, {
glob: this.routesGlob,
indexFileRegExp: this.routesIndexFileRegExp
})
.filter(fsRoutesItem => {
return this.pathsIgnore
? !this.pathsIgnore.test(fsRoutesItem.route)
: true;
})
.map(fsRoutesItem => {
routesCheckMap[fsRoutesItem.route] = true;
return {
path: fsRoutesItem.route,
module: require(fsRoutesItem.path)
};
})
);