mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 22:57:43 +01:00
* cleanup scripts * Move helpers to package * Fixes scripts * Fix scripts * Formatting * Fix helpers import paths * Remove lucide-figma * Rename helpers package * Fix build * formatting * Adjust main build-icons file * Add export casing * Adds `exportModuleNameCasing` fro lab project * format files * Bump package version @lucide/build-icons * Revert changes in icons * Revert changes in PR yml * Fix lint issues * Fix site build * fix lint errors * Attempt fix linting * Fix lint errors
19 lines
611 B
JavaScript
19 lines
611 B
JavaScript
/* eslint-disable import/no-extraneous-dependencies */
|
|
import { basename } from 'path';
|
|
import { readSvg } from '@lucide/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 function readSVGs(svgFiles, iconsDirectory) {
|
|
return svgFiles.map((svgFile) => {
|
|
const name = basename(svgFile, '.svg');
|
|
const contents = readSvg(svgFile, iconsDirectory);
|
|
|
|
return { name, contents };
|
|
});
|
|
}
|