export const sleep = ( ms ) => new Promise ( r => setTimeout ( r , ms ) ) ; export function fromEntries ( iterable ) { return [ ... iterable ] . reduce ( ( obj , [ key , val ] ) => { obj [ key ] = val ; return obj ; } , { } ) ; } export const cookieToObject = ( cookie , splitter = ';' ) => fromEntries ( cookie . split ( splitter ) . map ( x => x . split ( '=' ) ) ) ;