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

babel-plugin-inline-replace-variables

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-inline-replace-variables - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

21

lib/index.js

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -6,2 +6,5 @@ Object.defineProperty(exports, "__esModule", {

});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/**

@@ -14,7 +17,17 @@ * Created at 16/5/18.

exports.default = function (_ref) {
var types = _ref.types;
var t = _ref.types;
return {
visitor: {
Identifier: function Identifier(path, state) {
path.node.name = JSON.stringify(state.opts[path.node.name]) || path.node.name;
var replacement = state.opts[path.node.name];
if (replacement !== undefined) {
var type = typeof replacement === 'undefined' ? 'undefined' : _typeof(replacement);
if (type === 'boolean') {
path.replaceWith(t.booleanLiteral(replacement));
} else {
// treat as string
var str = String(replacement);
path.replaceWith(t.stringLiteral(str));
}
}
}

@@ -25,2 +38,2 @@ }

module.exports = exports["default"];
module.exports = exports['default'];

2

package.json
{
"name": "babel-plugin-inline-replace-variables",
"version": "1.1.0",
"version": "1.1.1",
"description": "babel plugin to inline replace variables",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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