Contents:
- installer.sh
- installer.py
Requirments:
Python3
export function define<T extends {}>(source: T, ...sources: any[]): T { | |
return Object.assign(source, ...sources) as T; | |
} | |
export function assign<T extends {}>(...sources: any[]): T { | |
return Object.assign({}, ...sources) as T; | |
} | |
export function sureAssign<T>( | |
value: T | undefined, |
export class storage { | |
public static canUse(): boolean { | |
return typeof localStorage !== 'undefined'; | |
} | |
public static hasKey(key: string): boolean { | |
return storage.canUse() && localStorage.getItem(key) !== null; | |
} | |
public static getJson<T>(key: string): T | null { |
function typeSafeGetter<V extends object>(o: V) { | |
return function < | |
K extends keyof V, | |
P extends undefined | K = undefined, | |
R = P extends K ? V[P] : V, | |
>(property?: P): R { | |
if (typeof o === 'undefined') throw 'error'; | |
if (typeof property === 'undefined') { | |
return o as never |
function FindProxyForURL(url, host) { | |
var PROXY_LIST_FILE = 'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt'; | |
var TEST_TARGET_URL = 'https://google.com'; | |
var TEST_TIMEOUT = 5000; | |
var proxyList = []; | |
function addProxy(proxy) { | |
if (proxyList.indexOf(proxy) === -1) { | |
proxyList.push(proxy); | |
} |