mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-24 07:09:20 +01:00
* add pnpm * make it work * fix comamnds in package.jsons * move some scripts to modules * workflow fixes * test workflow * test #2 * minor fix * update lockflite * create workflows * update workflow * Add copy license command * Fix build * update workflows * update contributions.md * migrate site directory to pnpm * Fix peer dependencies when install * fix types in lucide-angular * fix testing
18 lines
597 B
JavaScript
18 lines
597 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 (svgFiles, iconsDirectory) =>
|
|
svgFiles.map(svgFile => {
|
|
const name = basename(svgFile, '.svg');
|
|
const contents = readSvg(svgFile, iconsDirectory);
|
|
|
|
return { name, contents };
|
|
});
|