* Given an object and a property name, checks whether the property has a getter, if not checks whether its * value is a proxy. * * Note: the order is relevant here, we want to check whether the property has a getter _before_ we check * whether its value is a proxy, to ensure that is the pr
(obj, prop, cb)
| 781 | * @returns {void} |
| 782 | */ |
| 783 | function propHasGetterOrIsProxy(obj, prop, cb) { |
| 784 | const propDescriptor = ObjectGetOwnPropertyDescriptor( |
| 785 | obj, |
| 786 | prop, |
| 787 | ); |
| 788 | const propHasGetter = typeof propDescriptor?.get === 'function'; |
| 789 | if (propHasGetter) { |
| 790 | return cb(true); |
| 791 | } |
| 792 | |
| 793 | if (isProxy(obj[prop])) { |
| 794 | return cb(true); |
| 795 | } |
| 796 | |
| 797 | return cb(false); |
| 798 | } |
| 799 | |
| 800 | module.exports = { |
| 801 | complete, |
no test coverage detected
searching dependent graphs…