@sentry/utils
Advanced tools
Comparing version 8.3.0 to 8.4.0
@@ -145,3 +145,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.truncate = string.truncate; | ||
exports.isNativeFetch = supports.isNativeFetch; | ||
exports.isNativeFunction = supports.isNativeFunction; | ||
exports.supportsDOMError = supports.supportsDOMError; | ||
@@ -148,0 +148,0 @@ exports.supportsDOMException = supports.supportsDOMException; |
@@ -77,8 +77,9 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
} | ||
/** | ||
* isNativeFetch checks if the given function is a native implementation of fetch() | ||
* isNative checks if the given function is a native implementation | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
function isNativeFetch(func) { | ||
return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); | ||
function isNativeFunction(func) { | ||
return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); | ||
} | ||
@@ -103,3 +104,3 @@ | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
if (isNativeFetch(WINDOW.fetch)) { | ||
if (isNativeFunction(WINDOW.fetch)) { | ||
return true; | ||
@@ -120,3 +121,3 @@ } | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
result = isNativeFetch(sandbox.contentWindow.fetch); | ||
result = isNativeFunction(sandbox.contentWindow.fetch); | ||
} | ||
@@ -169,3 +170,3 @@ doc.head.removeChild(sandbox); | ||
exports.isNativeFetch = isNativeFetch; | ||
exports.isNativeFunction = isNativeFunction; | ||
exports.supportsDOMError = supportsDOMError; | ||
@@ -172,0 +173,0 @@ exports.supportsDOMException = supportsDOMException; |
@@ -26,3 +26,3 @@ export { applyAggregateErrorsToEvent } from './aggregate-errors.js'; | ||
export { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate } from './string.js'; | ||
export { isNativeFetch, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver } from './supports.js'; | ||
export { isNativeFunction, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver } from './supports.js'; | ||
export { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './syncpromise.js'; | ||
@@ -29,0 +29,0 @@ export { _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds } from './time.js'; |
@@ -75,8 +75,9 @@ import { DEBUG_BUILD } from './debug-build.js'; | ||
} | ||
/** | ||
* isNativeFetch checks if the given function is a native implementation of fetch() | ||
* isNative checks if the given function is a native implementation | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
function isNativeFetch(func) { | ||
return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); | ||
function isNativeFunction(func) { | ||
return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); | ||
} | ||
@@ -101,3 +102,3 @@ | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
if (isNativeFetch(WINDOW.fetch)) { | ||
if (isNativeFunction(WINDOW.fetch)) { | ||
return true; | ||
@@ -118,3 +119,3 @@ } | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
result = isNativeFetch(sandbox.contentWindow.fetch); | ||
result = isNativeFunction(sandbox.contentWindow.fetch); | ||
} | ||
@@ -167,3 +168,3 @@ doc.head.removeChild(sandbox); | ||
export { isNativeFetch, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver }; | ||
export { isNativeFunction, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver }; | ||
//# sourceMappingURL=supports.js.map |
{ | ||
"name": "@sentry/utils", | ||
"version": "8.3.0", | ||
"version": "8.4.0", | ||
"description": "Utilities for all Sentry JavaScript SDKs", | ||
@@ -45,3 +45,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/types": "8.3.0" | ||
"@sentry/types": "8.4.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
@@ -31,5 +31,5 @@ export { supportsHistory } from './vendor/supportsHistory'; | ||
/** | ||
* isNativeFetch checks if the given function is a native implementation of fetch() | ||
* isNative checks if the given function is a native implementation | ||
*/ | ||
export declare function isNativeFetch(func: Function): boolean; | ||
export declare function isNativeFunction(func: Function): boolean; | ||
/** | ||
@@ -36,0 +36,0 @@ * Tells whether current environment supports Fetch API natively |
@@ -31,5 +31,5 @@ export { supportsHistory } from './vendor/supportsHistory'; | ||
/** | ||
* isNativeFetch checks if the given function is a native implementation of fetch() | ||
* isNative checks if the given function is a native implementation | ||
*/ | ||
export declare function isNativeFetch(func: Function): boolean; | ||
export declare function isNativeFunction(func: Function): boolean; | ||
/** | ||
@@ -36,0 +36,0 @@ * Tells whether current environment supports Fetch API natively |
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
1120242
+ Added@sentry/types@8.4.0(transitive)
- Removed@sentry/types@8.3.0(transitive)
Updated@sentry/types@8.4.0