"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getJSON = getJSON;
const tslib_1 = require("tslib");
const https_1 = tslib_1.__importDefault(require("https"));
const options = {
    headers: {
        'User-Agent': `coc-go`,
    }
};
function getJSON(url) {
    return new Promise((resolve, reject) => {
        https_1.default.get(url, options, (res) => {
            let body = '';
            res.on('data', (chunk) => (body += chunk));
            res.on('end', () => {
                try {
                    resolve(JSON.parse(body));
                }
                catch (err) {
                    reject(err);
                }
            });
        }).on('error', reject);
    });
}
//# sourceMappingURL=request.js.map