mirror of
https://github.com/iconoir-icons/iconoir
synced 2024-05-17 22:06:42 +02:00
fb280188e1
Resolves #294
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;
|