added hotReload saveFile

This commit is contained in:
2026-04-28 14:30:53 +02:00
parent 9ffea9ee45
commit 061188a3c0
12 changed files with 113 additions and 163 deletions

View File

@@ -211,6 +211,25 @@ module.exports = {
return value && typeof value === 'object' && !Array.isArray(value);
}
/**
* changes: string = key1.key2.key3...
*/
save(changes) {
Object.entries(changes).forEach(([path, value]) => {
path.split('.').reduce((acc, key, index, arr) => {
if (index === arr.length - 1) {
acc[key] = value; // 🔥 Proxy triggert
} else {
if (!acc[key] || typeof acc[key] !== 'object') {
acc[key] = {};
}
return acc[key];
}
}, this.live);
});
}
// Merge für Objekte und Arrays
mergeObjects(target, source, removeExtra = false) {
if (Array.isArray(target) && Array.isArray(source)) {