Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report.isOneLineRequire should be true if single line LogicalExpression assignment #205

Merged
merged 12 commits into from
Jan 17, 2024
Merged

Conversation

jean-michelet
Copy link
Contributor

@jean-michelet jean-michelet commented Jan 15, 2024

EDIT: After exchanges with @fraxken, we need to check the LogicalExpression (left, right) and ConditionalExpression (consequent, alternate).


This pull request addresses issue #168.

I added an AST check to ensure that files containing only one line and composed of a LogicalExpression assignation, typically an export: module.exports = require('fs') || require('constants'), are considered as not minified.

Copy link
Member

@tony-go tony-go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good codewise.

Let @fraxken double-check, as I haven't put my nose into the code for a while.

index.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants