Skip to content

Commit d939332

Browse files
committed
[Refactor] use hasown
1 parent 8c9aedf commit d939332

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
var callBound = require('call-bind/callBound');
44
var hasToStringTag = require('has-tostringtag/shams')();
5-
var has;
5+
var hasOwn = require('hasown');
66
var $exec;
77
var isRegexMarker;
88
var badStringifier;
99

1010
if (hasToStringTag) {
11-
has = callBound('Object.prototype.hasOwnProperty');
1211
$exec = callBound('RegExp.prototype.exec');
1312
isRegexMarker = {};
1413

@@ -37,7 +36,7 @@ module.exports = hasToStringTag
3736
}
3837

3938
var descriptor = gOPD(value, 'lastIndex');
40-
var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
39+
var hasLastIndexDataProperty = descriptor && hasOwn(descriptor, 'value');
4140
if (!hasLastIndexDataProperty) {
4241
return false;
4342
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
],
4242
"dependencies": {
4343
"call-bind": "^1.0.7",
44-
"has-tostringtag": "^1.0.2"
44+
"has-tostringtag": "^1.0.2",
45+
"hasown": "^2.0.2"
4546
},
4647
"devDependencies": {
4748
"@ljharb/eslint-config": "^21.1.1",

0 commit comments

Comments
 (0)