[go: up one dir, main page]

olib_semver

Semantic versioning as a string abstract for easier serilializing
https://github.com/olichose123/olib_semver

To install, run:

haxelib install olib_semver 1.0.0 

See using Haxelib in Haxelib documentation for more information.

README.md

olib_semver - semver features in a string abstract

Nearly complete Semantic Versioning 2.0.0 implementation in Haxe. As it is now, only the prerelease comparison is not totally implemented.

Why? There are a few other semver implementations in Haxe, but most use a class instead of a string abstract. This means that you have to design custom serialization and deserialization logic to handle them. With an abstract, serializers see the version as what it is: a string.

var v = new Version("1.2.3-alpha.1+001");
var json = Json.stringify(v);
var v2:Version = Json.parse(json);

Installation

haxelib install olib_semver

Usage

import olib.semver.Version;

var version:Version = "1.1.0"; //valid
var version_with_v:Version = "v1.1.2"; //also valid, the v is ignored
var version_with_prerealase:Version = "1.1.2-alpha";
var version_with_prerealase_and_metadata:Version = "1.1.2-alpha+build.123";

version != version_with_v; //true, including prerelease and build metadata
version.minorMatch(version_with_v); //true, ignores patch (in this case, _._.2), prerelease and build metadata
version_with_prerealase.patchMatch("1.1.2-beta"); //true, ignores prerelease and build metadata
version_with_prerealase_and_metadata.prereleaseMatch("1.1.2-alpha+potato"); //true, ignores build metadata
Contributors
oli_chose123
Version
1.0.0
Published
2 years ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub