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

fix(findExports): find declaration export with inline object or array #247

Merged
merged 2 commits into from Apr 30, 2024

Conversation

Shunjun
Copy link
Contributor

@Shunjun Shunjun commented Apr 26, 2024

πŸ”— Linked issue

N/A

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • [ x] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I find findExports got the wrong result from export inline object or array, such as:
export const foo = [ bar, baz, fgg ];
or
export const foo = { bar, baz, fgg };

It returns [ "foo", "baz", "fgg" ]
but it should be only [ "foo" ]

I haven't checked other functions like findTypeExports findTypeExports

I have added some new tests and all tests passed on my machine locally.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 87.38%. Comparing base (226a47b) to head (75a4617).
Report is 31 commits behind head on main.

❗ Current head 75a4617 differs from pull request most recent head e0df809. Consider uploading reports for the commit e0df809 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #247      +/-   ##
==========================================
- Coverage   88.04%   87.38%   -0.66%     
==========================================
  Files           8        8              
  Lines        1062     1102      +40     
  Branches      188      200      +12     
==========================================
+ Hits          935      963      +28     
- Misses        127      139      +12     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@pi0 pi0 changed the title fix: find declaration export with inline object or array fix(findExports): find declaration export with inline object or array Apr 30, 2024
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks ❀️

@pi0 pi0 merged commit d880b1e into unjs:main Apr 30, 2024
4 checks passed
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.

None yet

2 participants