babel-plugin-transform-do-expressions
Advanced tools
Comparing version 6.22.0 to 7.0.0-alpha.1
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
19
3990
2
119
+ Addedbabel-plugin-syntax-do-expressions@7.0.0-alpha.1(transitive)
- Removedbabel-runtime@^6.22.0
- Removedbabel-plugin-syntax-do-expressions@6.13.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedregenerator-runtime@0.11.1(transitive)