pre_release_identifier {smvr}R Documentation

Single pre-release identifier

Description

A class representing a single pre-release identifier (alphanumeric or numeric) for Semantic Versioning 2.0.0.

Usage

new_pre_release_identifier(x = character())

Arguments

x

Something that can be coerced to a character vector by vctrs::vec_cast(). Each element must be ASCII alphanumerics, hyphens, or empty string (""). Empty string is a special case that means no identifier.

Details

Identifiers are compared based on the following criteria:

Value

A pre_release_identifier vector.

See Also

Examples

id <- new_pre_release_identifier(
  c("1", "2", "10", "01", "-1", "alpha", "beta", "", NA)
)
id

# empty < numeric < alphanumeric
vctrs::vec_sort(id)

# Works with base R vectors.
id[id == "alpha" & !is.na(id)]
id[id > 2L & !is.na(id)]

[Package smvr version 0.2.0 Index]