This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/client/node_modules/es-abstract/2021/HasProperty.js

19 lines
487 B
JavaScript
Raw Normal View History

2025-06-13 06:04:40 +00:00
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var isPropertyKey = require('../helpers/isPropertyKey');
// https://262.ecma-international.org/6.0/#sec-hasproperty
module.exports = function HasProperty(O, P) {
if (!isObject(O)) {
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;
};