mirror of
https://github.com/typicode/json-server.git
synced 2025-07-29 21:23:41 +08:00
Use deep equal
This commit is contained in:
@ -161,7 +161,7 @@ module.exports = function (argv) {
|
||||
if (is.JSON(file)) {
|
||||
var obj = JSON.parse(fs.readFileSync(file))
|
||||
// Compare .json file content with in memory database
|
||||
var isDatabaseDifferent = !_.eq(obj, app.db.getState())
|
||||
var isDatabaseDifferent = !_.isEqual(obj, app.db.getState())
|
||||
if (isDatabaseDifferent) {
|
||||
console.log(chalk.gray(' ' + file + ' has changed, reloading...'))
|
||||
server && server.destroy()
|
||||
|
Reference in New Issue
Block a user