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

babel-plugin-transform-react-remove-prop-types

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-react-remove-prop-types - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

10

lib/index.js

@@ -43,6 +43,6 @@ 'use strict';

if (node.key.name === 'propTypes') {
var className = scope.block.id.name;
var binding = scope.getBinding(className);
var superClass = binding.path.get('superClass');
var id = scope.block.id;
var superClass = scope.path.get('superClass');
if (superClass.matchesPattern('React.Component') || superClass.node.name === 'Component') {

@@ -52,4 +52,4 @@ path.remove();

// Check for inheritance
className = superClass.node.name;
binding = scope.getBinding(className);
var className = superClass.node.name;
var binding = scope.getBinding(className);
superClass = binding.path.get('superClass');

@@ -56,0 +56,0 @@

{
"name": "babel-plugin-transform-react-remove-prop-types",
"version": "0.2.3",
"version": "0.2.4",
"description": "Remove unnecessary React propTypes from the production build",

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

@@ -37,6 +37,6 @@ import isStatelessComponent from './isStatelessComponent';

if (node.key.name === 'propTypes') {
let className = scope.block.id.name;
let binding = scope.getBinding(className);
let superClass = binding.path.get('superClass');
const id = scope.block.id;
let superClass = scope.path.get('superClass');
if (superClass.matchesPattern('React.Component') ||

@@ -46,4 +46,4 @@ superClass.node.name === 'Component') {

} else if (superClass.node.name) { // Check for inheritance
className = superClass.node.name;
binding = scope.getBinding(className);
const className = superClass.node.name;
const binding = scope.getBinding(className);
superClass = binding.path.get('superClass');

@@ -50,0 +50,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