npm

package
v0.0.0-...-0b796d1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection []Version

Collection is a type that implements the sort.Interface interface so that versions can be sorted.

func (Collection) Len

func (v Collection) Len() int

func (Collection) Less

func (v Collection) Less(i, j int) bool

func (Collection) Swap

func (v Collection) Swap(i, j int)

type Constraints

type Constraints [][]constraint

Constraints is one or more constraint that a npm version can be checked against.

func NewConstraints

func NewConstraints(v string) (Constraints, error)

NewConstraints parses the given string and returns an instance of Constraints

func (Constraints) Check

func (cs Constraints) Check(v Version) bool

Check tests if a version satisfies all the constraints.

func (Constraints) String

func (cs Constraints) String() string

Returns the string format of the constraints

type Version

type Version = semver.Version

Version represents a semantic version.

func NewVersion

func NewVersion(s string) (Version, error)

NewVersion parses a given version and returns an instance of Version

Jump to

Keyboard shortcuts

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