Skip to content

Commit

Permalink
fix: use Object.assign()
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
maehr and coderabbitai[bot] authored Dec 19, 2023
1 parent ed92d85 commit 027e905
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions utils/sortJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 027e905

Please sign in to comment.