Socket
Socket
Sign inDemoInstall

babel-plugin-conditional-compile

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-conditional-compile - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

dist/evaluate.js

19

dist/index.js
'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",

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