Archived
1
0

Format and lint

This commit is contained in:
Anmol Sethi
2020-02-14 19:46:00 -05:00
parent 80b1b1b672
commit 4aa15401c3
31 changed files with 260 additions and 141 deletions

View File

@ -68,7 +68,7 @@ export class ApiHttpProvider extends HttpProvider {
route: Route,
request: http.IncomingMessage,
socket: net.Socket,
head: Buffer
head: Buffer,
): Promise<true | undefined> {
if (!this.authenticated(request)) {
throw new Error("not authenticated")
@ -120,7 +120,7 @@ export class ApiHttpProvider extends HttpProvider {
route: Route,
request: http.IncomingMessage,
socket: net.Socket,
head: Buffer
head: Buffer,
): Promise<true> {
const sessionId = route.requestPath.replace(/^\//, "")
logger.debug("connecting session", field("sessionId", sessionId))
@ -149,8 +149,8 @@ export class ApiHttpProvider extends HttpProvider {
Buffer.from(
JSON.stringify({
protocol: "TODO",
})
)
}),
),
)
return true

View File

@ -63,7 +63,7 @@ export class MainHttpProvider extends HttpProvider {
base: this.base(route),
logLevel: logger.level,
},
(app && app.name) || ""
(app && app.name) || "",
)
}
@ -80,11 +80,11 @@ export class MainHttpProvider extends HttpProvider {
.replace(/{{APP_LIST:RUNNING}}/g, this.getAppRows(recent.running))
.replace(
/{{APP_LIST:EDITORS}}/g,
this.getAppRows(apps.filter((app) => app.categories && app.categories.includes("Editor")))
this.getAppRows(apps.filter((app) => app.categories && app.categories.includes("Editor"))),
)
.replace(
/{{APP_LIST:OTHER}}/g,
this.getAppRows(apps.filter((app) => !app.categories || !app.categories.includes("Editor")))
this.getAppRows(apps.filter((app) => !app.categories || !app.categories.includes("Editor"))),
)
return response
}

View File

@ -109,7 +109,7 @@ export class LoginHttpProvider extends HttpProvider {
remoteAddress: request.connection.remoteAddress,
userAgent: request.headers["user-agent"],
timestamp: Math.floor(new Date().getTime() / 1000),
})
}),
)
throw new Error("Incorrect password")

View File

@ -102,7 +102,7 @@ export class VscodeHttpProvider extends HttpProvider {
"Upgrade: websocket",
"Connection: Upgrade",
`Sec-WebSocket-Accept: ${reply}`,
].join("\r\n") + "\r\n\r\n"
].join("\r\n") + "\r\n\r\n",
)
const vscode = await this._vscode
@ -146,7 +146,7 @@ export class VscodeHttpProvider extends HttpProvider {
const response = await this.getUtf8Resource(this.vsRootPath, route.requestPath)
response.content = response.content.replace(
/{{COMMIT}}/g,
this.workbenchOptions ? this.workbenchOptions.commit : ""
this.workbenchOptions ? this.workbenchOptions.commit : "",
)
response.cache = true
return response
@ -186,7 +186,7 @@ export class VscodeHttpProvider extends HttpProvider {
settings.lastVisited,
this.args._ && this.args._.length > 0 ? { url: this.args._[0] } : undefined,
],
remoteAuthority
remoteAuthority,
)
const [response, options] = await Promise.all([
await this.getUtf8Resource(this.rootPath, "src/browser/pages/vscode.html"),
@ -229,7 +229,7 @@ export class VscodeHttpProvider extends HttpProvider {
*/
private async getFirstValidPath(
startPaths: Array<{ url?: string | string[]; workspace?: boolean } | undefined>,
remoteAuthority: string
remoteAuthority: string,
): Promise<StartPath | undefined> {
for (let i = 0; i < startPaths.length; ++i) {
const startPath = startPaths[i]