Skip to main content Link Search Menu Expand Document (external link)

SemVer overview

A module that implements a CVSemVer brand, i.e. a string that represents a valid semantic version. See the Effect documentation about Branding (https://effect.website/docs/code-style/branded-types/) if you are not familiar with this concept.


Table of contents


Constructors

fromString

Tries to construct a CVSemVer from a string. Returns a Right if the conversion can be performed, a Left otherwise

Signature

export declare const fromString: MTypes.OneArgFunction<string, Either.Either<Type, Brand.Brand.BrandErrors>>

fromStringOption

Tries to construct a CVSemVer from a string. Returns a Some if the conversion can be performed, a None otherwise

Signature

export declare const fromStringOption: MTypes.OneArgFunction<string, Option.Option<Type>>

fromStringOrThrow

Constructs a CVSemVer if possible. Throws otherwise.

Signature

export declare const fromStringOrThrow: MTypes.OneArgFunction<string, Type>

unsafeFromString

Constructs a CVSemVer without any verifications

Signature

export declare const unsafeFromString: Brand.Brand.Constructor<Type>

Models

Type (type alias)

CVSemVer Type

Signature

export type Type = Brand.Branded<string, _TypeId>

Module markers

TypeId

Module TypeId

Signature

export declare const TypeId: typeof TypeId

moduleTag

Module tag

Signature

export declare const moduleTag: "@parischap/conversions/SemVer/"