Urara-Blog/node_modules/.pnpm-store/v3/files/be/d460d25f9cc7524ef02d5305d6fbe803085552dc50dbcc47671fd72fa26841c6a08646b6d23fec0e4f3b0000f766293c8481ca62a1e4d45f43a39634268bad
2022-08-14 01:14:53 +08:00

20 lines
517 B
Text

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
module.exports = function HasProperty(O, P) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: `O` must be an Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: `P` must be a Property Key');
}
return P in O;
};