Skip to content

fix(findExports): exclude parameter names from function declaration export names#319

Merged
pi0 merged 3 commits intounjs:mainfrom
8ctavio:fix/function-export-names
Aug 22, 2025
Merged

fix(findExports): exclude parameter names from function declaration export names#319
pi0 merged 3 commits intounjs:mainfrom
8ctavio:fix/function-export-names

Conversation

@8ctavio
Copy link
Contributor

@8ctavio 8ctavio commented Aug 16, 2025

For exported function declarations (export function(a, b, c)), findExports includes the names of the function's parameter names as exported names.

The EXPORT_DECAL_RE regex that matches function declaration exports considers the parameters as 'extra names', but extra names only appear on variable declaration exports (const, let, var).

A simple check is added to prevent findExports to look for extra names matched by the regex on function declartion exports.

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

This comment was marked as duplicate.

@pi0 pi0 merged commit 5a0e8ed into unjs:main Aug 22, 2025
4 checks passed
@8ctavio 8ctavio deleted the fix/function-export-names branch September 6, 2025 00:34
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.

2 participants