UNPKG

793 BPlain TextView Raw
1// DOM Parser polyfill ---
2import { root } from "@hpcc-js/util";
3import { DOMParser } from "xmldom";
4root.DOMParser = DOMParser;
5
6// fetch polyfill ---
7import fetch from "node-fetch";
8if (typeof root.fetch === "undefined") {
9 root.fetch = fetch;
10
11 // eslint-disable-next-line @typescript-eslint/no-var-requires
12 const https = require("https");
13 root.fetch.__agent = new https.Agent({
14 rejectUnauthorized: false
15 });
16}
17
18// btoa polyfill ---
19import { Buffer } from "safe-buffer";
20if (typeof root.btoa === "undefined") {
21 root.btoa = function (str: string) {
22 return Buffer.from(str || "", "utf8").toString("base64");
23 };
24}
25
26export * from "./index-common";
27
28// Client Tools ---
29export * from "./clienttools/eclcc";
30export * from "./clienttools/eclMeta";