oh fuck i forgot
This commit is contained in:
18
debug_structure.js
Normal file
18
debug_structure.js
Normal file
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user