Skip to content

Commit

Permalink
layout
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsonChan committed Oct 10, 2024
1 parent b9e3b6d commit 3b788a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions babel-plugin-expose-private-functions-and-variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ module.exports = function ({types: t}) {
dfs(assignPath.get('left'));
dfs(assignPath.get('right'));

const left = assignPath.node.left,
right = assignPath.node.right;
const { left, right } = assignPath.node;
// case: FUNC = x -> window.PACKAGE._.FUNC = x
if (t.isIdentifier(left) && privateFuncs.has(left.name)) {
funcCallCount.set(left.name, funcCallCount.get(left.name) + 1);
Expand Down Expand Up @@ -214,7 +213,7 @@ module.exports = function ({types: t}) {

function dfs(path) {
path.traverse({
AssignmentExpression(assignPath) {assExp(assignPath);},
AssignmentExpression(assignPath) {assExp(assignPath); },
MemberExpression(memPath) { memExp(memPath); },
ConditionalExpression(condPath) { condExp(condPath); },
CallExpression(callPath) { callExp(callPath); },
Expand Down

0 comments on commit 3b788a9

Please sign in to comment.