This commit is contained in:
TheNetsky
2023-10-19 22:09:05 +02:00
parent 2366a3dd7f
commit e195f973cd
15 changed files with 81 additions and 34 deletions

View File

@@ -1,7 +1,9 @@
import * as fs from 'fs'
import path from 'path'
export async function loadAccounts() {
import { Account } from '../interface/Account'
export async function loadAccounts(): Promise<Account[]> {
try {
let file = 'accounts.json'

View File

@@ -81,7 +81,7 @@ export async function getEdgeVersions() {
export function getSystemComponents(mobile: boolean): string {
const osId: string = mobile ? 'Linux' : 'Windows NT 10.0'
const uaPlatform: string = mobile ? 'Android 10' : 'Win64; x64'
const uaPlatform: string = mobile ? 'Android 13' : 'Win64; x64'
if (mobile) {
return `${uaPlatform}; ${osId}; K`
@@ -90,7 +90,6 @@ export function getSystemComponents(mobile: boolean): string {
return `${uaPlatform}; ${osId}`
}
export async function getAppComponents(mobile: boolean) {
const versions = await getEdgeVersions()
const edgeVersion = mobile ? versions.android : versions.windows as string

View File

@@ -4,7 +4,7 @@ export async function wait(ms: number): Promise<void> {
})
}
export function getFormattedDate(ms = Date.now()) {
export function getFormattedDate(ms = Date.now()): string {
const today = new Date(ms)
const month = String(today.getMonth() + 1).padStart(2, '0') // January is 0
const day = String(today.getDate()).padStart(2, '0')
@@ -21,7 +21,7 @@ export function shuffleArray<T>(array: T[]): T[] {
return shuffledArray
}
export function randomNumber(min: number, max: number) {
export function randomNumber(min: number, max: number): number {
return Math.floor(Math.random() * (max - min + 1)) + min
}