Files
lucide/packages/lucide-static/scripts/readSvgs.js
Eric Fennis bb4f05e6c5 lucide-static (#401)
* Add lucide static

* add render files

* add read scripts

* Add sprite generator

* start with documentation

* Add docs

* adding documentation

* fix build command

* Add some extra static files

* bump version

* Update packages/lucide-static/README.md

Co-authored-by: Kathryn Reeve <67553+BinaryKitten@users.noreply.github.com>

* Fix sprite generation

* update readme

* Add lucide static workflow

* adjust readme

* Add font to release yml

* Temporary turn of new versioning for lucide-static

Co-authored-by: Kathryn Reeve <67553+BinaryKitten@users.noreply.github.com>
2021-11-21 20:27:15 +01:00

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 };
});