From d156ee31b067969b6d53d79f25a3f7937500e193 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 21 Oct 2023 00:07:46 -0700 Subject: [PATCH] [Refactor] use `hasown` instead of `has` --- lib/extend.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/extend.js b/lib/extend.js index 5df4f76..872d441 100644 --- a/lib/extend.js +++ b/lib/extend.js @@ -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; @@ -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 diff --git a/package.json b/package.json index b481b1d..6e4fe16 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ], "author": "dreamerslab ", "dependencies": { - "has": "^1.0.3", + "hasown": "^2.0.0", "is": "^3.3.0" }, "devDependencies": {