feature: remember node positions after refreshing pages
This commit is contained in:
15
src/utils/jsUtils.js
Normal file
15
src/utils/jsUtils.js
Normal file
@@ -0,0 +1,15 @@
|
||||
export const printObject = (obj, indent = 0) => {
|
||||
const padding = ' '.repeat(indent);
|
||||
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
||||
console.log(`${padding}${key}: {`);
|
||||
printObject(obj[key], indent + 2);
|
||||
console.log(`${padding}}`);
|
||||
} else {
|
||||
console.log(`${padding}${key}: ${obj[key]}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user