Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
has-own-property-x
Advanced tools
Used to determine whether an object has an own property with the specified property key.
Used to determine whether an object has an own property with the specified property key.
module.exports(object, property)
⇒ boolean
⏏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: boolean
- true
if the property is set on object
, else false
.
Throws:
TypeError
If object is null or undefined.Param | Type | Description |
---|---|---|
object | Object | The object to test. |
property | string | Symbol | The name or Symbol of the property to test. |
Example
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
FAQs
Used to determine whether an object has an own property with the specified property key.
The npm package has-own-property-x receives a total of 3,936 weekly downloads. As such, has-own-property-x popularity was classified as popular.
We found that has-own-property-x demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.