Socket
Socket
Sign inDemoInstall

babel-plugin-transform-class-properties

Package Overview
Dependencies
Maintainers
6
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-class-properties - npm Package Compare versions

Comparing version 6.22.0 to 6.23.0

6

package.json
{
"name": "babel-plugin-transform-class-properties",
"version": "6.22.0",
"version": "6.23.0",
"description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax",

@@ -12,6 +12,6 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-class-properties",

"dependencies": {
"babel-helper-function-name": "^6.22.0",
"babel-helper-function-name": "^6.23.0",
"babel-plugin-syntax-class-properties": "^6.8.0",
"babel-runtime": "^6.22.0",
"babel-template": "^6.22.0"
"babel-template": "^6.23.0"
},

@@ -18,0 +18,0 @@ "devDependencies": {

@@ -36,3 +36,2 @@ # babel-plugin-transform-class-properties

[Try in REPL](http://babeljs.io/repl/#?babili=false&evaluate=false&lineWrap=false&presets=es2016%2Clatest%2Cstage-2&code=%20%20class%20Bork%20%7B%0A%20%20%20%20%2F%2FProperty%20initilizer%20syntax%0A%20%20%20%20instanceProperty%20%3D%20%22bork%22%3B%0A%20%20%20%20boundFunction%20%3D%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20return%20this.instanceProperty%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20%2F%2FStatic%20class%20properties%0A%20%20%20%20static%20staticProperty%20%3D%20%22babeliscool%22%3B%0A%20%20%20%20static%20staticFunction%20%3D%20function()%20%7B%0A%20%20%20%20%20%20return%20Bork.staticProperty%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20let%20myBork%20%3D%20new%20Bork%3B%0A%0A%20%20%2F%2FProperty%20initializers%20are%20not%20on%20the%20prototype.%0A%20%20console.log(Bork.prototype.boundFunction)%3B%20%2F%2F%20%3E%20undefined%0A%0A%20%20%2F%2FBound%20functions%20are%20bound%20to%20the%20class%20instance.%0A%20%20console.log(myBork.boundFunction.call(undefined))%3B%20%2F%2F%20%3E%20%22bork%22%0A%0A%20%20%2F%2FStatic%20function%20exists%20on%20the%20class.%0A%20%20console.log(Bork.staticFunction())%3B%20%2F%2F%20%3E%20%22babelIsCool%22)

@@ -81,6 +80,10 @@ ## Installation

* `spec` - Class properties are compiled to use `Object.defineProperty. Static fields are now defined even if they are not initialized
### `spec`
`boolean`, defaults to `false`.
Class properties are compiled to use `Object.defineProperty`. Static fields are now defined even if they are not initialized.
## References
* [Proposal: ES Class Fields & Static Properties](https://github.com/jeffmo/es-class-static-properties-and-fields)
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