32 lines
990 B
JavaScript
32 lines
990 B
JavaScript
const fs = require('fs');
|
|
|
|
async function checkNetzProps() {
|
|
const data = JSON.parse(fs.readFileSync('Geodaten/project.json', 'utf8'));
|
|
const matches = [];
|
|
|
|
function search(obj, path = '') {
|
|
if (!obj || typeof obj !== 'object') return;
|
|
|
|
if (obj.properties) {
|
|
for (const key in obj.properties) {
|
|
if (String(obj.properties[key]).toLowerCase().includes('netz') || key.toLowerCase().includes('netz')) {
|
|
matches.push({ path, props: obj.properties });
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
for (const key in obj) {
|
|
if (typeof obj[key] === 'object') {
|
|
search(obj[key], `${path}.${key}`);
|
|
}
|
|
}
|
|
}
|
|
|
|
search(data, 'root');
|
|
console.log(`Found ${matches.length} matches:`);
|
|
matches.slice(0, 10).forEach(m => console.log(JSON.stringify(m.props)));
|
|
}
|
|
|
|
checkNetzProps().catch(err => console.error(err));
|