Skip to content

Commit

Permalink
[Robustness] switch to hasown
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 26, 2023
1 parent eee138d commit aa48e2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
@@ -1,6 +1,7 @@
'use strict';

var typeOf = require('kind-of');
var hasOwn = require('hasown');

module.exports = function isDataDescriptor(obj, prop) {
// data descriptor properties
Expand All @@ -26,7 +27,7 @@ module.exports = function isDataDescriptor(obj, prop) {
for (var key in obj) { // eslint-disable-line no-restricted-syntax
if (
key !== 'value'
&& Object.prototype.hasOwnProperty.call(data, key)
&& hasOwn(data, key)
&& typeOf(obj[key]) !== data[key]
&& typeof obj[key] !== 'undefined'
) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -54,6 +54,7 @@
"Rouven Weßling (www.rouvenwessling.de)"
],
"dependencies": {
"hasown": "^2.0.0",
"kind-of": "^6.0.3"
},
"devDependencies": {
Expand Down

0 comments on commit aa48e2f

Please sign in to comment.