Description
Promote an explicit SemVer spelling to its bare release core, stripping prerelease and build without bumping numeric components.
Semantic versions have a major.minor.patch core, optional prerelease identifiers after a hyphen, and build identifiers after a plus. Prereleases precede the corresponding release; build metadata does not affect precedence. A textual spelling, an equal-precedence group and a major.minor release lane therefore answer different questions.1
Promote an explicit SemVer spelling to its bare release core, stripping prerelease and build without bumping numeric components.
When to use this tool
Use this tool to promote an explicit SemVer spelling to its bare release core, stripping prerelease and build without bumping numeric components.
How to use the tool and how it works
- Enter version using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.version. Use the ordering, boundary rules and absence conditions described below.
Parse the version, clear both prerelease and build identifiers, and format the same major.minor.patch core.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| version | One complete strict semantic-version string. | Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.version | Formatted semantic-version string after the stated transformation. |
{
"input": {
"version": "1.2.3-alpha.1+build.2"
},
"output": {
"result": {
"version": "1.2.3"
}
}
} Limitations and assumptions
- Promotion here removes suffixes; it does not increment a core component or publish a release.
- Version text is limited to 1,024 UTF-16 code units with no whitespace. Parsed core and numeric prerelease components must be nonnegative safe integers. Range expressions and a leading v are not accepted.
- Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.
Alternative or Complementary methods
Choose whether you need exact spelling, precedence or a release-lane grouping. Use a separate package manager or compatibility review for dependency resolution and release-policy decisions.
References
-
Semantic Versioning 2.0.0 — Semantic Versioning
-
Tool behavior and example: Semantic Version Release Promotion — tool.io
Similar or alternative tools
- Semantic Version Release Lane Groups
Group explicit versions into major.minor release lanes with source indexes; a caller-defined grouping, not stability or API compatibility certification.
- Semantic Version Build Record Extractor
Extract SemVer build identifiers as literal strings, preserving numeric-looking leading zeros without adding precedence meaning.