bdcs-0.1.0: Tools for managing a content store of software packages

Safe HaskellSafe
LanguageHaskell2010

BDCS.NPM.SemVer

Synopsis

Documentation

data SemVer Source #

A Semantic version, as defined by http://semver.org/

type SemVerRangePart = [(Ordering, SemVer)] Source #

A single version condition, e.g. >= 1.0.0. To satisfy the condition, a SemVer must match at least one of the Orderings.

type SemVerRange = [SemVerRangePart] Source #

A range of semantic versions. To satisfy the range, a SemVer must satisfy every element of the list.

type SemVerRangeSet = [SemVerRange] Source #

A set of semantic version ranges. To satisfy the set, a SemVer must satisfy at least one of the ranges in the list.

parseSemVer :: Text -> Either ParseError SemVer Source #

Parse a semantic version

parseSemVerRangeSet :: Text -> Either ParseError SemVerRangeSet Source #

Parse a SemVer range set according to the npm syntax.

satisfies :: SemVer -> SemVerRangeSet -> Bool Source #

Whether a given version satisfies a given range.

When the version contains pre-release tags, it only satisifes a SemVerRange if at least one version in the range has a matching major.minor.patch version number and also contains pre-release tags.

toText :: SemVer -> Text Source #