improving browser detection

This commit is contained in:
Fabian Stamm
2019-03-08 21:48:21 -05:00
parent c63ff06453
commit 92dba5274e
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import { Observable, Lock } from "@hibas123/utils";
//this references global on node and window in browser
const fetch = this.fetch ? this.fetch : require("cross-fetch").default;
const fetch = typeof window !== "undefined" && typeof window.fetch !== undefined ? window.fetch : require("cross-fetch").default;
export interface IFileVersion {
version: string;