Skip to content

Commit

Permalink
[Fix] use correct logic for two-arg form
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 26, 2023
1 parent c8de5e7 commit 3c1729e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
@@ -1,5 +1,6 @@
'use strict';

var gOPD = require('gopd');
var typeOf = require('kind-of');

var has = function hasOwn(obj, key) {
Expand All @@ -17,8 +18,7 @@ var accessor = {

module.exports = function isAccessorDescriptor(obj, prop) {
if (typeof prop === 'string') {
var val = Object.getOwnPropertyDescriptor(obj, prop);
return typeof val !== 'undefined';
return gOPD ? isAccessorDescriptor(gOPD(obj, prop)) : has(obj, prop);
}

if (
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -54,6 +54,7 @@
"Jordan Harband <ljharb@gmail.com>"
],
"dependencies": {
"gopd": "^1.0.1",
"kind-of": "^3.0.2"
},
"devDependencies": {
Expand Down

0 comments on commit 3c1729e

Please sign in to comment.