diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-10-14 13:24:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 13:24:58 +0200 |
commit | fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e (patch) | |
tree | 10caa332d957421e982c7ddd0c94623d5d62314d /src/helpers | |
parent | chore: convert various JS to TS (#2062) (diff) | |
download | ferdium-app-fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e.tar.gz ferdium-app-fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e.tar.zst ferdium-app-fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e.zip |
chore: convert files to TS (#2066)
Diffstat (limited to 'src/helpers')
-rw-r--r-- | src/helpers/password-helpers.ts | 6 | ||||
-rw-r--r-- | src/helpers/userAgent-helpers.ts | 11 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/helpers/password-helpers.ts b/src/helpers/password-helpers.ts index e5d9a4a25..053321bbf 100644 --- a/src/helpers/password-helpers.ts +++ b/src/helpers/password-helpers.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import crypto from 'crypto'; | 1 | import { createHash, BinaryLike } from 'crypto'; |
2 | 2 | ||
3 | export function hash(password: crypto.BinaryLike) { | 3 | export function hash(password: BinaryLike) { |
4 | return crypto.createHash('sha256').update(password).digest('base64'); | 4 | return createHash('sha256').update(password).digest('base64'); |
5 | } | 5 | } |
6 | 6 | ||
7 | export function scorePassword(password: string) { | 7 | export function scorePassword(password: string) { |
diff --git a/src/helpers/userAgent-helpers.ts b/src/helpers/userAgent-helpers.ts index 091a76400..c1e8e02da 100644 --- a/src/helpers/userAgent-helpers.ts +++ b/src/helpers/userAgent-helpers.ts | |||
@@ -1,13 +1,18 @@ | |||
1 | import os from 'os'; | 1 | import { cpus } from 'os'; |
2 | import macosVersion from 'macos-version'; | 2 | import macosVersion from 'macos-version'; |
3 | import { chrome } from 'useragent-generator'; | 3 | import { chrome } from 'useragent-generator'; |
4 | import { | 4 | import { |
5 | chromeVersion, isMac, isWindows, is64Bit, osArch, osRelease, | 5 | chromeVersion, |
6 | isMac, | ||
7 | isWindows, | ||
8 | is64Bit, | ||
9 | osArch, | ||
10 | osRelease, | ||
6 | } from '../environment'; | 11 | } from '../environment'; |
7 | 12 | ||
8 | function macOS() { | 13 | function macOS() { |
9 | const version = macosVersion() || ''; | 14 | const version = macosVersion() || ''; |
10 | let cpuName = os.cpus()[0].model.split(' ')[0]; | 15 | let cpuName = cpus()[0].model.split(' ')[0]; |
11 | if (cpuName && /\(/.test(cpuName)) { | 16 | if (cpuName && /\(/.test(cpuName)) { |
12 | cpuName = cpuName.split('(')[0]; | 17 | cpuName = cpuName.split('(')[0]; |
13 | } | 18 | } |