has-own-prop
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -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; |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2854
Yes
29