@@ -87,8 +87,18 @@ function buildTheme(icons, { colored = false } = {}) {
8787 const lightFileExtensions = { } ;
8888 const fileNames = { } ;
8989 const lightFileNames = { } ;
90-
91- for ( const { name, color : iconColor , fileExtensions : exts , fileNames : names } of icons ) {
90+ const folderNames = { } ;
91+ const lightFolderNames = { } ;
92+ const folderNamesExpanded = { } ;
93+ const lightFolderNamesExpanded = { } ;
94+
95+ for ( const {
96+ name,
97+ color : iconColor ,
98+ fileExtensions : exts ,
99+ fileNames : names ,
100+ folderNames : folders ,
101+ } of icons ) {
92102 const hasColor = colored && iconColor ;
93103 const darkPath = hasColor ? `./${ name } -color.svg` : `./${ name } .svg` ;
94104 const lightPath = hasColor ? `./${ name } -color-light.svg` : `./${ name } -light.svg` ;
@@ -107,6 +117,14 @@ function buildTheme(icons, { colored = false } = {}) {
107117 lightFileNames [ fn ] = `${ name } _light` ;
108118 }
109119 }
120+ if ( folders ) {
121+ for ( const fn of folders ) {
122+ folderNames [ fn ] = name ;
123+ lightFolderNames [ fn ] = `${ name } _light` ;
124+ folderNamesExpanded [ fn ] = name ;
125+ lightFolderNamesExpanded [ fn ] = `${ name } _light` ;
126+ }
127+ }
110128 }
111129
112130 const hasSymlink = icons . some ( ( i ) => i . name === "file-symlink-duo" ) ;
@@ -132,6 +150,13 @@ function buildTheme(icons, { colored = false } = {}) {
132150 theme . light . fileNames = lightFileNames ;
133151 }
134152
153+ if ( Object . keys ( folderNames ) . length > 0 ) {
154+ theme . folderNames = folderNames ;
155+ theme . folderNamesExpanded = folderNamesExpanded ;
156+ theme . light . folderNames = lightFolderNames ;
157+ theme . light . folderNamesExpanded = lightFolderNamesExpanded ;
158+ }
159+
135160 return theme ;
136161}
137162
0 commit comments