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

@babel/plugin-syntax-private-property-in-object

Package Overview
Dependencies
Maintainers
6
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-syntax-private-property-in-object

Allow parsing of '#foo in obj' brand checks

  • 7.14.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20M
increased by0.95%
Maintainers
6
Weekly downloads
 
Created

What is @babel/plugin-syntax-private-property-in-object?

The @babel/plugin-syntax-private-property-in-object npm package allows Babel to parse syntax that uses private properties in objects. This is particularly useful for developers working with the latest JavaScript features, enabling them to write modern code that includes private class fields accessed within objects. It's important to note that this plugin only allows Babel to parse this syntax; it doesn't provide the implementation for how private properties work at runtime.

What are @babel/plugin-syntax-private-property-in-object's main functionalities?

Parsing private property in object syntax

This feature enables Babel to understand and parse code that checks for the existence of a private property within an object. The code sample demonstrates a class that includes a private property and a method to check if a private property exists within a given object using the 'in' operator.

{ class MyClass { #myPrivateProperty = 'secret'; checkPrivate(obj) { return #myPrivateProperty in obj; } } }

Other packages similar to @babel/plugin-syntax-private-property-in-object

Keywords

FAQs

Package last updated on 09 Jun 2021

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