update more ENVIRONMENT_IS_* calls after merge, update some test paths, comments. Remove vulnerability

This commit is contained in:
d98762625 2019-07-05 11:35:59 +01:00
parent 368f508b17
commit e03ff22ba8
10 changed files with 31 additions and 19 deletions

View file

@ -1154,17 +1154,24 @@ class Utils {
/**
* Check whether the code is running in a Node.js environment
* @returns {boolean}
*/
export function isNodeEnvironment() {
return typeof process !== "undefined" && process.versions != null && process.versions.node != null;
}
/** */
/**
* Check whether the code is running in a web environment
* @returns {boolean}
*/
export function isWebEnvironment() {
return typeof window === "object";
}
/** */
/**
* Check whether the code is running in a worker
* @returns {boolean}
*/
export function isWorkerEnvironment() {
return typeof importScripts === "function";
}