Fix isNode method to return true in Electron apps

This commit is contained in:
Kamil Pajdzik 2019-05-07 09:25:05 -07:00
Родитель e7fa52ff13
Коммит d5a12859b8
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -10,7 +10,7 @@ import { Constants } from "./constants";
/**
* A constant that indicates whether the environment is node.js or browser based.
*/
export const isNode = typeof navigator === "undefined" && typeof process !== "undefined";
export const isNode = (typeof process !== "undefined") && !!process.version && !!process.versions && !!process.versions.node;
/**
* Checks if a parsed URL is HTTPS

Просмотреть файл

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-js"
},
"version": "1.8.2",
"version": "1.8.3",
"description": "Isomorphic client Runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest",
"tags": [
"isomorphic",