🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

babel-plugin-mobx-observer-on-every-react-component

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-mobx-observer-on-every-react-component - npm Package Compare versions

Comparing version

to
0.1.16

10

dist/index.cjs.js

@@ -190,3 +190,11 @@ "use strict";

]);
path.replaceWith(variableDeclaration);
// now check to see if the function declaration is exported. If it is, we need to replace
// the functione with the observer-wrapped function and then export it
// If it's not exported, we can just replace the functoin with the variable declaration
if (path.parentPath.isExportDefaultDeclaration()) {
path.parentPath.replaceWith(t.exportDefaultDeclaration(observerFunction));
}
else {
path.replaceWith(variableDeclaration);
}
}

@@ -193,0 +201,0 @@ else {

@@ -165,3 +165,11 @@ import { declare } from "@babel/helper-plugin-utils";

]);
path.replaceWith(variableDeclaration);
// now check to see if the function declaration is exported. If it is, we need to replace
// the functione with the observer-wrapped function and then export it
// If it's not exported, we can just replace the functoin with the variable declaration
if (path.parentPath.isExportDefaultDeclaration()) {
path.parentPath.replaceWith(t.exportDefaultDeclaration(observerFunction));
}
else {
path.replaceWith(variableDeclaration);
}
}

@@ -168,0 +176,0 @@ else {

2

package.json
{
"name": "babel-plugin-mobx-observer-on-every-react-component",
"version": "0.1.15",
"version": "0.1.16",
"description": "Wrap literally every React component in an MobX observer higher order component.",

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

@@ -248,4 +248,12 @@ import { declare } from "@babel/helper-plugin-utils";

// now check to see if the function declaration is exported. If it is, we need to replace
// the functione with the observer-wrapped function and then export it
// If it's not exported, we can just replace the functoin with the variable declaration
if (path.parentPath.isExportDefaultDeclaration()) {
path.parentPath.replaceWith(t.exportDefaultDeclaration(observerFunction));
} else {
path.replaceWith(variableDeclaration);
} else {
}
} else {
// Replace the old function declaration with the new variable declaration

@@ -252,0 +260,0 @@ path.replaceWith(observerFunction);