# has-own-property-x

> Used to determine whether an object has an own property with the specified property key.

Latest version **4.1.2** (published 2019-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install has-own-property-x
pnpm add has-own-property-x
yarn add has-own-property-x
bun add has-own-property-x
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.2 |
| Published | 2019-08-28 |
| First published | 2015-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8.11.4 |
| Dependencies | 3 |
| Unpacked size | 208.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Graham Fairweather |
| Maintainers | xotic750 |
| Keywords | object, hasOwnProperty, module, javascript, nodejs, browser |

## Links

- npm: https://www.npmjs.com/package/has-own-property-x
- Repository: https://github.com/Xotic750/has-own-property-x
- Issues: https://github.com/Xotic750/has-own-property-x/issues
- npm.io page: https://npm.io/package/has-own-property-x

## Dependencies (3)

- [to-object-x](https://npm.io/package/to-object-x.md) ^2.2.1
- [to-property-key-x](https://npm.io/package/to-property-key-x.md) ^3.1.2
- [simple-methodize-x](https://npm.io/package/simple-methodize-x.md) ^1.0.4

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 4.1.2 (latest) — 2019-08-28
- 4.1.1 — 2019-08-20
- 4.1.0 — 2019-08-14
- 4.0.17 — 2019-07-31
- 4.0.16 — 2019-07-27
- 4.0.15 — 2019-07-27
- 4.0.14 — 2019-07-26
- 4.0.13 — 2019-07-25
- 4.0.12 — 2019-07-24
- 4.0.11 — 2019-07-24
- 4.0.10 — 2019-07-22
- 4.0.9 — 2019-07-21
- 4.0.8 — 2019-07-19
- 4.0.7 — 2019-07-18
- 4.0.6 — 2019-07-18
- … 27 more at https://npm.io/package/has-own-property-x/versions

## README

<a
  href="https://travis-ci.org/Xotic750/has-own-property-x"
  title="Travis status">
<img
  src="https://travis-ci.org/Xotic750/has-own-property-x.svg?branch=master"
  alt="Travis status" height="18">
</a>
<a
  href="https://david-dm.org/Xotic750/has-own-property-x"
  title="Dependency status">
<img src="https://david-dm.org/Xotic750/has-own-property-x/status.svg"
  alt="Dependency status" height="18"/>
</a>
<a
  href="https://david-dm.org/Xotic750/has-own-property-x?type=dev"
  title="devDependency status">
<img src="https://david-dm.org/Xotic750/has-own-property-x/dev-status.svg"
  alt="devDependency status" height="18"/>
</a>
<a
  href="https://badge.fury.io/js/has-own-property-x"
  title="npm version">
<img src="https://badge.fury.io/js/has-own-property-x.svg"
  alt="npm version" height="18">
</a>
<a
  href="https://www.jsdelivr.com/package/npm/has-own-property-x"
  title="jsDelivr hits">
<img src="https://data.jsdelivr.com/v1/package/npm/has-own-property-x/badge?style=rounded"
  alt="jsDelivr hits" height="18">
</a>
<a
  href="https://bettercodehub.com/results/Xotic750/has-own-property-x"
  title="bettercodehub score">
<img src="https://bettercodehub.com/edge/badge/Xotic750/has-own-property-x?branch=master"
  alt="bettercodehub score" height="18">
</a>
<a
  href="https://coveralls.io/github/Xotic750/has-own-property-x?branch=master"
  title="Coverage Status">
<img src="https://coveralls.io/repos/github/Xotic750/has-own-property-x/badge.svg?branch=master"
  alt="Coverage Status" height="18">
</a>

<a name="module_has-own-property-x"></a>

## has-own-property-x

Used to determine whether an object has an own property with the specified property key.

<a name="exp_module_has-own-property-x--module.exports"></a>

### `module.exports(object, property)` ⇒ <code>boolean</code> ⏏

The `hasOwnProperty` method returns a boolean indicating whether
the `object` has the specified `property`. Does not attempt to fix known
issues in older browsers, but does ES6ify the method.

**Kind**: Exported function  
**Returns**: <code>boolean</code> - `true` if the property is set on `object`, else `false`.  
**Throws**:

- <code>TypeError</code> If object is null or undefined.

| Param    | Type                                       | Description                                 |
| -------- | ------------------------------------------ | ------------------------------------------- |
| object   | <code>Object</code>                        | The object to test.                         |
| property | <code>string</code> \| <code>Symbol</code> | The name or Symbol of the property to test. |

**Example**

```js
import hasOwnProperty from 'has-own-property-x';

const o = {
  foo: 'bar',
};

console.log(hasOwnProperty(o, 'bar')); // false
console.log(hasOwnProperty(o, 'foo')); // true
hasOwnProperty(undefined, 'foo'); // TypeError: Cannot convert undefined or null to object
```

---
_Source: https://npm.io/package/has-own-property-x · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
