MCPcopy
hub / github.com/facebook/react / isGetter

Function isGetter

packages/shared/ReactSerializationErrors.js:54–64  ·  view source on GitHub ↗
(object: any, name: string)

Source from the content-addressed store, hash-verified

52}
53
54export function isGetter(object: any, name: string): boolean {
55 const ObjectPrototype = Object.prototype;
56 if (object === ObjectPrototype || object === null) {
57 return false;
58 }
59 const descriptor = Object.getOwnPropertyDescriptor(object, name);
60 if (descriptor === undefined) {
61 return isGetter(getPrototypeOf(object), name);
62 }
63 return typeof descriptor.get === 'function';
64}
65
66export function isSimpleObject(object: any): boolean {
67 if (!isObjectPrototype(getPrototypeOf(object))) {

Callers 1

renderDebugModelFunction · 0.90

Calls 1

getPrototypeOfFunction · 0.50

Tested by

no test coverage detected