UNPKG

697 BJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.getJson = void 0;
7const axios_1 = __importDefault(require("axios"));
8const js_yaml_1 = __importDefault(require("js-yaml"));
9async function getJson(url) {
10 process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
11 const { data } = await axios_1.default.get(url);
12 // if url is yaml file convert it to json
13 if (typeof data === "object") {
14 return data;
15 }
16 return js_yaml_1.default.load(data);
17}
18exports.getJson = getJson;
19//# sourceMappingURL=getJson.js.map
\No newline at end of file