Skip to content

Commit

Permalink
[Refactor] use hasown instead of has
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 21, 2023
1 parent 0c408e6 commit d156ee3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Port of jQuery.extend that actually works on node.js
*/
var is = require('is');
var has = require('has');
var hasOwn = require('hasown');

var defineProperty = Object.defineProperty;
var gOPD = Object.getOwnPropertyDescriptor;
Expand All @@ -32,7 +32,7 @@ var setProperty = function setP(target, name, value) {
// Return undefined instead of __proto__ if '__proto__' is not an own property
var getProperty = function getP(obj, name) {
if (name === '__proto__') {
if (!has(obj, name)) {
if (!hasOwn(obj, name)) {
return void 0;
} else if (gOPD) {
// In early versions of node, obj['__proto__'] is buggy when obj has
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"author": "dreamerslab <ben@dreamerslab.com>",
"dependencies": {
"has": "^1.0.3",
"hasown": "^2.0.0",
"is": "^3.3.0"
},
"devDependencies": {
Expand Down

0 comments on commit d156ee3

Please sign in to comment.