Add doc/guide.md
This commit is contained in:
@ -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 {
|
||||
|
@ -8,7 +8,7 @@ if ("serviceWorker" in navigator) {
|
||||
.register(path, {
|
||||
scope: options.base || "/",
|
||||
})
|
||||
.then(function() {
|
||||
.then(function () {
|
||||
console.log("[Service Worker] registered")
|
||||
})
|
||||
}
|
||||
|
@ -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
|
||||
)
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user