MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getPropertyDescriptor

Function getPropertyDescriptor

packages/core/src/utils/clone.ts:13–26  ·  view source on GitHub ↗

* Get the property descriptor of a property on an object or its prototype chain. * * @param obj - The object to get the property descriptor from. * @param prop - The property to get the descriptor for.

(obj: T, prop: keyof T)

Source from the content-addressed store, hash-verified

11 * @param prop - The property to get the descriptor for.
12 */
13function getPropertyDescriptor<T>(obj: T, prop: keyof T): PropertyDescriptor | null {
14 const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
15
16 if (descriptor) {
17 return descriptor;
18 }
19
20 const proto = Object.getPrototypeOf(obj);
21 if (proto) {
22 return getPropertyDescriptor(proto, prop);
23 }
24
25 return null;
26}
27
28const TypedArray = Object.getPrototypeOf(Uint8Array);
29

Callers 1

_cloneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected