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

add _DELIMITER_ to split env and uselessheader #11

Merged
merged 2 commits into from
Jun 20, 2018

Conversation

saltfish666
Copy link
Contributor

sorry for last bad pull request, I add DELIMITER to split env and useless header for your last comment.

index.js Outdated
if (line !== '') {
const parts = line.split('=');
ret[parts.shift()] = parts.join('=');
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion:

 	for (const line of stripAnsi(env).split('\n').filter(line => !!line)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, I just test this code, but afternpm test, it throws:

index.js:12:63
  ✖  12:63  use Boolean(line) instead.  no-implicit-coercion

so how about :

for (const line of stripAnsi(env).split('\n').filter(line => Bealoon(line))) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, yes. Boolean(line) instead of !!line.

index.js Outdated
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep this line

@silverwind
Copy link
Collaborator

LGTM once you resolve above comments.

@silverwind silverwind mentioned this pull request Jun 19, 2018
@silverwind silverwind merged commit f4676bf into sindresorhus:master Jun 20, 2018
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