
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
The 'has' npm package is a utility module that provides a function to check if an object has a property with a given key. It is a safer way to check for properties than the built-in JavaScript 'in' operator or property access, as it doesn't check the prototype chain and avoids potential issues with objects that have modified prototypes or lack a prototype altogether.
Check for own property
This feature allows you to check if an object has a specific own property. It returns true if the property exists directly on the object, and false otherwise.
const has = require('has');
const obj = { a: 1 };
console.log(has(obj, 'a')); // true
console.log(has(obj, 'b')); // false
Lodash's 'has' function is similar to 'has' in that it checks if a path is a direct property of an object. However, lodash.has also allows checking for deep properties using a dot or array path notation, which 'has' does not support.
This package provides functionality similar to 'has' by checking if an object contains a certain property. The difference is mainly in the implementation and the specific API provided by the package.
Object.prototype.hasOwnProperty.call shortcut
npm install --save has
var has = require('has');
has({}, 'hasOwnProperty'); // false
has(Object.prototype, 'hasOwnProperty'); // true
FAQs
Object.prototype.hasOwnProperty.call shortcut
The npm package has receives a total of 15,374,786 weekly downloads. As such, has popularity was classified as popular.
We found that has 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.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.