-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathdata.ts
52 lines (46 loc) · 1006 Bytes
/
data.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { ALL_ICONS_IN_ALL_CONTEXTS } from 'semantic-ui-react/src/lib/SUI';
import { SemanticICONS } from 'semantic-ui-react';
const types = <const>['basic', 'range'];
const pointing = <const>['left', 'right', 'top left', 'top right'];
const locale = <const>[
'bg-BG',
'ca-ES',
'cs-CZ',
'da-DK',
'de-DE',
'el-GR',
'en-US',
'es-ES',
'et-EE',
'fi-FI',
'fr-FR',
'he-IL',
'it-IT',
'ja-JP',
'ko-KR',
'nb-NO',
'nl-NL',
'nn-NO',
'pl-PL',
'pt-BR',
'ro-RO',
'ru-RU',
'sk-SK',
'sv-SE',
'tr-TR',
'zh-CN',
];
function arrayToMap<T extends string>(
arr: readonly T[]
): { [key in typeof arr[number]]: typeof arr[number] } {
return arr.reduce(
(acc, cur) => ({ ...acc, [cur]: cur }),
{} as { [key in T]: T }
);
}
export const typeMap = arrayToMap(types);
export const pointingMap = arrayToMap(pointing);
export const localeMap = arrayToMap([...locale].sort());
export const iconMap = arrayToMap<SemanticICONS>(
ALL_ICONS_IN_ALL_CONTEXTS.sort()
);