mirror of
https://github.com/iconoir-icons/iconoir
synced 2024-06-07 16:32:26 +02:00
14 lines
404 B
JavaScript
14 lines
404 B
JavaScript
|
const path = require('path');
|
||
|
|
||
|
function template(filePaths) {
|
||
|
const exportEntries = filePaths.map((filePath) => {
|
||
|
const basename = path.basename(filePath, path.extname(filePath));
|
||
|
const exportName = /^\d/.test(basename) ? `Svg${basename}` : basename;
|
||
|
return `export { default as ${exportName} } from './${filePath}'`;
|
||
|
});
|
||
|
|
||
|
return exportEntries.join('\n');
|
||
|
}
|
||
|
|
||
|
module.exports = template;
|