Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function discover() {
const pagesAndFoldersSortedByType = _.chain(dirTree.directoryTree(TEMPLATES_BASE_DIRECTORY, ['.pug']).children)
.filter(obj => obj.path.charAt(0) !== '_')
.map(obj => {
obj = addPageInfo(obj);
if (obj.children) {
obj.children = mapChildren(obj.children);
}
return obj;
})
.sortBy('type')
.forEach(movePageStatesToParentPage)
.value();
return pagesAndFoldersSortedByType.filter(p => !p.path.includes('--'));
}
return new Promise(function(resolve) {
return resolve(tree('docs/' + locale, ['.md']));
});
}))