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

@ -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
)
}