Sha256: b7168823ed0f9bdcb994b06c9b86aa9743b0077e09e3ea7c764e6d3fd9722781
Contents?: true
Size: 553 Bytes
Versions: 26
Compression:
Stored size: 553 Bytes
Contents
/** * Returns the source object of the given property on the target object * (the target itself, any parent in its prototype, or null). */ export function findPropertySource( target: object, propertyName: string | symbol ): object | null { if (!(propertyName in target)) { return null } const hasProperty = Object.prototype.hasOwnProperty.call(target, propertyName) if (hasProperty) { return target } const prototype = Reflect.getPrototypeOf(target) return prototype ? findPropertySource(prototype, propertyName) : null }
Version data entries
26 entries across 26 versions & 1 rubygems