Merge pull request #11995 from overleaf/em-unnecessary-returns

Decaf cleanup: unnecessary returns

GitOrigin-RevId: e3c006b0e15095c8cbed2911269f704a7fdd1d57
This commit is contained in:
Eric Mc Sween
2023-02-27 07:41:53 -05:00
committed by Copybot
parent 6fdd284ec8
commit bb9bafdf1a
20 changed files with 241 additions and 281 deletions
@@ -7,7 +7,6 @@
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
@@ -33,7 +32,7 @@ const ProjectUpdateHandler = {
lastUpdated: lastUpdatedAt || new Date().getTime(),
lastUpdatedBy,
}
return Project.updateOne(conditions, update, {}, callback)
Project.updateOne(conditions, update, {}, callback)
},
// like markAsUpdated but allows lastUpdatedAt to be reset to earlier time
@@ -53,13 +52,13 @@ const ProjectUpdateHandler = {
lastUpdated: lastUpdatedAt || new Date().getTime(),
lastUpdatedBy,
}
return Project.updateOne(conditions, update, {}, callback)
Project.updateOne(conditions, update, {}, callback)
},
markAsOpened(project_id, callback) {
const conditions = { _id: project_id }
const update = { lastOpened: Date.now() }
return Project.updateOne(conditions, update, {}, function (err) {
Project.updateOne(conditions, update, {}, function (err) {
if (callback != null) {
return callback()
}
@@ -69,7 +68,7 @@ const ProjectUpdateHandler = {
markAsInactive(project_id, callback) {
const conditions = { _id: project_id }
const update = { active: false }
return Project.updateOne(conditions, update, {}, function (err) {
Project.updateOne(conditions, update, {}, function (err) {
if (callback != null) {
return callback()
}
@@ -79,7 +78,7 @@ const ProjectUpdateHandler = {
markAsActive(project_id, callback) {
const conditions = { _id: project_id }
const update = { active: true }
return Project.updateOne(conditions, update, {}, function (err) {
Project.updateOne(conditions, update, {}, function (err) {
if (callback != null) {
return callback()
}