2022-08-28 20:12:09 +02:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
function template(filePaths) {
|
2023-09-24 21:13:56 +02:00
|
|
|
const exportEntries = filePaths.map(({ path: filePath }) => {
|
2022-08-28 20:12:09 +02:00
|
|
|
const basename = path.basename(filePath, path.extname(filePath));
|
|
|
|
const exportName = /^\d/.test(basename) ? `Svg${basename}` : basename;
|
|
|
|
return `export { default as ${exportName} } from './${basename}'`;
|
|
|
|
});
|
|
|
|
exportEntries.push(
|
2023-09-24 21:13:56 +02:00
|
|
|
"export { IconoirProvider, IconoirContext, IconoirContextValue } from './IconoirContext'",
|
2022-08-28 20:12:09 +02:00
|
|
|
);
|
|
|
|
return exportEntries.join('\n');
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = template;
|