import * as rq from "./lib/request" ; import { logger } from "./logger" ; export function sleep ( ms ) { return new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ; } export function isNumber ( thing ) { return Number . isFinite ( + thing ) ; } export function clone < T = any > ( arr ) { let i = arr . length ; const res = [ ] ; while ( i -- ) { res [ i ] = arr [ i ] ; } return res ; } export async function request ( url ) { logger . debug ( "request(): requested " + url ) ; const req = await rq . request ( { url , } ) ; return req ; }