MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / isNativeFunction

Function isNativeFunction

packages/core/src/utils/supports.ts:96–98  ·  view source on GitHub ↗
(func: Function)

Source from the content-addressed store, hash-verified

94 */
95// eslint-disable-next-line @typescript-eslint/ban-types
96export function isNativeFunction(func: Function): boolean {
97 return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString());
98}
99
100/**
101 * Tells whether current environment supports Fetch API natively

Callers 2

getNativeImplementationFunction · 0.90
supportsNativeFetchFunction · 0.85

Calls 2

testMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected