Skip to content

fix(findExports): export with trailing comma#59

Merged
pi0 merged 1 commit into
mainfrom
unknown repository
Jul 20, 2022
Merged

fix(findExports): export with trailing comma#59
pi0 merged 1 commit into
mainfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Jul 20, 2022

Copy link
Copy Markdown

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

pi0 commented Jul 20, 2022

Copy link
Copy Markdown
Member

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.

3 participants