Archived
1
0

Add doc/guide.md

This commit is contained in:
Anmol Sethi
2020-05-14 03:17:17 -04:00
parent f4a78587b0
commit a0a77e379e
11 changed files with 537 additions and 74 deletions

View File

@ -98,7 +98,7 @@
<script data-cfasync="false" src="{{BASE}}/static/{{COMMIT}}/lib/vscode/out/vs/workbench/workbench.web.api.js"></script>
END_PROD_ONLY -->
<script>
require(["vs/code/browser/workbench/workbench"], function() {})
require(["vs/code/browser/workbench/workbench"], function () {})
</script>
<script>
try {

View File

@ -8,7 +8,7 @@ if ("serviceWorker" in navigator) {
.register(path, {
scope: options.base || "/",
})
.then(function() {
.then(function () {
console.log("[Service Worker] registered")
})
}

View File

@ -81,10 +81,7 @@ export const generatePassword = async (length = 24): Promise<string> => {
}
export const hash = (str: string): string => {
return crypto
.createHash("sha256")
.update(str)
.digest("hex")
return crypto.createHash("sha256").update(str).digest("hex")
}
const mimeTypes: { [key: string]: string } = {
@ -150,11 +147,7 @@ export const getMediaMime = (filePath?: string): string => {
export const isWsl = async (): Promise<boolean> => {
return (
(process.platform === "linux" &&
os
.release()
.toLowerCase()
.indexOf("microsoft") !== -1) ||
(process.platform === "linux" && os.release().toLowerCase().indexOf("microsoft") !== -1) ||
(await fs.readFile("/proc/version", "utf8")).toLowerCase().indexOf("microsoft") !== -1
)
}

View File

@ -38,7 +38,7 @@ export class IpcMain {
// Ensure we control when the process exits.
this.exit = process.exit
process.exit = function(code?: number) {
process.exit = function (code?: number) {
logger.warn(`process.exit() was prevented: ${code || "unknown code"}.`)
} as (code?: number) => never