mirror of
https://github.com/iconoir-icons/iconoir
synced 2024-05-23 00:32:22 +02:00
16 lines
524 B
JavaScript
16 lines
524 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 './${basename}'`;
|
|
});
|
|
exportEntries.push(
|
|
"export { IconoirProvider, IconoirContext, IconoirContextValue } from './IconoirContext'"
|
|
);
|
|
return exportEntries.join('\n');
|
|
}
|
|
|
|
module.exports = template;
|