@sentry/utils
Advanced tools
Comparing version 4.6.1 to 4.6.2
@@ -19,2 +19,3 @@ import { isString } from './is'; | ||
} | ||
const fallbackGlobalObject = {}; | ||
/** | ||
@@ -27,3 +28,9 @@ * Safely get global scope object | ||
export function getGlobalObject() { | ||
return isNodeEnv() ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}; | ||
return isNodeEnv() | ||
? global | ||
: typeof window !== 'undefined' | ||
? window | ||
: typeof self !== 'undefined' | ||
? self | ||
: fallbackGlobalObject; | ||
} | ||
@@ -30,0 +37,0 @@ /** |
@@ -56,3 +56,3 @@ import { isArray, isNaN, isPlainObject, isPrimitive, isUndefined } from './is'; | ||
if (typeof wrapped === 'function') { | ||
wrapped.prototype = {}; | ||
wrapped.prototype = wrapped.prototype || {}; | ||
Object.defineProperties(wrapped, { | ||
@@ -59,0 +59,0 @@ __sentry__: { |
@@ -23,2 +23,3 @@ "use strict"; | ||
exports.isNodeEnv = isNodeEnv; | ||
var fallbackGlobalObject = {}; | ||
/** | ||
@@ -31,3 +32,9 @@ * Safely get global scope object | ||
function getGlobalObject() { | ||
return isNodeEnv() ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}; | ||
return isNodeEnv() | ||
? global | ||
: typeof window !== 'undefined' | ||
? window | ||
: typeof self !== 'undefined' | ||
? self | ||
: fallbackGlobalObject; | ||
} | ||
@@ -34,0 +41,0 @@ exports.getGlobalObject = getGlobalObject; |
@@ -61,3 +61,3 @@ "use strict"; | ||
if (typeof wrapped === 'function') { | ||
wrapped.prototype = {}; | ||
wrapped.prototype = wrapped.prototype || {}; | ||
Object.defineProperties(wrapped, { | ||
@@ -64,0 +64,0 @@ __sentry__: { |
{ | ||
"name": "@sentry/utils", | ||
"version": "4.6.1", | ||
"version": "4.6.2", | ||
"description": "Utilities for all Sentry JavaScript SDKs", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267454
3733