Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fs.readdir(svgPath, (a, svgs) => {
  2.   buildIcons(svgs.map(svg => {
  3.     return {
  4.       name: toPascalCase(svg).slice(0, -4),
  5.       path: (() => {
  6.           const matches = /\sd="(.*)"/.exec(fs.readFileSync(path.join(svgPath, svg), {
  7.             encoding: 'utf8'
  8.           }))
  9.  
  10.           if (matches) {
  11.             return matches[0]
  12.           }
  13.       })()
  14.     }
  15.   }).filter(_ => _.path))
  16. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement