From 1ff4be4600754854fda662f762f0b1dfd2fc41f6 Mon Sep 17 00:00:00 2001 From: Nonsense112 <35377929+Nonsense112@users.noreply.github.com> Date: Wed, 11 Nov 2020 19:36:15 +0200 Subject: [PATCH] Fix state.json not pretty printed (#4943) * state.json format Since 9774031 the state.json file is not formatted anymore, it's just 1 line. * Update state.js Co-authored-by: Koen Kanters --- lib/state.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/state.js b/lib/state.js index 389e3e02..94cdeb18 100644 --- a/lib/state.js +++ b/lib/state.js @@ -3,7 +3,6 @@ const data = require('./util/data'); const settings = require('./util/settings'); const fs = require('fs'); const objectAssignDeep = require('object-assign-deep'); -const stringify = require('json-stable-stringify-without-jsonify'); const saveInterval = 1000 * 60 * 5; // 5 minutes @@ -57,7 +56,7 @@ class State { save() { if (settings.get().advanced.cache_state_persistent) { logger.debug(`Saving state to file ${this.file}`); - const json = stringify(this.state, null, 4); + const json = JSON.stringify(this.state, null, 4); try { fs.writeFileSync(this.file, json, 'utf8'); } catch (e) {