54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { legacyOverlayDefinitions } from './src/components/overlays/overlay-definitions';
|
|
|
|
let filters: any[] = ['any'];
|
|
|
|
Object.keys(legacyOverlayDefinitions).forEach((key) => {
|
|
const definition = legacyOverlayDefinitions[key];
|
|
let filter: any[] = ['in', key];
|
|
Object.keys(definition).forEach((subKey) => {
|
|
filter = [...filter, subKey];
|
|
});
|
|
filters = [...filters, filter];
|
|
});
|
|
|
|
// One timer
|
|
|
|
let tags = {};
|
|
let overlays = {};
|
|
|
|
for (const tagName of Object.keys(legacyOverlayDefinitions)) {
|
|
for (const tagValue of Object.keys(legacyOverlayDefinitions[tagName])) {
|
|
tags[tagValue] = { name: tagName, value: tagValue };
|
|
for (const activity of Object.keys(
|
|
legacyOverlayDefinitions[tagName][tagValue]
|
|
)) {
|
|
if (!overlays[activity]) {
|
|
overlays[activity] = {};
|
|
}
|
|
for (const category of Object.keys(
|
|
legacyOverlayDefinitions[tagName][tagValue][activity]
|
|
)) {
|
|
if (!overlays[activity][category]) {
|
|
overlays[activity][category] = [];
|
|
}
|
|
overlays[activity][category].push(tagValue);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
console.log({
|
|
caller: 'onetimer / result',
|
|
tags: JSON.stringify(tags),
|
|
overlays: JSON.stringify(overlays),
|
|
});
|
|
|
|
// End of one timer
|
|
|
|
// console.log({
|
|
// legacyOverlayDefinitions,
|
|
// filters,
|
|
// json: JSON.stringify(filters),
|
|
// overlays: JSON.stringify(overlays),
|
|
// });
|