import http from 'http'; export class Response extends http.IncomingMessage { body?: string; } export function get ( headers: http.OutgoingHttpHeaders = {} ): Promise { return new Promise ((resolve) => { http.get ('http://localhost:3000', { headers }, (res: Response) => { let body = ''; res.on ('data', (d) => { body += d; }); res.on ('end', () => { res.body = body; resolve (res); }); }); }); } export function modify_signature (signature: string): string { const dec = signature.split ('.'); dec[1] = ''; return dec.join ('.'); }