Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs.readdir(svgPath, (a, svgs) => {
- buildIcons(svgs.map(svg => {
- return {
- name: toPascalCase(svg).slice(0, -4),
- path: (() => {
- const matches = /\sd="(.*)"/.exec(fs.readFileSync(path.join(svgPath, svg), {
- encoding: 'utf8'
- }))
- if (matches) {
- return matches[0]
- }
- })()
- }
- }).filter(_ => _.path))
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement