Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

has-own-prop

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-own-prop - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

10

index.d.ts

@@ -6,13 +6,11 @@ /**

```
import hasOwnProp = require('has-own-prop');
import hasOwnProperty from 'has-own-prop';
hasOwnProp({}, 'hello');
hasOwnProperty({}, 'hello');
//=> false
hasOwnProp([1, 2, 3], 0);
hasOwnProperty([1, 2, 3], 0);
//=> true
```
*/
declare function hasOwnProp(object: unknown, key: string | number | symbol): boolean;
export = hasOwnProp;
export default function hasOwnProperty(object: unknown, key: string | number | symbol): boolean;

7

index.js

@@ -1,4 +0,5 @@

'use strict';
const hasOwnProp = Object.prototype.hasOwnProperty;
const has = Object.prototype.hasOwnProperty;
module.exports = (object, property) => hasOwnProp.call(object, property);
export default function hasOwnProperty(object, property) {
return has.call(object, property);
}
{
"name": "has-own-prop",
"version": "2.0.0",
"version": "3.0.0",
"description": "A safer `.hasOwnProperty()`",
"license": "MIT",
"repository": "sindresorhus/has-own-prop",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -29,6 +32,6 @@ "scripts": {

"devDependencies": {
"ava": "^2.1.0",
"tsd": "^0.7.3",
"xo": "^0.24.0"
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
}
}

@@ -1,2 +0,2 @@

# has-own-prop [![Build Status](https://travis-ci.org/sindresorhus/has-own-prop.svg?branch=master)](https://travis-ci.org/sindresorhus/has-own-prop)
# has-own-prop

@@ -9,14 +9,12 @@ > A safer `.hasOwnProperty()`

## Install
```sh
npm install has-own-prop
```
$ npm install has-own-prop
```
## Usage
```js
const hasOwnProp = require('has-own-prop');
import hasOwnProperty from 'has-own-prop';

@@ -29,4 +27,4 @@ const object = Object.create(null);

hasOwnProp(object, 'unicorn');
hasOwnProperty(object, 'unicorn');
//=> true
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc