UNPKG

604 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const expect = require("@fantasticfiasco/expect");
4const request = require("request");
5class HttpClient {
6 get(url) {
7 expect.toExist(url);
8 return new Promise((resolve, reject) => {
9 request.get(url, undefined, (error, _, body) => {
10 if (error) {
11 reject(error);
12 }
13 else {
14 resolve(body);
15 }
16 });
17 });
18 }
19}
20exports.HttpClient = HttpClient;
21//# sourceMappingURL=HttpClient.js.map
\No newline at end of file