1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Krishna Acondy
8192f69f67 fix(*): do not use polyfill when running on Node.js 2020-08-18 08:25:40 +01:00
2 changed files with 6 additions and 1 deletions

View File

@@ -2,7 +2,9 @@ import { isIEorEdgeOrOldFirefox } from "./utils/isIeOrEdge";
import * as e6p from "es6-promise";
(e6p as any).polyfill();
if (isIEorEdgeOrOldFirefox()) {
window.fetch = undefined as any; // ensure the polyfill runs
if (window) {
window.fetch = undefined as any; // ensure the polyfill runs
}
}
// tslint:disable-next-line
require("isomorphic-fetch");

View File

@@ -1,4 +1,7 @@
export function isIEorEdgeOrOldFirefox() {
if (typeof window === "undefined") {
return false;
}
const ua = window.navigator.userAgent;
if (ua.indexOf("Firefox") > 0) {