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

hoist-non-react-statics

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoist-non-react-statics - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

26

index.js

@@ -23,2 +23,3 @@ /**

var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
var getOwnPropertyNames = Object.getOwnPropertyNames;

@@ -35,5 +36,13 @@ module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {

for (var key in sourceComponent) {
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!REACT_STATICS[key] && (!blacklist || !blacklist[key])) {
if (hasOwnProperty.call(sourceComponent, key)) {
// Only hoist enumerables and non-enumerable functions
if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') {
try { // Avoid failures from read-only properties

@@ -46,15 +55,2 @@ targetComponent[key] = sourceComponent[key];

if (getOwnPropertySymbols) {
var symbols = getOwnPropertySymbols(sourceComponent);
for (var i = 0; i < symbols.length; i++) {
if (!REACT_STATICS[symbols[i]] && (!blacklist || !blacklist[symbols[i]])) {
if (propIsEnumerable.call(sourceComponent, symbols[i])) {
try { // Avoid failures from read-only properties
targetComponent[symbols[i]] = sourceComponent[symbols[i]];
} catch(e) {}
}
}
}
}
return targetComponent;

@@ -61,0 +57,0 @@ }

@@ -0,0 +0,0 @@ Software License Agreement (BSD License)

{
"name": "hoist-non-react-statics",
"version": "2.0.0",
"version": "2.1.0",
"description": "Copies non-react specific statics from a child component to a parent component",

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

@@ -0,0 +0,0 @@ # hoist-non-react-statics

Sorry, the diff of this file is not supported yet

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