react-diagram-schema
Version:
Parses React components from a file entry point and generates/writes a complete schema to a file
12 lines (9 loc) • 416 B
JavaScript
function extract_exportDeclarationPaths(program_bodyPath) {
// helper function: filter export declarations
const isExportDeclaration = (path) =>
path.isExportDefaultDeclaration || path.isExportNamedDeclaration;
//EXTRACT export declarations
const exportDeclarationPaths = program_bodyPath.filter(isExportDeclaration);
return exportDeclarationPaths;
}
module.exports = extract_exportDeclarationPaths;