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

leading space redundant with url safe chars #20

Closed
olsonpm opened this issue Aug 15, 2018 · 0 comments · Fixed by #27
Closed

leading space redundant with url safe chars #20

olsonpm opened this issue Aug 15, 2018 · 0 comments · Fixed by #27

Comments

@olsonpm
Copy link

olsonpm commented Aug 15, 2018

I checked the commit history and didn't find any answers - but it seems the leading/trailing space message is unnecessary given that spaces are not url safe.

const result = validateNpmPackageName(' ')

const message = result.errors.concat(result.warnings).join('\n')

console.log(message)

// outputs
// name cannot contain leading or trailing spaces
// name can only contain URL-friendly characters

And if you're concerned with letting users know they have unexpected leading/trailing spaces in their package name, why not leave out the leading/trailing bit and just say spaces are not allowed? Leading/trailing implies that spaces in between are valid.

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 a pull request may close this issue.

1 participant