MCPcopy Create free account
hub / github.com/middleapi/orpc / isNativeFunction

Function isNativeFunction

packages/shared/src/proxy.ts:49–51  ·  view source on GitHub ↗
(fn: unknown)

Source from the content-addressed store, hash-verified

47
48const NATIVE_FUNCTION_REGEX = /^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/
49function isNativeFunction(fn: unknown): fn is AnyFunction {
50 return typeof fn === 'function' && NATIVE_FUNCTION_REGEX.test(fn.toString())
51}
52
53/**
54 * Create a proxy that overlays one object (`overlay`) on top of another (`target`).

Callers 1

applyFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected