Files
Magic-Garden-Bot/debug_structure.js
2025-12-09 23:21:09 +00:00

19 lines
559 B
JavaScript

const fs = require('fs');
const root = JSON.parse(fs.readFileSync('fullstate.json'));
function dump(obj, depth = 0, path = '') {
if (depth > 3) return;
if (!obj || typeof obj !== 'object') return;
console.log(`${' '.repeat(depth)}${path} [${Array.isArray(obj) ? 'Array(' + obj.length + ')' : 'Object'}] keys: ${Object.keys(obj).join(', ')}`);
Object.keys(obj).forEach(k => {
if (typeof obj[k] === 'object' && obj[k]) {
dump(obj[k], depth + 1, k);
}
});
}
console.log('--- Structure Dump ---');
dump(root);