From 8b94cc153ba580143fe27bab0437199e873e58e3 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 25 Oct 2023 21:54:07 -0700 Subject: [PATCH] [Refactor] use `hasown` --- index.js | 4 +--- package.json | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 14ea004..f901a53 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,6 @@ 'use strict'; -var hasOwn = function (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -}; +var hasOwn = require('hasown'); var isObject = function (val) { return val !== null && typeof val === 'object' && !Array.isArray(val); }; diff --git a/package.json b/package.json index 9820d50..2f10cb8 100644 --- a/package.json +++ b/package.json @@ -80,5 +80,8 @@ "ignore": [ ".github/workflows" ] + }, + "dependencies": { + "hasown": "^2.0.0" } }