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.4.18 to 0.4.19

9

lib/index.js

@@ -287,2 +287,7 @@ "use strict";

VariableDeclarator: function VariableDeclarator(path) {
// Only consider the top level scope.
if (path.scope.block.type !== 'Program') {
return;
}
if (['ObjectPattern', 'ArrayPattern'].includes(path.node.id.type)) {

@@ -311,4 +316,4 @@ // Object or Array destructuring, so we will want to capture all

var hasRemainingReferencePaths = referencePaths.some(function (referencePath) {
var found = referencePath.find(function (p) {
return removedPaths.has(p);
var found = referencePath.find(function (path2) {
return removedPaths.has(path2);
});

@@ -315,0 +320,0 @@ return !found;

@@ -6,11 +6,10 @@ "use strict";

});
exports.default = _default;
exports.default = isAnnotatedForRemoval;
// weak
function _default(node) {
function isAnnotatedForRemoval(node) {
var comments = node.trailingComments || [];
return !!comments.find(function (_ref) {
return Boolean(comments.find(function (_ref) {
var value = _ref.value;
return value.trim() === 'remove-proptypes';
});
}));
}

@@ -7,3 +7,2 @@ "use strict";

exports.default = isStatelessComponent;
// weak
var traversed = Symbol('traversed');

@@ -10,0 +9,0 @@

@@ -8,4 +8,2 @@ "use strict";

// weak
/* eslint-disable no-param-reassign */

@@ -12,0 +10,0 @@ function isInside(scope, regex) {

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

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

"prettier": "find . -name \"*.js\" | grep -v -f .eslintignore | xargs prettier --write",
"test": "npm run lint && npm run test:unit && npm run flow",
"test": "npm run lint && npm run test:unit",
"prebuild": "rm -rf lib/",
"build": "babel src --out-dir lib",
"flow": "flow",
"version": "npm run build && pkgfiles"

@@ -57,3 +56,2 @@ },

"eslint-plugin-react": "^7.4.0",
"flow-bin": "^0.59.0",
"mocha": "^4.0.1",

@@ -60,0 +58,0 @@ "path-exists": "^3.0.0",

@@ -10,3 +10,3 @@ # babel-plugin-transform-react-remove-prop-types

[![Dependencies](https://img.shields.io/david/oliviertassinari/babel-plugin-transform-react-remove-prop-types.svg)](https://david-dm.org/oliviertassinari/babel-plugin-transform-react-remove-prop-types)
[![DevDependencies](https://img.shields.io/david/dev/oliviertassinari/babel-plugin-transform-react-remove-prop-types.svg)](https://david-dm.org/oliviertassinari/babel-plugin-transform-react-remove-prop-types#info=devDependencies&view=list)
[![DevDependencies](https://img.shields.io/david/dev/oliviertassinari/babel-plugin-transform-react-remove-prop-types.svg)](https://david-dm.org/oliviertassinari/babel-plugin-transform-react-remove-prop-types?type=dev)

@@ -13,0 +13,0 @@ ## Installation

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

// @flow weak
/* eslint-disable global-require, import/no-dynamic-require */

@@ -291,2 +290,7 @@

VariableDeclarator(path) {
// Only consider the top level scope.
if (path.scope.block.type !== 'Program') {
return
}
if (['ObjectPattern', 'ArrayPattern'].includes(path.node.id.type)) {

@@ -313,3 +317,3 @@ // Object or Array destructuring, so we will want to capture all

const hasRemainingReferencePaths = referencePaths.some(referencePath => {
const found = referencePath.find(p => removedPaths.has(p))
const found = referencePath.find(path2 => removedPaths.has(path2))
return !found

@@ -316,0 +320,0 @@ })

@@ -1,7 +0,5 @@

// @flow weak
export default function(node) {
export default function isAnnotatedForRemoval(node) {
const comments = node.trailingComments || []
return !!comments.find(({ value }) => value.trim() === 'remove-proptypes')
return Boolean(comments.find(({ value }) => value.trim() === 'remove-proptypes'))
}

@@ -1,3 +0,1 @@

// @flow weak
const traversed = Symbol('traversed')

@@ -4,0 +2,0 @@

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

// @flow weak
/* eslint-disable no-param-reassign */

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