This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import undici from 'undici'; | |
import {parse as parseCookie, Cookie} from 'set-cookie-parser'; | |
export interface IDDoSGuardBypassOptions { | |
url: string; | |
headers?: Record<string, unknown>; | |
fakeMark?: object; | |
} | |
export interface IDDosGuardBypassResult { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates the total experience points required to reach a given level. | |
* | |
* @param {number} lvl - The level to calculate the experience points for. | |
* @return {number} The total experience points required to reach the given level. | |
*/ | |
const getLvlupXpFromLvl = (lvl: number): number => { | |
if (lvl <= 0) return 0; | |
let currXp = 8; | |
for (let i = 1; i < lvl; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Resolver} from 'dns'; | |
export const IPv4ToNumber = (ip: string, le = true) => { | |
const a = ip.split('.'); | |
const buffer = new ArrayBuffer(4); | |
const dv = new DataView(buffer); | |
for (let i = 0; i < 4; i++) | |
dv.setUint8(i, +a[i]); | |
return dv.getUint32(0, le); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios, { AxiosError, AxiosInstance, AxiosResponse } from 'axios'; | |
export class ArizonaAPIError extends Error { | |
name = 'ArizonaAPIError'; | |
} | |
const exportDataField = <T>(res: AxiosResponse<T>) => res.data; | |
const catchAPIError = (v: unknown) => { | |
if ( | |
v instanceof AxiosError && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Colorify | |
* utils that help split string by hex color in lines and partials, that can be used for render | |
* ex.: with spans in html | |
*/ | |
export type LinePart = [string, string]; | |
export type Line = LinePart[] | |
export type TextLines = Line[] |