NAME
URI::VersionRange::Util - Utility for URI::VersionRange
SYNOPSIS
use URI::VersionRange::Util qw(native_range_to_vers);
$vers = native_range_to_vers('npm', '~1.6.5 || >=1.7.2'); # vers:npm/>=1.6.5|<1.7.0|>=1.7.2
DESCRIPTION
URL::VersionRange::Util is the utility package for URL::VersionRange.
- $string = native_range_to_vers($scheme, $native_range)
-
Converts the specified native range string and returns the corresponding VERS string.
$vers = native_range_to_vers('npm', '~1.6.5 || >=1.7.2'); # vers:npm/>=1.6.5|<1.7.0|>=1.7.2Supported native range scheme:
- conan
- gem
- nginx
- npm
- nuget
- raku
- semver
For other schemes,
native_range_to_verswill attempt to convert the native range string to a VERS string, but this may not work perfectly.
Version compare utility
- $int = version_compare($scheme, $a, $b)
- $int = generic_version_compare($a, $b)
- $int = semver_version_compare($a, $b)
Semver utility
- $string = hash_to_semver(%hash)
- $bool = is_semver($string)
- $string = normalize_semver($string)
- %hash = parse_semver($string)
SUPPORT
Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at https://github.com/giterlizzi/perl-URI-PackageURL/issues. You will be notified automatically of any progress on your issue.
Source Code
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/giterlizzi/perl-URI-PackageURL
git clone https://github.com/giterlizzi/perl-URI-PackageURL.git
AUTHOR
Giuseppe Di Terlizzi <gdt@cpan.org>
LICENSE AND COPYRIGHT
This software is copyright (c) 2022-2026 by Giuseppe Di Terlizzi.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.