export const paramsToString = (obj: T) => { return Object.entries(obj).reduce((acc, [key, value], idx, arr) => { if (idx === 0) { acc.concat('?'); } acc = acc.concat(`${key}=${value}`); if (idx !== arr.length - 1) { acc.concat('&'); } return acc; }, '?'); }; export const isBrowser = () => { if (typeof process === 'object' && process + '' === '[object process]') { return false; } else { return true; } }; export const undocumentedResponse = (resp: Response) => `Undocumented status code response: ${resp.status} ${resp.statusText}`;