Skip to content

[FEATURE] Function to check for validity of a prerelease identifier #350

@boxcee

Description

@boxcee

What / Why

Problem described in #349: An 'invalid' identifier will lead to an invalid semver.
Now, there is no way to check beforehand whether an identifier is valid, except doing this:

const isValidIdentifier(identifier) => !!valid(inc(parse('0.0.1'), 'prerelease', identifier));

This is a request for a more straight-forward function, e.g. identifier(), which returns null (or false) if the identifier is invalid.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancementnew feature or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions