/
index.ts
37 lines (33 loc) · 1.11 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { fileIcons } from './../../icons/fileIcons';
import { folderIcons } from './../../icons/folderIcons';
import { languageIcons } from './../../icons/languageIcons';
import { generatePreview } from './preview';
const filterDuplicates = (icons: string[]) => {
return [...new Set(icons)];
};
const basicFileIcons = filterDuplicates(
fileIcons.icons
.map((i) => i.name)
// merge language icons
.concat(languageIcons.map((i) => i.icon.name))
).map((i) => ({ iconName: i, label: i }));
const folderThemes = filterDuplicates(
folderIcons
.map((theme) => {
const folders = [];
if (theme.defaultIcon.name !== '') {
folders.push(theme.defaultIcon.name);
}
if (theme.icons && theme.icons.length > 0) {
folders.push(...theme.icons.map((i) => i.name));
}
return [].concat(...folders);
})
.reduce((a, b) => a.concat(b))
).map((i) => ({ iconName: i, label: i.replace('folder-', '') }));
generatePreview('fileIcons', basicFileIcons, 5, ['virtual']);
generatePreview('folderIcons', folderThemes, 5, [
'folder-aurelia',
'folder-bower',
'folder-wakatime',
]);