contiago-toolbar
Version:
One of the options for outputting content from contiago xml-server
18 lines (14 loc) • 524 B
JavaScript
/**
* componentExists
*
* Check whether the given component exist in either the components or containers directory
*/
const fs = require('fs');
const path = require('path');
const pageComponents = fs.readdirSync(path.join(__dirname, '../../../app/components'));
const pageContainers = fs.readdirSync(path.join(__dirname, '../../../app/containers'));
const components = pageComponents.concat(pageContainers);
function componentExists(comp) {
return components.indexOf(comp) >= 0;
}
module.exports = componentExists;