New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-minify-replace

Package Overview
Dependencies
Maintainers
5
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-minify-replace - npm Package Compare versions

Comparing version 0.5.0-alpha.7b176463 to 0.5.0-alpha.b4285271

37

lib/index.js
"use strict";
module.exports = function (_ref) {
var t = _ref.types;
var NO_MEMBER = Symbol("no member");
var replaceVisitor = {
module.exports = ({
types: t
}) => {
const NO_MEMBER = Symbol("no member");
const replaceVisitor = {
ReferencedIdentifier(path) {
var _path = path,
node = _path.node;
var optionsMap = this.replacements[node.name];
const _path = path,
node = _path.node;
const optionsMap = this.replacements[node.name];

@@ -16,3 +17,3 @@ if (!optionsMap) {

var options;
let options;

@@ -22,4 +23,4 @@ if (path.parentPath.isMemberExpression({

})) {
var property = path.parent.property;
var key = t.isIdentifier(property) && property.name;
const property = path.parent.property;
const key = t.isIdentifier(property) && property.name;

@@ -64,8 +65,8 @@ if (typeof key === "string") {

var map = Object.create(null);
this.opts.replacements.forEach(function (_ref2) {
var identifierName = _ref2.identifierName,
replacement = _ref2.replacement,
member = _ref2.member;
const map = Object.create(null);
this.opts.replacements.forEach(({
identifierName,
replacement,
member
}) => {
if (path.scope.globals[identifierName]) {

@@ -77,4 +78,4 @@ // Convert to a node, we only allow identifiers and literals as replacements

var node = t[replacement.type](replacement.value);
var options = {
const node = t[replacement.type](replacement.value);
const options = {
identifierName,

@@ -81,0 +82,0 @@ node,

{
"name": "babel-plugin-minify-replace",
"version": "0.5.0-alpha.7b176463",
"version": "0.5.0-alpha.b4285271",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [

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