/
index.ts
29 lines (25 loc) · 1.09 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
import { createScreenshots } from './screenshots';
import { generatePreview } from './preview';
import { fileIcons } from './../../src/icons/fileIcons';
import { folderIcons } from './../../src/icons/folderIcons';
import * as painter from './../helpers/painter';
import * as fs from 'fs';
import * as path from 'path';
import { toTitleCase } from '../helpers/titleCase';
const filterDuplicates = (icons: string[]) => {
return [...new Set(icons)];
};
const basicFileIcons = fileIcons.icons
.map(i => ({ iconName: i.name, label: i.name }));
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, ['key', 'virtual']);
generatePreview('folderIcons', folderThemes, 5, ['folder', 'folder-expo']);