UNPKG

@elsikora/nestjs-crud-automator

Version:

A library for automating the creation of CRUD operations in NestJS.

23 lines (20 loc) 763 B
'use strict'; /** * Finds the nearest own descriptor for a property across an object's prototype chain. * @param {object} source - Object whose chain is inspected. * @param {PropertyKey} key - Property key to resolve. * @returns {PropertyDescriptor | undefined} Nearest descriptor, if present. */ function ObjectFindPropertyDescriptor(source, key) { let current = source; while (current) { const descriptor = Object.getOwnPropertyDescriptor(current, key); if (descriptor) { return descriptor; } current = Object.getPrototypeOf(current); } return undefined; } exports.ObjectFindPropertyDescriptor = ObjectFindPropertyDescriptor; //# sourceMappingURL=object-find-property-descriptor.utility.js.map