@@ -54,15 +54,18 @@ async function generateComponentsForAllFamilies(icon) {
5454 const families = getIncludedFamilies ( icon . unsupported_families )
5555
5656 for ( let i = 0 ; i < families . length ; i ++ ) {
57- await generateComponent ( icon , families [ i ] )
57+ await Promise . all ( [
58+ generateComponent ( icon , families [ i ] ) ,
59+ generateComponent ( icon , families [ i ] , true ) ,
60+ ] )
5861 }
5962}
6063
61- async function generateComponent ( icon , family ) {
64+ async function generateComponent ( icon , family , filled = false ) {
6265 try {
63- const name = formatName ( icon . name , family . postfix )
66+ const name = formatName ( icon . name , family . postfix , filled )
6467
65- const svg = await downloadSVG ( icon . name , family . id )
68+ const svg = await downloadSVG ( icon . name , family . id , filled )
6669
6770 console . log ( `Downloading ${ name } ` )
6871
@@ -76,21 +79,22 @@ async function generateComponent(icon, family) {
7679 }
7780}
7881
79- function formatName ( string , familyPostfix ) {
82+ function formatName ( string , familyPostfix , filled ) {
8083 const formattedString = string
8184 . replace ( / _ / g, ' ' )
8285 . replace ( / \w \S * / g, ( txt ) => {
8386 return txt . charAt ( 0 ) . toUpperCase ( ) + txt . substr ( 1 ) . toLowerCase ( )
8487 } )
8588 . replace ( / / g, '' )
8689
87- return 'Icon' + formattedString + familyPostfix
90+ return 'Icon' + formattedString + familyPostfix + ( filled ? 'Filled' : '' )
8891}
8992
90- async function downloadSVG ( icon , familyId ) {
93+ async function downloadSVG ( icon , familyId , filled ) {
94+ const filledConfig = filled ? 'fill1' : 'default'
9195 const svg = await axios
9296 . get (
93- `https://fonts.gstatic.com/s/i/short-term/release/${ familyId } /${ icon } /default /24px.svg` ,
97+ `https://fonts.gstatic.com/s/i/short-term/release/${ familyId } /${ icon } /${ filledConfig } /24px.svg` ,
9498 )
9599 . catch ( ( err ) => console . log ( err ) )
96100
0 commit comments