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

babel-plugin-transform-do-expressions

Package Overview
Dependencies
Maintainers
6
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-do-expressions - npm Package Compare versions

Comparing version 6.22.0 to 7.0.0-alpha.1

8

lib/index.js

@@ -7,3 +7,3 @@ "use strict";

return {
inherits: require("babel-plugin-syntax-do-expressions"),
inherits: _babelPluginSyntaxDoExpressions2.default,

@@ -23,2 +23,6 @@ visitor: {

module.exports = exports["default"];
var _babelPluginSyntaxDoExpressions = require("babel-plugin-syntax-do-expressions");
var _babelPluginSyntaxDoExpressions2 = _interopRequireDefault(_babelPluginSyntaxDoExpressions);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
{
"name": "babel-plugin-transform-do-expressions",
"version": "6.22.0",
"version": "7.0.0-alpha.1",
"description": "Compile do expressions to ES5",

@@ -12,8 +12,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-do-expressions",

"dependencies": {
"babel-plugin-syntax-do-expressions": "^6.8.0",
"babel-runtime": "^6.22.0"
"babel-plugin-syntax-do-expressions": "7.0.0-alpha.1"
},
"devDependencies": {
"babel-helper-plugin-test-runner": "^6.22.0"
"babel-helper-plugin-test-runner": "7.0.0-alpha.1"
}
}

@@ -25,3 +25,2 @@ # babel-plugin-transform-do-expressions

[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=%0Alet%20x%20%3D%20100%3B%0A%0Alet%20a%20%3D%20do%20%7B%0A%20%20if(x%20%3E%2010)%20%7B%0A%20%20%20%20'big'%3B%0A%20%20%7D%20else%20%7B%0A%20%20%20%20'small'%3B%0A%20%20%7D%0A%7D%3B%0A%0Aconsole.log(a)%3B)

@@ -51,4 +50,2 @@ This example is not the best usage because it is too simple and using a ternary operator is a better option but you can have a much more complex condition in the `do { ... }` expression with several `if ... else` chains:

[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=let%20x%20%3D%20100%3B%0Alet%20y%20%3D%2020%3B%0A%0Alet%20a%20%3D%20do%20%7B%0A%20%20if(x%20%3E%2010)%20%7B%0A%20%20%20%20if(y%20%3E%2020)%20%7B%0A%20%20%20%20%20%20'big%20x%2C%20big%20y'%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20'big%20x%2C%20small%20y'%3B%0A%20%20%20%20%7D%0A%20%20%7D%20else%20%7B%0A%20%20%20%20if(y%20%3E%2010)%20%7B%0A%20%20%20%20%20%20'small%20x%2C%20big%20y'%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20'small%20x%2C%20small%20y'%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%3B%0A%0Aconsole.log(a)%3B)
## Example

@@ -80,4 +77,4 @@

if(color === 'blue') { <BlueComponent/>; }
if(color === 'red') { <RedComponent/>; }
if(color === 'green') { <GreenComponent/>; }
else if(color === 'red') { <RedComponent/>; }
else if(color === 'green') { <GreenComponent/>; }
}}

@@ -88,3 +85,2 @@ </div>

[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Creact%2Cstage-0&code=const%20Component%20%3D%20props%20%3D%3E%0A%20%20%3Cdiv%20className%3D'myComponent'%3E%0A%20%20%20%20%7Bdo%20%7B%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'blue')%20%7B%20%3CBlueComponent%2F%3E%3B%20%7D%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'red')%20%7B%20%3CRedComponent%2F%3E%3B%20%7D%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'green')%20%7B%20%3CGreenComponent%2F%3E%3B%20%7D%0A%20%20%20%20%7D%7D%0A%20%20%3C%2Fdiv%3E%0A%3B)

@@ -91,0 +87,0 @@ ## Installation

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