mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
16 lines
574 B
JavaScript
16 lines
574 B
JavaScript
export default function template(files) {
|
|
const exportLines = files.map((file) => {
|
|
const { path } = file;
|
|
|
|
const fileName = path.split('/').pop();
|
|
const componentNameWithExt = fileName.replace(/\.tsx$/, '.js');
|
|
const componentName = fileName.replace(/\.tsx$/, '');
|
|
|
|
return `export { default as ${componentName} } from './${componentNameWithExt}';`;
|
|
});
|
|
|
|
|
|
const header = '/* This file is automatically generated by the build:icons script. Do not modify it manually.*/\n\n ';
|
|
|
|
return header + exportLines.join('\n');
|
|
}; |