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: Filter empty strings out of list options #1483

Merged
merged 2 commits into from Oct 6, 2021
Merged

fix: Filter empty strings out of list options #1483

merged 2 commits into from Oct 6, 2021

Conversation

ValeriaVG
Copy link
Contributor

Filters out empty strings from split list env variables, allowing TS_NODE_IGNORE= <...> to be treated as an empty array.

Closes #1301

@cspotcode
Copy link
Collaborator

Thanks, where does this split function get used? Is it only used to split environment variables? Just want to be sure we don't break anything else.

Any chance you can tweak the JSDoc comment a bit to describe what it does, or at least explain that it's meant for env var parsing? Looks like it does some whitespace removal too. It might be nice to further clarify its intended usage, now that it's doing even more than a string split.

@ValeriaVG
Copy link
Contributor Author

@cspotcode Yes, it's imported only in src/index.ts and used only here:

 ignore: split(env.TS_NODE_IGNORE),
 // ...
 ignoreDiagnostics: split(env.TS_NODE_IGNORE_DIAGNOSTICS),

@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #1483 (9eb6fe0) into main (6e6bf63) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
src/util.ts 93.93% <100.00%> (+3.31%) ⬆️

Copy link
Collaborator

@cspotcode cspotcode left a comment

Choose a reason for hiding this comment

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

Approved. Pretty sure the test failures are some unrelated test flakiness that I'll address somewhere else.

@cspotcode cspotcode merged commit 1660ed1 into TypeStrong:main Oct 6, 2021
@cspotcode
Copy link
Collaborator

@ValeriaVG thanks again!

@cspotcode cspotcode added this to the 10.3.0 milestone Oct 10, 2021
@ValeriaVG ValeriaVG deleted the fix/ignore-empty-strings-in-array-options branch October 18, 2021 03:52
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.

Empty TS_NODE_IGNORE defaults to node_modules/
2 participants