mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 02:13:35 -05:00
remove unnecessary returns and callbacks
This commit is contained in:
parent
8c791b2938
commit
43cab1fddc
1 changed files with 6 additions and 40 deletions
|
@ -1,15 +1,5 @@
|
||||||
/* eslint-disable
|
/* eslint-disable
|
||||||
camelcase,
|
camelcase,
|
||||||
handle-callback-err,
|
|
||||||
no-unused-vars,
|
|
||||||
*/
|
|
||||||
// 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
|
|
||||||
* DS207: Consider shorter variations of null checks
|
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
||||||
*/
|
*/
|
||||||
let DocstoreClient
|
let DocstoreClient
|
||||||
const request = require('request').defaults({ jar: false })
|
const request = require('request').defaults({ jar: false })
|
||||||
|
@ -33,9 +23,6 @@ async function getStringFromPersistor(persistor, bucket, key) {
|
||||||
|
|
||||||
module.exports = DocstoreClient = {
|
module.exports = DocstoreClient = {
|
||||||
createDoc(project_id, doc_id, lines, version, ranges, callback) {
|
createDoc(project_id, doc_id, lines, version, ranges, callback) {
|
||||||
if (callback == null) {
|
|
||||||
callback = function (error) {}
|
|
||||||
}
|
|
||||||
return DocstoreClient.updateDoc(
|
return DocstoreClient.updateDoc(
|
||||||
project_id,
|
project_id,
|
||||||
doc_id,
|
doc_id,
|
||||||
|
@ -47,10 +34,7 @@ module.exports = DocstoreClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getDoc(project_id, doc_id, qs, callback) {
|
getDoc(project_id, doc_id, qs, callback) {
|
||||||
if (callback == null) {
|
request.get(
|
||||||
callback = function (error, res, body) {}
|
|
||||||
}
|
|
||||||
return request.get(
|
|
||||||
{
|
{
|
||||||
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc/${doc_id}`,
|
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc/${doc_id}`,
|
||||||
json: true,
|
json: true,
|
||||||
|
@ -82,10 +66,7 @@ module.exports = DocstoreClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getAllDocs(project_id, callback) {
|
getAllDocs(project_id, callback) {
|
||||||
if (callback == null) {
|
request.get(
|
||||||
callback = function (error, res, body) {}
|
|
||||||
}
|
|
||||||
return request.get(
|
|
||||||
{
|
{
|
||||||
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc`,
|
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc`,
|
||||||
json: true,
|
json: true,
|
||||||
|
@ -113,10 +94,7 @@ module.exports = DocstoreClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getAllRanges(project_id, callback) {
|
getAllRanges(project_id, callback) {
|
||||||
if (callback == null) {
|
request.get(
|
||||||
callback = function (error, res, body) {}
|
|
||||||
}
|
|
||||||
return request.get(
|
|
||||||
{
|
{
|
||||||
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/ranges`,
|
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/ranges`,
|
||||||
json: true,
|
json: true,
|
||||||
|
@ -126,9 +104,6 @@ module.exports = DocstoreClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
updateDoc(project_id, doc_id, lines, version, ranges, callback) {
|
updateDoc(project_id, doc_id, lines, version, ranges, callback) {
|
||||||
if (callback == null) {
|
|
||||||
callback = function (error, res, body) {}
|
|
||||||
}
|
|
||||||
return request.post(
|
return request.post(
|
||||||
{
|
{
|
||||||
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc/${doc_id}`,
|
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc/${doc_id}`,
|
||||||
|
@ -183,10 +158,7 @@ module.exports = DocstoreClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
archiveAllDoc(project_id, callback) {
|
archiveAllDoc(project_id, callback) {
|
||||||
if (callback == null) {
|
request.post(
|
||||||
callback = function (error, res, body) {}
|
|
||||||
}
|
|
||||||
return request.post(
|
|
||||||
{
|
{
|
||||||
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/archive`,
|
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/archive`,
|
||||||
},
|
},
|
||||||
|
@ -195,10 +167,7 @@ module.exports = DocstoreClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
archiveDocById(project_id, doc_id, callback) {
|
archiveDocById(project_id, doc_id, callback) {
|
||||||
if (callback == null) {
|
request.post(
|
||||||
callback = function (error, res, body) {}
|
|
||||||
}
|
|
||||||
return request.post(
|
|
||||||
{
|
{
|
||||||
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc/${doc_id}/archive`,
|
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/doc/${doc_id}/archive`,
|
||||||
},
|
},
|
||||||
|
@ -207,10 +176,7 @@ module.exports = DocstoreClient = {
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyAllDoc(project_id, callback) {
|
destroyAllDoc(project_id, callback) {
|
||||||
if (callback == null) {
|
request.post(
|
||||||
callback = function (error, res, body) {}
|
|
||||||
}
|
|
||||||
return request.post(
|
|
||||||
{
|
{
|
||||||
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/destroy`,
|
url: `http://localhost:${settings.internal.docstore.port}/project/${project_id}/destroy`,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue