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.3.0-alpha.0f04ec28 to 0.3.0-alpha.169f8743

32

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

@@ -18,7 +16,7 @@ return;

var options = void 0;
let options;
if (path.parentPath.isMemberExpression({ object: node })) {
var property = path.parent.property;
const property = path.parent.property;
var key = t.isIdentifier(property) && property.name;
const key = t.isIdentifier(property) && property.name;
if (typeof key === "string") {

@@ -63,8 +61,4 @@ options = optionsMap[key];

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]) {

@@ -76,4 +70,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,

@@ -80,0 +74,0 @@ node,

{
"name": "babel-plugin-minify-replace",
"version": "0.3.0-alpha.0f04ec28",
"version": "0.3.0-alpha.169f8743",
"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