babel-plugin-conditional-compile
Advanced tools
Comparing version 0.0.4 to 0.0.5
'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,4 +12,4 @@ value: true | ||
mapKeys = [], | ||
mapFuncs = undefined, | ||
dropDebugger = undefined; | ||
mapFuncs = void 0, | ||
dropDebugger = void 0; | ||
return { | ||
@@ -32,3 +34,3 @@ visitor: { | ||
}, | ||
DebuggerStatement: function DebuggerStatement(path){ | ||
DebuggerStatement: function DebuggerStatement(path) { | ||
if (dropDebugger) { | ||
@@ -41,3 +43,4 @@ path.remove(); | ||
exit: function exit(path) { | ||
var res = path.get('test').evaluate(); | ||
var res = _evaluate.evaluate.call(path.get('test')); | ||
if (res.confident) { | ||
@@ -62,6 +65,4 @@ var replacement = path.get(res.value ? 'consequent' : 'alternate'); | ||
exit: function exit(path) { | ||
var operator = path.node.operator; | ||
var left = path.get('left'); | ||
var right = path.get('right'); | ||
var leftVal = left.evaluate(); | ||
var operator = path.node.operator;var left = path.get('left');var right = path.get('right'); | ||
var leftVal = _evaluate.evaluate.call(left); | ||
if (operator == '||' && leftVal.confident) { | ||
@@ -78,3 +79,3 @@ path.replaceWith(leftVal.value ? left : right); | ||
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } | ||
var _evaluate = require('./evaluate'); | ||
@@ -81,0 +82,0 @@ function mapAst(val, types) { |
@@ -12,3 +12,3 @@ /** | ||
return gulp.src('src/**/*.js').pipe(babel({ | ||
presets:['es2015'] | ||
presets: ['es2015', 'react', 'stage-0'] | ||
})).pipe(gulp.dest('dist')) | ||
@@ -15,0 +15,0 @@ }); |
{ | ||
"name": "babel-plugin-conditional-compile", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "babel plugin for conditional compile", | ||
@@ -26,3 +26,4 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"babel-core": "^6.3.26", | ||
"babel-core": "^6.11.4", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"babelify": "^7.2.0", | ||
@@ -29,0 +30,0 @@ "gulp": "^3.9.0", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
17872
6
508
6
1