mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-17 00:17:43 +01:00
18 lines
593 B
JavaScript
18 lines
593 B
JavaScript
|
|
/* eslint-disable import/no-extraneous-dependencies */
|
||
|
|
import { basename } from 'path';
|
||
|
|
import { readSvg } from '../../../scripts/helpers';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Build an object in the format: `{ <name>: <contents> }`.
|
||
|
|
* @param {string[]} svgFiles - A list of filenames.
|
||
|
|
* @param {Function} getSvg - A function that returns the contents of an SVG file given a filename.
|
||
|
|
* @returns {Object}
|
||
|
|
*/
|
||
|
|
export default (svgFiles, iconsDirectory) =>
|
||
|
|
svgFiles.map(svgFile => {
|
||
|
|
const name = basename(svgFile, '.svg');
|
||
|
|
const contents = readSvg(svgFile, iconsDirectory);
|
||
|
|
|
||
|
|
return { name, contents };
|
||
|
|
});
|