lint: Run eslint --fix on src/

This commit is contained in:
Richard Hansen 2020-11-23 13:24:19 -05:00 committed by John McLear
parent b8d07a42eb
commit 8e5fd19db2
109 changed files with 9061 additions and 10572 deletions

View file

@ -15,41 +15,39 @@
*/
let db = require("../db/DB");
let hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
const db = require('../db/DB');
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
exports.getPadRaw = async function(padId) {
exports.getPadRaw = async function (padId) {
const padKey = `pad:${padId}`;
const padcontent = await db.get(padKey);
let padKey = "pad:" + padId;
let padcontent = await db.get(padKey);
let records = [ padKey ];
const records = [padKey];
for (let i = 0; i <= padcontent.head; i++) {
records.push(padKey + ":revs:" + i);
records.push(`${padKey}:revs:${i}`);
}
for (let i = 0; i <= padcontent.chatHead; i++) {
records.push(padKey + ":chat:" + i);
records.push(`${padKey}:chat:${i}`);
}
let data = {};
for (let key of records) {
const data = {};
for (const key of records) {
// For each piece of info about a pad.
let entry = data[key] = await db.get(key);
const entry = data[key] = await db.get(key);
// Get the Pad Authors
if (entry.pool && entry.pool.numToAttrib) {
let authors = entry.pool.numToAttrib;
const authors = entry.pool.numToAttrib;
for (let k of Object.keys(authors)) {
if (authors[k][0] === "author") {
let authorId = authors[k][1];
for (const k of Object.keys(authors)) {
if (authors[k][0] === 'author') {
const authorId = authors[k][1];
// Get the author info
let authorEntry = await db.get("globalAuthor:" + authorId);
const authorEntry = await db.get(`globalAuthor:${authorId}`);
if (authorEntry) {
data["globalAuthor:" + authorId] = authorEntry;
data[`globalAuthor:${authorId}`] = authorEntry;
if (authorEntry.padIDs) {
authorEntry.padIDs = padId;
}
@ -68,4 +66,4 @@ exports.getPadRaw = async function(padId) {
}));
return data;
}
};