mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 14:57:42 +01:00
* Improve license message * Implement license notice in lucide-static * Tighten package PR workflows * Update lockfile
19 lines
624 B
JavaScript
19 lines
624 B
JavaScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import { basename } from 'path';
|
|
import { readSvg } from '../../../scripts/helpers.mjs';
|
|
|
|
/**
|
|
* 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 function readSVGs(svgFiles, iconsDirectory) {
|
|
return svgFiles.map((svgFile) => {
|
|
const name = basename(svgFile, '.svg');
|
|
const contents = readSvg(svgFile, iconsDirectory);
|
|
|
|
return { name, contents };
|
|
});
|
|
}
|