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): export with trailing comma #59

Merged
merged 1 commit into from Jul 20, 2022
Merged

fix(findExports): export with trailing comma #59

merged 1 commit into from Jul 20, 2022

Conversation

westhide
Copy link
Contributor

fix findExport function:
when handle a export code with trailing comma , EXPORT_NAMED_RE Regex with contain the last comma , which cause
genarage a blank name(name='') export

it seams easy to resolve this case by add filter name!=='' to namedExport.names

namedExport.names = namedExport.exports.split(/\s*,\s*/g).map(name => name.replace(/^.*?\sas\s/, '').trim())

  • A little confuse about Regex at present , will try to fix this by adjust the EXPORT_NAMED_RE syntax later

@pi0
Copy link
Member

pi0 commented Jul 20, 2022

Thanks!

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

4 participants