Skip to content

leading space redundant with url safe chars #20

@olsonpm

Description

@olsonpm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions