Skip to content

Commit

Permalink
Remove redundant object property & member checks from isDev
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Jan 19, 2024
1 parent 6264971 commit d7871fe
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/metro-transform-plugins/src/inline-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ function inlinePlugin(

const isDev = (node: Node, parent: Node, scope: Scope): boolean =>
isIdentifier(node, dev) &&
isGlobalOrFlowDeclared(scope.getBinding(dev.name)) &&
!isMemberExpression(parent) &&
// not { __DEV__: 'value'}
(!isObjectProperty(parent) || parent.value === node);
isGlobalOrFlowDeclared(scope.getBinding(dev.name));

function findProperty(
objectExpression: ObjectExpression,
Expand Down

0 comments on commit d7871fe

Please sign in to comment.