Helper to create style filters.

This commit is contained in:
Eric van der Vlist 2023-01-31 11:56:40 +01:00
parent 92c2d37e3b
commit 5b9c2e3ca4
1 changed files with 14 additions and 0 deletions

14
helper.ts Normal file
View File

@ -0,0 +1,14 @@
import { overlayDefinitions } from './src/components/overlays/overlay-definitions';
let filters: any[] = ['any'];
Object.keys(overlayDefinitions).forEach((key) => {
const definition = overlayDefinitions[key];
let filter: any[] = ['in', key];
Object.keys(definition).forEach((subKey) => {
filter = [...filter, subKey];
});
filters = [...filters, filter];
});
console.log({ overlayDefinitions, filters, json: JSON.stringify(filters) });