Просмотр исходного кода

decaffeinate: Run post-processing cleanups on DocArchiveManager.coffee and 7 other files

decaffeinate 6 лет назад
Родитель
Сommit
d31a747c72

+ 7 - 0
services/docstore/app/coffee/DocArchiveManager.js

@@ -1,3 +1,10 @@
+/* eslint-disable
+    camelcase,
+    handle-callback-err,
+    no-useless-escape,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
  * decaffeinate suggestions:
  * DS102: Remove unnecessary code created because of implicit returns

+ 9 - 0
services/docstore/app/coffee/DocManager.js

@@ -1,3 +1,12 @@
+/* eslint-disable
+    camelcase,
+    handle-callback-err,
+    no-dupe-keys,
+    no-undef,
+    standard/no-callback-literal,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
  * decaffeinate suggestions:
  * DS102: Remove unnecessary code created because of implicit returns

+ 6 - 0
services/docstore/app/coffee/Errors.js

@@ -1,3 +1,9 @@
+/* eslint-disable
+    no-proto,
+    no-unused-vars,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 let Errors;
 var NotFoundError = function(message) {
 	const error = new Error(message);

+ 6 - 0
services/docstore/app/coffee/HealthChecker.js

@@ -1,3 +1,9 @@
+/* eslint-disable
+    camelcase,
+    standard/no-callback-literal,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
  * decaffeinate suggestions:
  * DS102: Remove unnecessary code created because of implicit returns

+ 9 - 2
services/docstore/app/coffee/HttpController.js

@@ -1,3 +1,10 @@
+/* eslint-disable
+    camelcase,
+    handle-callback-err,
+    valid-typeof,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
  * decaffeinate suggestions:
  * DS101: Remove unnecessary use of Array.from
@@ -150,7 +157,7 @@ module.exports = (HttpController = {
 
 	_buildDocView(doc) { 
 		const doc_view = { _id: (doc._id != null ? doc._id.toString() : undefined) };
-		for (let attribute of ["lines", "rev", "version", "ranges", "deleted"]) {
+		for (const attribute of ["lines", "rev", "version", "ranges", "deleted"]) {
 			if (doc[attribute] != null) {
 				doc_view[attribute] = doc[attribute];
 			}
@@ -164,7 +171,7 @@ module.exports = (HttpController = {
 	
 	_buildDocsArrayView(project_id, docs) {
 		const docViews = [];
-		for (let doc of Array.from(docs)) {
+		for (const doc of Array.from(docs)) {
 			if (doc != null) { // There can end up being null docs for some reason :( (probably a race condition)
 				docViews.push(HttpController._buildDocView(doc));
 			} else {

+ 10 - 4
services/docstore/app/coffee/MongoManager.js

@@ -1,3 +1,9 @@
+/* eslint-disable
+    camelcase,
+    handle-callback-err,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
  * decaffeinate suggestions:
  * DS102: Remove unnecessary code created because of implicit returns
@@ -46,7 +52,7 @@ module.exports = (MongoManager = {
 				inS3: true
 			}
 		};
-		update.$set["project_id"] = ObjectId(project_id);
+		update.$set.project_id = ObjectId(project_id);
 		return db.docs.update({_id: ObjectId(doc_id)}, update, {upsert: true}, callback);
 	},
 
@@ -64,9 +70,9 @@ module.exports = (MongoManager = {
 			$set: {},
 			$unset: {}
 		};
-		update.$set["inS3"] = true;
-		update.$unset["lines"] = true;
-		update.$unset["ranges"] = true;
+		update.$set.inS3 = true;
+		update.$unset.lines = true;
+		update.$unset.ranges = true;
 		const query = {
 			_id: doc_id,
 			rev

+ 8 - 2
services/docstore/app/coffee/RangeManager.js

@@ -1,3 +1,9 @@
+/* eslint-disable
+    camelcase,
+    no-return-assign,
+*/
+// TODO: This file was created by bulk-decaffeinate.
+// Fix any style issues and re-enable lint.
 /*
  * decaffeinate suggestions:
  * DS101: Remove unnecessary use of Array.from
@@ -37,11 +43,11 @@ module.exports = (RangeManager = {
 			}
 		};
 		
-		for (let change of Array.from(ranges.changes || [])) {
+		for (const change of Array.from(ranges.changes || [])) {
 			change.id = RangeManager._safeObjectId(change.id);
 			updateMetadata(change.metadata);
 		}
-		for (let comment of Array.from(ranges.comments || [])) {
+		for (const comment of Array.from(ranges.comments || [])) {
 			comment.id = RangeManager._safeObjectId(comment.id);
 			if ((comment.op != null ? comment.op.t : undefined) != null) {
 				comment.op.t = RangeManager._safeObjectId(comment.op.t);

+ 2 - 0
services/docstore/app/coffee/mongojs.js

@@ -1,3 +1,5 @@
+// TODO: This file was created by bulk-decaffeinate.
+// Sanity-check the conversion and remove this comment.
 const Settings = require("settings-sharelatex");
 const mongojs = require("mongojs");
 const db = mongojs(Settings.mongo.url, ["docs", "docOps"]);