-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataSources.js
36 lines (33 loc) · 935 Bytes
/
dataSources.js
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
import layerData from "./data/layers.json";
import modalData from "./data/modals.json";
import pageData from "./data/pages.json";
import stationData from "./data/stations.json";
import config from "./data/config.json";
import settings from "./data/settings.json";
const enabledStations = stationData
.flatMap(({data}) => data)
.filter(s => s.enabled);
export const localDataProvider = {
config: {
data: config,
},
layers: {
items: layerData,
enabled: layerData.filter(l => l.enabled),
},
modals: {
itemsByID: modalData,
},
pages: {
items: pageData,
itemsByID: Object.fromEntries(pageData.map(page => [page.id, page])),
},
settings: {
data: settings,
},
stations: {
categoryNested: stationData,
enabled: enabledStations,
enabledByID: Object.fromEntries(enabledStations.map(s => [s.id, s])),
},
};