Realm
gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/semver
Rendered output
semver — Semantic Versioning on-chain
A port of golang.org/x/mod/semver. Parse vMAJOR.MINOR.PATCH[-prerelease][+build] and compare with SemVer 2.0.0 precedence.
Examples
| a | rel | b | note |
|---|---|---|---|
1.2.3 |
< | 1.2.10 |
numeric patch, not lexical |
1.0.0-alpha |
< | 1.0.0 |
pre-release < release |
1.0.0-alpha.1 |
< | 1.0.0-alpha.beta |
numeric id < alphanumeric id |
1.0.0-rc.1 |
< | 1.0.0 |
release candidate < final |
2.0.0 |
= | 2.0.0+build.5 |
build metadata ignored |
Try it
- Compare two versions:
/1.2.3/1.2.10 - Submitted list:
/sorted - Submit on-chain:
Submit("v1.4.2")
Query (read-only)
non-crossing functions · no tx, no wallet neededCompare(a string, b string) → int
Parse(s string) → struct{Major int; Minor int; Patch int; Pre []string; Build string; Orig string}, interface {Error func() string}
Call functions (state-changing)
signs a tx via AdenaSubmit(version string)
All exported functions (4)
show raw signatures
| Name | Params | Returns |
|---|---|---|
| Parse | [{"Name": "s", "Type": "string", "Value": ""}] | [{"Name": ".res.0", "Type": "struct{Major int; Minor int; Patch int; Pre []string; Build string; Orig string}", "Value": ""}, {"Name": ".res.1", "Type": "interface {Error func() string}", "Value": ""}] |
| Compare | [{"Name": "a", "Type": "string", "Value": ""}, {"Name": "b", "Type": "string", "Value": ""}] | [{"Name": ".res.0", "Type": "int", "Value": ""}] |
| Submit | [{"Name": "cur", "Type": "interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}", "Value": ""}, {"Name": "version", "Type": "string", "Value": ""}] | — |
| Render | [{"Name": "path", "Type": "string", "Value": ""}] | [{"Name": ".res.0", "Type": "string", "Value": ""}] |
Files
Storage
{
"raw": "storage: 18282, deposit: 1828200"
}