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

@stdlib/assert-has-own-property

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/assert-has-own-property

Test if an object has a specified property.

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
352K
decreased by-14.28%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/assert-has-own-property?

@stdlib/assert-has-own-property is a utility package that provides a function to check if an object has a specified property as its own (not inherited) property.

What are @stdlib/assert-has-own-property's main functionalities?

Check if an object has a specified own property

This feature allows you to check if a given object has a specified property as its own property. The function returns `true` if the property exists and `false` otherwise.

const hasOwnProp = require('@stdlib/assert-has-own-property');

const obj = { 'a': 1, 'b': 2 };

console.log(hasOwnProp(obj, 'a')); // true
console.log(hasOwnProp(obj, 'c')); // false

Other packages similar to @stdlib/assert-has-own-property

Keywords

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

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.

Install

Related posts

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