diff --git a/utils/sortJSON.js b/utils/sortJSON.js index 4bb8c96..2c86dcf 100644 --- a/utils/sortJSON.js +++ b/utils/sortJSON.js @@ -23,11 +23,8 @@ fs.readFile(filepath, 'utf-8', (err, data) => { period: [] }; - Object.keys(defaultStructure).forEach((key) => { - if (!entry.hasOwnProperty(key)) { - entry[key] = defaultStructure[key]; - } - }); + Object.assign(defaultStructure, entry); + return defaultStructure; }); // Sort the JSON array by the "title" field