nodesemver

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package nodesemver translates the npm semver package (semver 7.8.5) calls Pi's package manager makes. ValidRange, Satisfies and MaxSatisfying are validRange, satisfies and maxSatisfying; Parse is valid, and SemVer.Compare gives gt and rcompare. It implements node-semver's default options only (loose and includePrerelease false) and keeps its regular expressions, including the length-bounded forms its Range and SemVer parsers match against.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxSatisfying

func MaxSatisfying(versions []string, r string) (string, bool)

MaxSatisfying is maxSatisfying(versions, r): the first highest version the range accepts.

func Satisfies

func Satisfies(version, r string) bool

Satisfies is satisfies(version, r).

func ValidRange

func ValidRange(r string) (string, bool)

ValidRange is validRange(r): the normalized range, or false where it returns null.

Types

type SemVer

type SemVer struct {
	// contains filtered or unexported fields
}

SemVer is a parsed version (classes/semver.js). Prerelease identifiers keep their text: node-semver's numeric identifiers are canonical digit strings, so text equality is its === and numeric comparison happens in compareIdentifiers.

func Parse

func Parse(version string) (*SemVer, error)

Parse is parse(version): the SemVer node-semver constructs, or an error where it returns null.

func (*SemVer) Compare

func (v *SemVer) Compare(other *SemVer) int

Compare is SemVer.compare: -1, 0 or 1, ignoring build metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL