2023-06-06 14:03:14 +00:00
|
|
|
import { legacyOverlayDefinitions } from './src/components/overlays/overlay-definitions';
|
2023-01-31 10:56:40 +00:00
|
|
|
|
|
|
|
let filters: any[] = ['any'];
|
|
|
|
|
2023-06-06 14:03:14 +00:00
|
|
|
Object.keys(legacyOverlayDefinitions).forEach((key) => {
|
|
|
|
const definition = legacyOverlayDefinitions[key];
|
2023-01-31 10:56:40 +00:00
|
|
|
let filter: any[] = ['in', key];
|
|
|
|
Object.keys(definition).forEach((subKey) => {
|
|
|
|
filter = [...filter, subKey];
|
|
|
|
});
|
|
|
|
filters = [...filters, filter];
|
|
|
|
});
|
|
|
|
|
2023-06-05 09:17:01 +00:00
|
|
|
// One timer
|
|
|
|
|
|
|
|
const categories = ['hiking', 'cycling', 'vanlife'];
|
|
|
|
|
|
|
|
let overlays = {};
|
|
|
|
|
|
|
|
for (const category of categories) {
|
|
|
|
console.log({ caller: 'onetimer / category', category });
|
|
|
|
overlays[category] = {};
|
2023-06-06 14:03:14 +00:00
|
|
|
for (const tag of Object.keys(legacyOverlayDefinitions)) {
|
2023-06-05 09:17:01 +00:00
|
|
|
overlays[category][tag] = {};
|
2023-06-06 14:03:14 +00:00
|
|
|
for (const tagValue of Object.keys(legacyOverlayDefinitions[tag] || {})) {
|
|
|
|
const def = legacyOverlayDefinitions[tag][tagValue];
|
2023-06-05 09:17:01 +00:00
|
|
|
if (!!def[category]) {
|
|
|
|
overlays[category][tag][tagValue] = def[category];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log({
|
|
|
|
caller: 'onetimer / result',
|
|
|
|
overlays: JSON.stringify(overlays),
|
|
|
|
});
|
|
|
|
|
|
|
|
// End of one timer
|
|
|
|
|
|
|
|
console.log({
|
2023-06-06 14:03:14 +00:00
|
|
|
legacyOverlayDefinitions,
|
2023-06-05 09:17:01 +00:00
|
|
|
filters,
|
|
|
|
json: JSON.stringify(filters),
|
|
|
|
overlays: JSON.stringify(overlays),
|
|
|
|
});
|